snapcraft 7.x fails to replace new variables
Metadata
Current evaluation
Rejected. Snapcraft 7.x uses an older craft-parts version that does not support newer environment variables. The team will not backport them. Users must use legacy variable names like CRAFT_ARCH_TRIPLET instead.
Suggested action: —
No scores available.
Issue body
### Bug Description
Snapcraft will fail to replace the new variable syntax and will only replace the old variable syntax.
### To Reproduce
Install snapcraft 7.x (only tested 7.5.4+), use the provided snapcraft.yaml.
Compare the error message just in case you remove the `{` `}` around the variable.
### Environment
Ubuntu 23.04, building with --use-lxd
### snapcraft.yaml
```shell
name: my-snap-name # you probably want to 'snapcraft register <name>'
base: core22 # the base snap is the execution environment for this snap
version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: |
This is my-snap's description. You have a paragraph or two to tell the
most important story about your snap. Keep it under 100 words though,
we live in tweetspace and your description wants to look good in the snap
store.
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots
architectures:
- build-on: amd64
build-for: riscv64
parts:
my-part:
# See 'snapcraft plugins'
plugin: nil
build-packages:
- gcc-${CRAFT_ARCH_TRIPLET_BUILD_FOR}
```
### Relevant log output
```shell
2024-03-18 20:52:34.621 :: 2024-03-18 20:52:28.857 part build packages: ['gcc-${CRAFT_ARCH_TRIPLET_BUILD_FOR}']
2024-03-18 20:52:34.621 :: 2024-03-18 20:52:28.857 Requested build-packages: ['gcc-${CRAFT_ARCH_TRIPLET_BUILD_FOR}']
2024-03-18 20:52:34.621 :: 2024-03-18 20:52:30.183 Marking gcc-${CRAFT_ARCH_TRIPLET_BUILD_FOR} (and its dependencies) to be fetched
2024-03-18 20:52:34.621 :: 2024-03-18 20:52:34.160 Cannot find package listed in 'build-packages': gcc-${CRAFT_ARCH_TRIPLET_BUILD_FOR}
```
### Additional context
_No response_
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Rejected. Snapcraft 7.x uses an older craft-parts version that does not support newer environment variables. The team will not backport them. Users must use legacy variable names like CRAFT_ARCH_TRIPLET instead. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as won't fix. The CRAFT_ARCH_TRIPLET_BUILD_FOR variable requires a newer craft-parts version not backported to Snapcraft 7.x. The team declined to update the dependency. Users should fallback to the legacy CRAFT_ARCH_TRIPLET variable. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as won't fix. Snapcraft 7.x lacks support for newer craft-parts environment variables due to an outdated dependency. Users should use legacy variable names like CRAFT_ARCH_TRIPLET instead of expecting a backport. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without a fix. Snapcraft 7.x cannot expand new CRAFT variables due to an outdated craft-parts dependency. Backporting is not planned; users must use legacy variable syntax instead. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without fixing. The new variables require a newer craft-parts version than Snapcraft 7.x supports. Backporting was declined, and users are advised to fallback to the older variable syntax instead. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4486 $CRAFT_ARCH_TRIPLET_BUILD_FOR doesn't work on core22 | snapcraft | closed | Resolved. The $CRAFT_ARCH_TRIPLET_BUILD_FOR substitution failure in core22 environment blocks was fixed in snapcraft 8. A maintainer confirmed the fix with a working test case demonstrating correct variable replacement. |