← Back to issue list

Setting source: .. causes pull to fail

View original Launchpad issue

Metadata

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

Current evaluation

Fixed by snapcore/snapcraft#725, adding support for snapcraft.yaml in a subdirectory and preventing recursive source copying.

Resolution: closed resolved

Reason: PR #725, “Support having the snapcraft.yaml in a subdir,” directly addressed the reported layout. A maintainer linked it as the new implementation after the earlier PR #645.

Evaluated by: mr-cal-bot

No scores available.

Issue body

I was contemplating putting the snapcraft.yaml in a subdirectory of the upstream source (e.g. apache-cassandra-3.7/snapcraft). This as it turns out does not work: $ mkdir -p snapcraft-test/child $ touch snapcraft-test/file $ cd snapcraft-test/child $ cat > snapcraft.yaml <<EOF name: test version: 1 summary: none description: none parts: parent: plugin: copy source: .. files: file: file EOF $ cd snapcraft-test/child $ snapcraft ... [Errno 36] File name too long: '/home/ev/snapcraft-test/child/parts/parent/src/child/parts/parent/src/child/parts/parent/src/child/parts/parent/src/child/parts/parent/src/child/parts/parent/src/child/parts/parent... snapcraft should either detect and error out, or skip copying the current working directory into itself.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by snapcore/snapcraft#725, adding support for snapcraft.yaml in a subdirectory and preventing recursive source copying.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #725 (commit a3d662744): snapcraft now skips the snapcraft.yaml directory when copying a parent local source, allowing the project file in a subdirectory. Resolved LP: #1600428; supersedes earlier PR #645.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR #725 (commit a3d662744), which supports snapcraft.yaml in a subdirectory and prevents parent-source copies from recursively including the working directory.
qwen/qwen3.6-35b-a3b — — Abandoned. Setting source: .. in snapcraft.yaml caused an infinite loop and file name too long error during pull. The bug was not fixed or addressed.
qwen/qwen3.6-35b-a3b — — Setting source: .. in a subdirectory caused infinite recursion and file name too long errors during the pull phase. The report was closed without resolution.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The report details an infinite recursion bug when using relative source paths in snapcraft.yaml. Zero comments and significant age indicate the issue was abandoned.
qwen/qwen3.6-35b-a3b — — Closed without a fix. Using source: .. in snapcraft.yaml triggers infinite recursion and a file name too long error. No resolution or workaround was documented.

Update history

Date Change
created

Related work

  • Likely Fixed By: snapcore/snapcraft#725 (confidence 98%)

    The PR title and issue context directly match support for a subdirectory-based snapcraft.yaml.

  • Related To: snapcore/snapcraft#645 (confidence 85%)

    An earlier implementation was linked before PR #725 was submitted as the new fix.

Related issues

Issue Project State Summary Similarity
#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.
80%
#1644350 Runnig snapcraft with sources on parent folders (over one level) causes infinite loops snapcraft (launchpad) closed Fixed by merged snapcore/snapcraft PR #926: local source traversal now excludes generated Snapcraft directories, preventing recursive copies when building from project subdirectories.
76%
#1549676 source-subdir says its "a source dir within a repo to build from" but misses that snapcraft will only copy that subdir snapcraft (launchpad) closed Fixed by merged ubuntu-core/snapcraft#344 (commit 6beb6fec6): Snapcraft now copies the full repository while building from the selected source-subdir.
75%
#725 Support having the snapcraft.yaml in a subdir. snapcraft merged Merged PR #725 (commit a3d662744) by kyrofa fixed infinite recursion when snapcraft.yaml lives in a project subdirectory, by skipping the config directory when listing sources. Resolves LP bug #1600428.
75%
#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.
74%
#1590108 Go plugin breaks with snapcraft.yaml in tree snapcraft (launchpad) closed Fixed by hard-linking local sources instead of symlinking them, preventing recursive GOPATH traversal; merged in snapcore/snapcraft#622 (commit a07fa0faa).
72%
#2604 sources: introduce SnapcraftSourceNotFoundError snapcraft merged Merged PR #2604 introduced clearer missing-source errors via SnapcraftSourceNotFoundError, exception chaining, and tests in commit 7527d0e82.
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%
#2015327 Files in path to snapcraft.yaml are excluded in source directive snapcraft (launchpad) open Core22 builds with Snapcraft 7.3.1 omit files from a source: ../.. tree and produce a dirty Git version; Core20 and Snapcraft 4.8 do not. The report is untriaged.
71%
#1816397 Modifying snapcraft.yaml with parts using local sources get dirty snapcraft (launchpad) closed Fixed in PR snapcore/snapcraft#2475 (53f96dc71): local-source dirty checks now ignore snap-directory changes, preventing manifest-only edits from rebuilding parts.
71%