← Back to issue list

Files created in override-stage fail to get copied to prime

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1917897
Type
issue
State
open
Author
~racb
Labels
Created
Updated
Closed

Current evaluation

Reporter's override-stage creates a symlink (usr/bin/awk) that is not copied into prime/, so it's missing from the snap. No maintainer response, no labels, 0 comments; ~5.5 years old. Likely a craft-parts fileset-tracking gap for scriptlet-created files.

Suggested action: needs triage

Reason: No labels, no assignee, and zero maintainer interaction in ~5.5 years, so it has never been triaged. The underlying mechanism is still present in craft-parts: _run_step returns empty StepContents when an override-stage scriptlet runs (part_handler.py:659-700), so scriptlet-created files are not tracked in StageState and may be dropped at prime — the same class of bug as canonical/craft-parts#1122 (override-prime). Whether it reproduces on a current snapcraft release is unverified, so a human should confirm before closing.

Impact: 40 Quick Win: 18.0 Staleness: 92 Complexity: 55 Confidence: 55 Support Request: 25

Issue body

In override-stage I put: override-stage: | snapcraftctl stage ln -s mawk usr/bin/awk This failed to end up in prime/ and the symlink created was missing from the snap. This was an attempt to work around "stage-packages: [awk]" not putting an awk symlink into the snap. My full snapcraft.yaml if you need it is at: http://paste.ubuntu.com/p/jw3Vhhv8q5/ Expected behaviour: things I create in stage using override-stage ends up being copied to prime. Actual behaviour: things I create don't seem to get copied. I don't know if this is intended behaviour or not, but the following documentation leads me to think that this should work: https://snapcraft.io/docs/parts-lifecycle#heading--steps """ prime: copies the staged components into the priming area, to their final locations for the resulting snap. This is very similar to the stage step, but files go into the priming area instead of the staging area. The prime step exists because the staging area might still contain files that are required for the build but not for the snap. For example, if you have a part that downloads and installs a compiler, then you stage this part so other parts can use the compiler during building. You can then use the prime filter keyword to make sure that it doesn’t get copied to the priming area, so it’s not taking up space in the snap. Some extra checks are also run during this step to ensure that all dependencies are satisfied for a proper run time. If confinement was set to classic, then files will be scanned and, if needed, patched to work with this confinement mode. """ I infer that given I haven't applied a filter, everything in stage/ should end up combined into prime.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 40
Quick Win: 18.0
Staleness: 92
Complexity: 55
Confidence: 55
Support Request: 25
needs triage Reporter's override-stage creates a symlink (usr/bin/awk) that is not copied into prime/, so it's missing from the snap. No maintainer response, no labels, 0 comments; ~5.5 years old. Likely a craft-parts fileset-tracking gap for scriptlet-created files.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 25
Confidence: 85
Support Request: 15
needs triage Untriaged report that symlinks created in override-stage are not copied to prime. No maintainer response, labels, or assignee after over five years.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 40
Confidence: 80
Support Request: 10
needs triage Files created in override-stage are not copied to prime during snap builds. The report is over five years old, has no maintainer comments or labels, and remains untriaged.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 25
Confidence: 85
Support Request: 30
close stale Reporter notes symlinks created in override-stage are not copied to prime, contradicting docs. Issue is 5+ years old with no maintainer response or labels.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 35
Confidence: 90
Support Request: 50
close stale Symlinks and files created in override-stage are not copied to prime during snap builds, contradicting expected lifecycle behavior. Open, zero comments, inactive for six days. Needs triage and assignment.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/craft-parts#1122 (confidence 60%)

    Same root cause pattern: craft-parts writes an empty fileset to step state when an override scriptlet runs, so scriptlet-created files are untracked; #1122 is the override-prime variant, this is the override-stage variant.

Related issues

Issue Project State Summary Similarity
#1122 craft-parts doesn't track primed files when using `override-prime` craft-parts open craft-parts writes an empty fileset to prime state when a part uses override-prime, since the scriptlet path in _run_step returns no tracked contents. Bug confirmed still present in current code; unlabelled, no comments; downstream snapcraft issue still open.
72%
#1995895 Cannot override stage snapcraft (launchpad) open Snapcraft pack fails with FileNotFoundError during prime step when using override-stage. Open for 3.8 years with no maintainer engagement.
70%