parser needs to replace project level variables
Metadata
Current evaluation
Parser-side substitution of SNAPCRAFT_PROJECT_NAME/VERSION landed via merged PR snapcore/snapcraft#773 (commit 362d6a5f5), closing the Launchpad bug that requested it.
Resolution: closed resolved
Reason: The maintainer (sergiusens) closed the bug on 2016-09-08 pointing to snapcore/snapcraft#773, which merged as commit 362d6a5f5 "parser - Handle project name and version variables". The parser now expands SNAPCRAFT_PROJECT_NAME and SNAPCRAFT_PROJECT_VERSION from the origin project, confirmed still present in snapcraft/parts/lifecycle.py.
Evaluated by: mr-cal-bot
Issue body
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Parser-side substitution of SNAPCRAFT_PROJECT_NAME/VERSION landed via merged PR snapcore/snapcraft#773 (commit 362d6a5f5), closing the Launchpad bug that requested it. | |
| stealth/space-bunny-alpha | — | closed resolved | Project name and version variables were added to the parser in PR #773, commit 362d6a5f5, enabling substitution of SNAPCRAFT_PROJECT_NAME and SNAPCRAFT_PROJECT_VERSION. | |
| stealth/space-bunny-alpha | — | closed resolved | Project name and version substitution was implemented in canonical/snapcraft#773, merged as commit 362d6a5f5. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #773 (commit 362d6a5f5) made the parser replace SNAPCRAFT_PROJECT_NAME and SNAPCRAFT_PROJECT_VERSION in remote parts with the origin project's values. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. The parser was expected to replace SNAPCRAFT_PROJECT_NAME and SNAPCRAFT_PROJECT_VERSION with project name and version values, but the request was abandoned or superseded by later updates. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without a linked resolution or pull request. The parser update to replace SNAPCRAFT_PROJECT_NAME and SNAPCRAFT_PROJECT_VERSION with origin values was abandoned. | |
| qwen/qwen3.6-35b-a3b | — | — | Abandoned. The parser was not updated to replace SNAPCRAFT_PROJECT_NAME and SNAPCRAFT_PROJECT_VERSION with origin name and version values. Closed without implementation or discussion. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
snapcraft#773
(confidence 97%)
Merged PR resolving the bug; commit 362d6a5f5 adds project name/version variable substitution in the parser for remote parts.
-
Related To:
snapcraft#757
(confidence 88%)
Preceding merged PR (commit dc0b68174) that introduced/exported SNAPCRAFT_PROJECT_NAME and SNAPCRAFT_PROJECT_VERSION, the variables this bug asked the parser to expand.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #773 parser - Handle project name and version variables | snapcraft | merged | Merged PR #773 (commit 362d6a5f5) added substitution of SNAPCRAFT_PROJECT_NAME and SNAPCRAFT_PROJECT_VERSION in remote parts using the origin snapcraft.yaml. | |
| #4702 [craft-application/core24] $SNAPCRAFT_PROJECT_VERSION and other fields not replaced | snapcraft | closed | Core24 project-variable replacement was fixed by merged PR #4757 (commit 27957515c). Remaining CRAFT_PROJECT_NAME and CRAFT_PROJECT_VERSION handling was tracked in craft-application#320. | |
| #5491 `${SNAPCRAFT_PROJECT_VERSION}` no longer works in URLs | snapcraft | closed | Regression in Snapcraft 8.9 broke ${SNAPCRAFT_PROJECT_VERSION} (and _NAME) expansion in part sources. Fixed by merged PR #5499 ("fix: evaluate variables in project file", commit abd5db829) and shipped in Snapcraft 8.9.2; issue closed after release announcement by mr-cal. | |
| #1746633 Variable substitution in snapcraft.yaml extension | snapcraft (launchpad) | closed | Support for ${SNAPCRAFT_PROJECT_NAME} and ${SNAPCRAFT_PROJECT_VERSION} was fixed in Snapcraft 2.42.1; the reporter confirmed the fix. | |
| #1216 docs: document custom project vars (SNAPCRAFT-1053) | craft-parts | closed | Closed unmerged after the documentation moved to Snapcraft; canonical/snapcraft#5727 merged the equivalent change in commit cba259a0d. | |
| #4231 SNAPCRAFT_PROJECT_VERSION is empty if not explicitly set at top level | snapcraft | closed | Closed as intended static behavior: Snapcraft does not dynamically refresh project variables, and the part-environment documentation was clarified on 2023-08-11. | |
| #757 Export important project variables | snapcraft | merged | Merged PR #757 (commit dc0b68174) exports SNAPCRAFT_PROJECT_NAME, SNAPCRAFT_PROJECT_VERSION, SNAPCRAFT_PROJECT_STAGE and per-part SNAPCRAFT_PART_INSTALL, refactoring _expand_env into the project loader so variables work in fixed yaml fields. LP #1588336. | |
| #2534 Add SNAPCRAFT_PROJECT_DIR environment variable. | snapcraft | merged | Merged PR #2534 (commit 3d4483d6f, 'project loader: add SNAPCRAFT_PROJECT_DIR environment variable') by tonysimpson, fixing Launchpad bug 1824417; the var still ships in snapcraft/parts/lifecycle.py global environment. | |
| #5727 docs: document custom project vars (SNAPCRAFT-1053) | snapcraft | merged | Merged in canonical/snapcraft#5727 as cba259a0d, documenting custom project variables for SNAPCRAFT-1053 after the work moved from canonical/craft-parts#1216. | |
| #5499 fix: evaluate variables in project file | snapcraft | merged | Merged in canonical/snapcraft#5499 (commit abd5db829), restoring project-variable expansion and fixing #5491 in Snapcraft 8.9.2. |