← Back to issue list

Enable snap version to be used in other parts of the snapcraft.yaml

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1588336
Type
issue
State
closed
Author
~oddbloke
Labels
—
Created
Updated
Closed

Current evaluation

Feature request for using the snap version inside other snapcraft.yaml fields delivered by merged snapcore/snapcraft PR #757 (commit dc0b68174), exporting SNAPCRAFT_PROJECT_NAME/VERSION/STAGE so sources can use $SNAPCRAFT_PROJECT_VERSION. LP bug closed.

Resolution: closed resolved

Reason: The discussion was redirected to snapcore/snapcraft PR #757 'Export important project variables', which was merged as dc0b68174; it moved _expand_env into the project loader and exported SNAPCRAFT_PROJECT_VERSION (still documented in docs/reference/part-environment-variables.rst and used in docs examples), and the LP bug was closed citing that PR.

Evaluated by: mr-cal-bot

No scores available.

Issue body

When building a Google Cloud SDK snap, we fetch an upstream tarball using the copy plugin. The URL that we fetch from contains the version number. To make updating to new versions quicker (and less error-prone), it would be nice if we could use the version as a variable in the URL. --- CURRENT --- version: 112.0.0 ... parts: google-cloud-sdk: plugin: copy source: https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-112.0.0-linux-x86_64.tar.gz --- IDEAL --- version: 112.0.0 ... parts: google-cloud-sdk: plugin: copy source: https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-{version}-linux-x86_64.tar.gz (Or $version or ... etc.)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Feature request for using the snap version inside other snapcraft.yaml fields delivered by merged snapcore/snapcraft PR #757 (commit dc0b68174), exporting SNAPCRAFT_PROJECT_NAME/VERSION/STAGE so sources can use $SNAPCRAFT_PROJECT_VERSION. LP bug closed.
stealth/space-bunny-alpha — closed resolved Project variables were added by merged PR #757 (dc0b68174), enabling reuse of the snap version in part configuration and source URLs.
stealth/space-bunny-alpha — closed resolved Snap name and version variable handling was added in PR #773, enabling project metadata to be referenced elsewhere in snapcraft.yaml.
qwen/qwen3.6-35b-a3b — — Abandoned. The feature request to template the snap version in other YAML fields was closed without implementation due to prolonged inactivity and zero comments.
qwen/qwen3.6-35b-a3b — — Abandoned without resolution. The request to interpolate the snapcraft version in other YAML fields received no comments or implementation, leaving the feature unimplemented.
qwen/qwen3.6-35b-a3b — — Closed without implementation. The request to interpolate the snap version in snapcraft.yaml fields was abandoned. Lacking discussion or patches, it was not adopted or superseded.
qwen3.6-35b-a3b-mtp-q6 — — Closed without implementation. The feature to interpolate the snapcraft version in other YAML fields received no comments or resolution, indicating it was abandoned.

Update history

Date Change
created

Related work

  • Likely Fixed By: canonical/snapcraft#757 (confidence 95%)

    Merged PR referenced in the last comment; commit dc0b68174 exports SNAPCRAFT_PROJECT_VERSION and related project variables usable in part sources.

  • Related To: snapcraft#3350 (confidence 55%)

    Later added advanced grammar support for build-environment (commit ef2fa17e1), enabling {version}-style substitution in fixed yaml fields.

Related issues

Issue Project State Summary Similarity
#1538688 Support referencing the stage dir from snapcraft.yaml snapcraft (launchpad) closed Implemented SNAPCRAFT_STAGE substitution for part properties and merged the fix in canonical/snapcraft#270 via eb033b40c.
73%
#1587933 Allow using .snapcraft.yaml as input snapcraft (launchpad) closed Feature implemented in canonical/snapcraft PR #582 (commit 98eda9897), shipped in snapcraft 2.12 to xenial; SRU verified by elopio and released to -updates, closing the Launchpad bug.
71%