← Back to issue list

Support $SNAPCRAFT_STAGE for parts

View original Github issue

Metadata

Project
snapcraft
Number
#270
Type
pull request
State
merged
Author
sergiusens
Labels
—
Created
Updated
Closed

Current evaluation

Merged in canonical/snapcraft#270 via eb033b40c, adding part-time replacement of $SNAPCRAFT_STAGE with the absolute stage-directory path.

Resolution: closed resolved

Reason: PR #270 was merged into main through commit eb033b40c, with implementation commit f3e6ecdb9. It added the requested SNAPCRAFT_STAGE substitution for parts.

Evaluated by: mr-cal-bot

No scores available.

Issue body

When a part is loaded, instances of $SNAPCRAFT_STAGE are replaced with the absolute path to the stage directory during runtime. LP: #1538688

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged in canonical/snapcraft#270 via eb033b40c, adding part-time replacement of $SNAPCRAFT_STAGE with the absolute stage-directory path.
stealth/space-bunny-alpha — closed resolved Merged into main as canonical/snapcraft#270, adding $SNAPCRAFT_STAGE substitution with the absolute stage-directory path for parts.
qwen/qwen3.6-35b-a3b — — Merged. Replaces $SNAPCRAFT_STAGE with the absolute stage directory path at runtime for parts. The implementation uses direct string substitution instead of environment variables, following reviewer feedback.
qwen3.6-35b-a3b-mtp-q6 — — Merged. Replaces $SNAPCRAFT_STAGE with the absolute stage directory path at runtime for parts. Implementation accepted over environment variable injection following maintainer review.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/snapcraft#757 (confidence 85%)

    Later exported important project environment variables, including SNAPCRAFT_STAGE.

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.
88%
#1557018 Access from the build system to $SNAPCRAFT_STAGE directory when after: keyword is used in parts snapcraft (launchpad) closed Closed as stale on 2016-05-29 after 60 days without activity; no resolving PR or commit was recorded. SNAPCRAFT_STAGE was later exported globally in #757.
78%
#6095 Allow staging snap components snapcraft open Feature request to support snap components in stage-snaps (snap+component syntax). Triaged as feasible; implementation lives upstream in craft-parts PR #1604, currently on hold pending snapd UX decisions on component access/management.
72%
#1805214 stage-snaps snapcraft (launchpad) closed Feature request for a stage-snaps keyword (unpack a snap's content into the snap being built, like stage-packages) was implemented and merged in canonical/snapcraft#2468 (commit 0983e4063), then shipped in the 3.2 release; follow-up fixes in #2525 and #3211.
70%
#1747778 Snapcraft.yml in 'snap' directory. prime/parts/stage in '.' snapcraft (launchpad) open Feature request (2018) to let snapcraft put parts/stage/prime build dirs next to snap/snapcraft.yaml instead of the project root. Maintainer kyrofa agreed it is desirable; no implementation exists — lifecycle still uses Path.cwd() as work_dir.
70%