← Back to issue list

Renaming a file in a directory declared as a source for a part doesn't trigger a new pull

View original Github issue

Metadata

Project
snapcraft
Number
#4984
Type
issue
State
open
Author
dilyn-corner
Labels
Status: Triaged Type: Enhancement
Created
Updated
Closed
—

Current evaluation

Triaged enhancement: some local-source changes, including file renames and tarball content changes, do not invalidate pull state, so rebuilds can reuse stale content; upstream craft-parts#817 remains open.

Suggested action: keep open

Reason: The issue is labeled Status: Triaged, and maintainer @mr-cal called it a "very useful enhancement" and explicitly filed canonical/craft-parts#817, which remains open. The exact reproducer and logs are actionable; LocalSource.check_if_outdated currently examines only currently walked paths and their mtimes, allowing removed or renamed paths to evade invalidation.

Evaluated by: mr-cal-bot

Impact: 55 Quick Win: 18 Complexity: 61 Confidence: 95 Actionability: 84

Issue body

### Bug Description If for some part `source: src/` is declared and the pull step already ran and I rename `src/foo` to `src/bar`, the pull step is not retriggered. This can cause at best, a missing file in the final snap, and at worst later steps to fail for no obvious reason. ### To Reproduce Create a snap with a part using `plugin: dump` and `source: src/`, with at least one file in `src/`. Run at least `snapcraft pull`. Rename that file, and rerun the build. ### Environment Ubuntu 23.10, building with snapcraft latest/edge with `--use-lxd`. ### snapcraft.yaml ```shell name: my-snap-name # you probably want to 'snapcraft register <name>' base: core24 # the base snap is the execution environment for this snap version: '0.1' # just for humans, typically '1.2+git' or '1.3.2' summary: Single-line elevator pitch for your amazing snap # 79 char long summary description: | This is my-snap's description. You have a paragraph or two to tell the most important story about your snap. Keep it under 100 words though, we live in tweetspace and your description wants to look good in the snap store. grade: devel # must be 'stable' to release into candidate/stable channels confinement: devmode # use 'strict' once you have the right plugs and slots parts: my-part: # See 'snapcraft plugins' plugin: dump source: src/ override-stage: | craftctl default [ -e "${CRAFT_STAGE}/foo" ] || exit 1 ``` ### Relevant log output ```shell First build: dilyn@Ares:~/test -> snapcraft Starting snapcraft, version 8.3.2.post51+git22ba3ae03 Logging execution to '/home/dilyn/.local/state/snapcraft/log/snapcraft-20240818-191843.140066.log' Launching managed ubuntu 24.04 instance... Creating instance from base instance Starting instance Starting snapcraft, version 8.3.2.post51+git22ba3ae03 Logging execution to '/tmp/snapcraft.log' Initialising lifecycle Installing build-packages Installing build-snaps Pulling my-part Building my-part :: + cp --archive --link --no-dereference . /root/parts/my-part/install Staging my-part :: + craftctl default :: + '[' -e /root/stage/foo ']' Priming my-part Packing... Reading snap metadata... Running linters... Running linter: classic Running linter: library Creating snap package... Packed my-snap-name_0.1_amd64.snap Second build, after mv src/foo src/bar: dilyn@Ares:~/test -> snapcraft Starting snapcraft, version 8.3.2.post51+git22ba3ae03 Logging execution to '/home/dilyn/.local/state/snapcraft/log/snapcraft-20240818-192056.040803.log' Launching managed ubuntu 24.04 instance... Starting instance Starting snapcraft, version 8.3.2.post51+git22ba3ae03 Logging execution to '/tmp/snapcraft.log' Initialising lifecycle Installing build-packages Installing build-snaps Skipping pull for my-part (already ran) Skipping build for my-part (already ran) Skipping stage for my-part (already ran) Skipping prime for my-part (already ran) Packing... Reading snap metadata... Running linters... Running linter: classic Running linter: library Creating snap package... Packed my-snap-name_0.1_amd64.snap ``` ### Additional context This is a hard problem to solve :)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 55
Quick Win: 18
Complexity: 61
Confidence: 95
Actionability: 84
keep open Triaged enhancement: some local-source changes, including file renames and tarball content changes, do not invalidate pull state, so rebuilds can reuse stale content; upstream craft-parts#817 remains open.
qwen/qwen3.6-35b-a3b
Impact: 70
Quick Win: 22
Complexity: 60
Confidence: 80
Actionability: 80
keep open Renaming files in a local source directory doesn't trigger a re-pull, causing silent build failures. Triaged enhancement tracked upstream in craft-parts#817.
qwen/qwen3.8-27b
Impact: 50
Quick Win: 15
Staleness: 55
Complexity: 70
Confidence: 80
Support Request: 10
keep open Enhancement: renaming or modifying a file in a local directory source (source: src/) doesn't retrigger the pull step, so snaps can silently miss files or fail later steps. Triaged and acknowledged; fix tracked upstream in craft-parts#817, still open.
qwen/qwen3.6-35b-a3b
Staleness: 70
Complexity: 75
Confidence: 85
Support Request: 10
keep open Enhancement to detect local source file renames and trigger a re-pull. Triaged and tracked upstream in craft-parts, but inactive for five months with no immediate resolution path.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 75
Confidence: 90
Support Request: 10
keep open Enhancement to detect local source file renames and trigger re-pulls. Triaged and acknowledged as complex, with an upstream craft-parts issue filed. Currently inactive but valid.

Update history

No update history recorded yet.

Related work

  • Blocked By: canonical/craft-parts#817 (confidence 97%)

    The matching local-source invalidation enhancement was filed upstream, where the lifecycle implementation belongs, and is still open.

Related issues

No related issues found above the similarity threshold.