← Back to issue list

Snapcraft doesn't ignore already-built snaps when `source` is the folder containing the `snapcraft.yaml`

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1575628
Type
issue
State
closed
Author
~olivier-interfasys
Labels
verification-done
Created
Updated
Closed

Current evaluation

Fixed and verified. Snapcraft now correctly excludes already-built .snap files when the source directory contains snapcraft.yaml, preventing unnecessary large copies during builds.

Suggested action:

No scores available.

Issue body

[Impact] * Many plugins support sources. When the `source` keyword points to the directory containing the `snapcraft.yaml`, Snapcraft creates a copy of that entire directory, including any snaps that have already been built (which can be very large). [Test Case] 1. Download and run `snapcraft` on http://people.canonical.com/~kyrofa/test-cases/1575628.tar . The result should be a .snap. 2. Run `snapcraft clean`. This shouldn't remove the .snap. 3. Run `snapcraft` again. 4. Notice that the .snap that was already built was copied into `parts/foo/build/`. 5. Apply the fix for this bug. 6. Run steps 2 and 3 again. 7. Notice that the .snap that was already built was NOT copied into `parts/foo/build/`. [Regression Potential] * When copying the source folder, Snapcraft-specific data is excluded (e.g. parts/ stage/ snap/ snapcraft.yaml, etc.). That data may no longer be excluded correctly.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Fixed and verified. Snapcraft now correctly excludes already-built .snap files when the source directory contains snapcraft.yaml, preventing unnecessary large copies during builds.
qwen/qwen3.6-35b-a3b Fixed Snapcraft to exclude already-built .snap files when the source directory contains snapcraft.yaml. The update prevents unnecessary copying of large build artifacts. Verified and closed.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1601 snapcraft.yaml: don't re-use build dir snapcraft merged Merged a fix for a source-build directory clash in snapcraft.yaml. The build directory was renamed to apt-build to avoid scriptlet conflicts. Approved by reviewers and passed CI, resolving the failure.
73%