← Back to issue list

source-subdir says its "a source dir within a repo to build from" but misses that snapcraft will only copy that subdir

View original Launchpad issue

Metadata

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

Current evaluation

Fixed by merged ubuntu-core/snapcraft#344 (commit 6beb6fec6): Snapcraft now copies the full repository while building from the selected source-subdir.

Resolution: closed resolved

Reason: Merged PR ubuntu-core/snapcraft#344, commit 6beb6fec6, changed source handling to copy the entire source even when source-subdir is specified.

Evaluated by: mr-cal-bot

No scores available.

Issue body

sources.py says source-subdir says its "a source dir within a repo to build from", however it makes not mention that it in fact will only copy that subdir into builddir and chop away the rest of the source repo.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by merged ubuntu-core/snapcraft#344 (commit 6beb6fec6): Snapcraft now copies the full repository while building from the selected source-subdir.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #344: Snapcraft now copies the full repository while building from the directory selected by source-subdir.
stealth/space-bunny-alpha — closed resolved Fixed by canonical/snapcraft#344: source-subdir now selects the build directory while the entire repository is copied, rather than discarding the rest of the source.
qwen/qwen3.6-35b-a3b — — Abandoned. The source-subdir documentation remains inaccurate, failing to specify that snapcraft only copies the designated subdirectory to the build directory. No fixes or comments were added.
qwen/qwen3.6-35b-a3b — — Closed without resolution or comments. The issue highlighted a documentation gap regarding snapcraft's source-subdir parameter, noting it copies only the specified directory without warning.

Update history

Date Change
created

Related work

  • Likely Fixed By: ubuntu-core/snapcraft#344 (confidence 100%)

    The maintainer linked this PR as the fix, and its merge commit is 27e36feed.

Related issues

Issue Project State Summary Similarity
#1600428 Setting source: .. causes pull to fail snapcraft (launchpad) closed Fixed by snapcore/snapcraft#725, adding support for snapcraft.yaml in a subdirectory and preventing recursive source copying.
75%
#349 Backport to 1.x: Copy entire source, even if source-subdir is specified. snapcraft merged Merged into 1.x via #349, backporting #344 so Snapcraft copies the entire fetched source while using source-subdir to select the build directory.
74%
#94 Support the source-subdir keyword for parts snapcraft merged Merged snapcraft#94 via 9fe120945 (implementation 8741af4a3), adding source-subdir support while preserving source trees and delegating build-subdirectory selection to plugins.
73%
#645 If "source: .." do not copy the current directory into itself. snapcraft closed Superseded by canonical/snapcraft#725, merged as a3d662744; it fixed LP #1600428 by excluding the snapcraft.yaml directory from parent-source traversal.
72%
#2256 local source: don't include .snapcraft directory snapcraft merged Merged #2256 (commit abbc92427), fixing LP #1791773 by excluding .snapcraft from local-source copies and stale-part checks.
71%
#1575628 Snapcraft doesn't ignore already-built snaps when `source` is the folder containing the `snapcraft.yaml` snapcraft (launchpad) closed Snapcraft now filters *.snap files from sourcedir, preventing rebuilt artifacts from being copied into part build directories; shipped in version 2.10.1.
71%
#1640675 Add source option for git submodules snapcraft (launchpad) closed Feature request implemented: source-submodules added to git sources, merged as snapcraft PR #3629 (383c1f1ce) and craft-parts PR #169 (3891f255); shipped in Snapcraft 7 and 8. Maintainer closed the2016 Launchpad bug as done.
71%