parts: define variables and expand them in snapcraft.yaml
Metadata
Current evaluation
Merged after approval and passing CI. Adds global and step-specific SNAPCRAFT_* variables for snapcraft.yaml and lifecycle execution, extending CRAFT_* support. A reviewer requested a spread test rerun for 22.04.
Suggested action: —
No scores available.
Issue body
Define `SNAPCRAFT_*` variables that can be used in addition to `CRAFT_*`
variables in snapcraft.yaml and in the lifecycle step execution
environment. Variables can be global or specific to a step, and only
global variables can be used in the yaml file. Example:
```
parts:
part1:
...
organize:
foo: usr/$SNAPCRAFT_ARCH_TRIPLET/foo
```
Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com>
- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [ ] Have you successfully run `make lint`?
- [ ] Have you successfully run `pytest tests/unit`?
-----
CRAFT-1071
CRAFT-1074
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged after approval and passing CI. Adds global and step-specific SNAPCRAFT_* variables for snapcraft.yaml and lifecycle execution, extending CRAFT_* support. A reviewer requested a spread test rerun for 22.04. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Introduces SNAPCRAFT_* environment variables for snapcraft.yaml and lifecycle steps. Global variables are usable in YAML, step-specific ones during execution. Approved after spread tests were rerun for 22.04. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Introduces SNAPCRAFT_* environment variables for snapcraft.yaml and lifecycle steps. Global variables are usable in YAML, while step-specific variables apply to execution. Spread tests require rerunning for 22.04. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4607 fix(application): support snap/craft environment variables | snapcraft | merged | Merged after three approvals and passing CI. The PR adds snap/craft environment variable support across two files. Initial spread test failures and merge conflicts from a concurrent PR were resolved before final integration. | |
| #302 parts: add project-specific global variables | rockcraft | merged | Merged implementation adding project-specific global variables (name and version) via a prologue callback, following Snapcraft. Closes #299. Approved by two reviewers with passing CI. Refactors tests and modifies nine files. | |
| #2793 tests: enable SNAPCRAFT_BUILD_INFO for spread | snapcraft | merged | Merged following approval and passing CI. Enabled SNAPCRAFT_BUILD_INFO for spread tests to cover manifest changes. Included a fix for the nil-basic spread test. Minimal diff across three files. | |
| #2122 many: introduce variables for part src and build | snapcraft | merged | Merged following approval. Introduces new environment variables and replacements for part src and build directories, resolving LP #1763028. Consolidates SNAPCRAFT_* environment handling into a single location. Approved by one reviewer with passing CI checks. | |
| #5845 test(spread): test building base and snapd snaps | snapcraft | merged | Merged spread tests for building base and snapd snaps. Despite initial CI failures linked to snapcraft issue #5843, the changes were approved and integrated to maintain build compatibility with mainline snapcraft. | |
| #239 feat(snap_config): add snap_config model and utilities | craft-application | merged | Merged snap_config model and utilities into craft-application. Imported from snapcraft, updated to coding standards, and made generic. Approved by two reviewers, passed CI, and initiates a three-part series for build mode configuration. | |
| #386 tests: update testing to use craft-test | fetch-service | merged | Merged. Replaced direct spread calls with snapcraft test in workflows and spread.yaml, requiring a core24 base update. Approved by two reviewers and modified 10 files (+56/-125 lines). | |
| #4 snap: introduce initial snap packaging (CRAFT-578) | rockcraft | merged | Merged initial snap packaging implementation (CRAFT-578). Approved by one reviewer, passed CI checks, and added 86 lines across three files. | |
| #1996 tests: add SNAPCRAFT_KEEP_DATA to debug | snapcraft | merged | Merged test updates adding the SNAPCRAFT_KEEP_DATA environment variable for debugging. Approved by two reviewers, the change modifies two files with a net addition of 14 lines. Submitted as a farewell gift to @sergiusens. | |
| #3478 ci: add requirements for snapcraft legacy in spread | snapcraft | merged | Merged after approval by one reviewer. Adds CI requirements for snapcraft legacy in spread, modifying one file with three additions and four deletions. |