[craft-application/core24] $SNAPCRAFT_PROJECT_VERSION and other fields not replaced
Metadata
Current evaluation
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.
Suggested action: —
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 |
|---|---|---|---|---|
| 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. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Resolved via PR #4757. CRAFT_PROJECT_NAME and CRAFT_PROJECT_VERSION remain unevaluated and are tracked separately in craft-application#320. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4704 Some variables aren't properly set | snapcraft | closed | Fixed via PR #4757 by correctly setting architecture variables for core24 cross-architecture builds. CRAFT_PROJECT_NAME and CRAFT_PROJECT_VERSION remain unprocessed and are tracked separately in craft-application issue #320. | |
| #4757 fix: set project variables for core24 | snapcraft | merged | Merged a fix setting CRAFT_PROJECT_NAME and CRAFT_PROJECT_VERSION variables for core24 snaps. Approved by two reviewers, passed CI, and resolved issues #4704 and #4702. | |
| #4231 SNAPCRAFT_PROJECT_VERSION is empty if not explicitly set at top level | snapcraft | closed | Closed without a code fix. Maintainers explained dynamic environment variables are unsupported, and documentation was updated to clarify that SNAPCRAFT_PROJECT_VERSION only reflects statically set versions. | |
| #1619418 parser needs to replace project level variables | snapcraft (launchpad) | closed | 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. | |
| #1923835 $SNAPCRAFT_PROJECT_VERSION isn't working for source once set via snapcraftctl | snapcraft (launchpad) | closed | The bug where $SNAPCRAFT_PROJECT_VERSION fails to propagate in source fields after snapcraftctl set-version was closed without resolution or comments, indicating the report was abandoned. | |
| #773 parser - Handle project name and version variables | snapcraft | merged | Merged. Replaces $SNAPCRAFT_PROJECT_VERSION and $SNAPCRAFT_PROJECT_NAME with values from the origin snapcraft.yaml in remote parts, addressing LP:#1619418. Changes span 4 files with 86 additions and 27 deletions. |