← Back to issue list

[craft-application/core24] $SNAPCRAFT_PROJECT_VERSION and other fields not replaced

View original Github issue

Metadata

Project
snapcraft
Number
#4702
Type
issue
State
closed
Author
lengau
Labels
—
Created
Updated
Closed

Current evaluation

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.

Resolution: closed resolved

Reason: The maintainer explicitly marked the report fixed via PR #4757, which merged as commit 27957515c and fixed core24 project-variable expansion.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description On core24, $SNAPCRAFT_PROJECT_VERSION and $SNAPCRAFT_PROJECT_NAME are not replaced in parts. ### To Reproduce Build the core24 snap at https://github.com/lengau/hello-snapcraftio Compare to the (working) core22 snap. ### Environment Ubuntu Noble ### snapcraft.yaml ```shell name: hello base: core24 build-base: devel confinement: strict grade: devel platforms: amd64: arm64: armhf: ppc64el: riscv64: s390x: version: "2.12.1" summary: GNU Hello description: GNU hello prints a friendly greeting. apps: hello: command: bin/hello universe: # '"' is not allowed for commands. command: bin/hello -g $SAY environment: SAY: "Hello, universe!" parts: gnu-hello: source: https://git.savannah.gnu.org/git/$SNAPCRAFT_PROJECT_NAME.git source-tag: v$SNAPCRAFT_PROJECT_VERSION plugin: autotools build-packages: - wget - gperf - texinfo - help2man autotools-configure-parameters: - --prefix=/ stage: - -share/man - -share/info ``` ### Relevant log output ```shell lengau@ratel:~/Projects/hello-snapcraftio$ snapcraft pack --verbosity=verbose Starting snapcraft, version 8.0.5.post142+gitab1c86df Logging execution to '/home/lengau/.local/state/snapcraft/log/snapcraft-20240327-201231.164719.log' Launching managed ubuntu devel instance... Starting instance Creating instance from base instance Starting instance Starting snapcraft, version 8.0.5.post142+gitab1c86df Logging execution to '/tmp/snapcraft.log' Initialising lifecycle Installing build-packages Installing build-snaps Pulling gnu-hello Failed to pull source: command ['git', 'clone', '--recursive', '--branch', 'v$SNAPCRAFT_PROJECT_VERSION', 'https://git.savannah.gnu.org/git/$SNAPCRAFT_PROJECT_NAME.git', '/root/parts/gnu-hello/src'] exited with code 128. Recommended resolution: Make sure sources are correctly specified. Failed to execute snapcraft in instance. Full execution log: '/home/lengau/.local/state/snapcraft/log/snapcraft-20240327-201231.164719.log' ``` ### Additional context _No response_

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved 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.
stealth/space-bunny-alpha — closed resolved Core24 SNAPCRAFT_PROJECT_* expansion fixed by merged PR #4757 (commit 27957515c). Residual CRAFT_PROJECT_NAME/VERSION interpolation moved to canonical/craft-application#320, later addressed by craft-application #335 and #872.
stealth/space-bunny-alpha — closed resolved Core24 SNAPCRAFT_PROJECT_* replacement was fixed by merged PR #4757 (commit 27957515c). Remaining CRAFT_PROJECT_NAME/VERSION interpolation was tracked in craft-application#320.
qwen/qwen3.6-35b-a3b — — Resolved via PR #4757. The core24 variable replacement failure was fixed, though CRAFT_PROJECT_NAME and CRAFT_PROJECT_VERSION remain unevaluated and are tracked separately in craft-application#320.
qwen/qwen3.6-35b-a3b — — Fixed via PR #4757. $SNAPCRAFT_PROJECT_VERSION and $SNAPCRAFT_PROJECT_NAME replacement in core24 builds was resolved. CRAFT_PROJECT_NAME and CRAFT_PROJECT_VERSION remain unevaluated, tracked in craft-application#320.
qwen/qwen3.6-35b-a3b — — Fixed via PR #4757. Core24 variable substitution was resolved, though CRAFT_PROJECT_NAME and CRAFT_PROJECT_VERSION remain unevaluated and are tracked in craft-application issue #320.
qwen3.6-35b-a3b-mtp-q6 — — Resolved via PR #4757. Core24 variable replacement was fixed, but CRAFT_PROJECT_NAME and CRAFT_PROJECT_VERSION remain unevaluated and are tracked separately in craft-application issue #320.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: snapcraft#4757 (confidence 100%)

    Merged fix for setting and expanding project variables on core24.

  • Related To: snapcraft#4704 (confidence 95%)

    Reported similar unset project variables and was also resolved by #4757.

  • Related To: canonical/craft-application#320 (confidence 95%)

    Follow-up tracking for CRAFT_PROJECT_NAME and CRAFT_PROJECT_VERSION handling.

Related issues

Issue Project State Summary Similarity
#4704 Some variables aren't properly set snapcraft closed Fixed core24 architecture/project environment-variable setup by merged PR #4757 (commit 27957515c); remaining CRAFT_PROJECT_NAME/VERSION interpolation stayed tracked in craft-application#320.
79%
#4757 fix: set project variables for core24 snapcraft merged Merged #4757 as commit 27957515c, fixing core24 project-variable expansion and closing #4704/#4702; CRAFT_* setup was linked to canonical/craft-application#320.
75%
#1619418 parser needs to replace project level variables snapcraft (launchpad) closed Parser-side substitution of SNAPCRAFT_PROJECT_NAME/VERSION landed via merged PR snapcore/snapcraft#773 (commit 362d6a5f5), closing the Launchpad bug that requested it.
74%
#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.
74%
#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.
73%
#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.
73%
#4771 Snapcraft does not evaluate project variables added by extensions in core24 snapcraft closed Fixed by merged PR #4779 (commit 3e3428ec1), upgrading craft-application to 2.6.3 so extension-added project variables are evaluated in core24.
73%
#3753 parts: expand CRAFT_PROJECT_VERSION and CRAFT_PROJECT_GRADE snapcraft closed Closed unmerged: Snapcraft retained SNAPCRAFT_PROJECT_VERSION and SNAPCRAFT_PROJECT_GRADE for compatibility; core22 parts should use craftctl get version and craftctl get grade.
72%