← Back to issue list

`organize:{ /: another-dir/ }` causes the items under host root directory to be copied in another-dir

View original Launchpad issue

Metadata

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

Current evaluation

Bug report (8+ years old, 0 comments, no labels) that `organize: /: patches/` copies the build host's root directory contents into the part install dir instead of just the patch file. Organize logic since rewritten in craft-parts; never triaged by a maintainer.

Suggested action: needs triage

Reason: No labels, no maintainer comments, no assignee — never triaged. It is a genuine bug report (not a support question), so close_not_a_bug doesn't fit, and inactivity alone is insufficient for close_stale without confirming it's no longer reproducible. The organize code has been substantially rewritten in craft-parts (craft_parts/executor/organize.py), so a maintainer should verify whether the `/` key still misbehaves before closing.

Impact: 30 Quick Win: 13.5 Staleness: 92 Complexity: 55 Confidence: 55 Support Request: 20

Issue body

Consider the following `parts` recipe: ```yaml patches: source: snap/patches plugin: dump organize: /: patches/ override-prime: 'true' ``` Here's the content under snap/patches: ``` snap/patches └── enchant-fix-build.patch 0 directories, 1 file ``` One may expect that the `organize` stanza will make snapcraft move enchant-fix-build.patch to $SNAPCRAFT_STAGE/patches/enchant-fix-build.patch, but when running the build step of `patches` part, the content of $SNAPCRAFT_PART_INSTALL becomes: ``` parts/patches/install/ ├── enchant-fix-build.patch └── patches ├── bin │ ├── bash │ ├── btrfs │ ├── btrfs-calc-size │ ├── btrfsck -> btrfs │ ├── btrfs-convert │ ├── btrfs-debug-tree │ ├── btrfs-find-root │ ├── btrfs-image │ ├── btrfs-map-logical │ ├── btrfs-select-super │ ├── btrfs-show-super │ ├── btrfstune │ ├── btrfs-zero-log │ ├── bunzip2 │ ├── busybox │ ├── bzcat │ ├── bzcmp -> bzdiff │ ├── bzdiff │ ├── bzegrep -> bzgrep │ ├── bzexe │ ├── bzfgrep -> bzgrep │ ├── bzgrep │ ├── bzip2 │ ├── bzip2recover │ ├── bzless -> bzmore │ ├── bzmore │ ├── cat │ ├── chacl │ ├── chgrp │ ├── chmod │ ├── chown │ ├── chvt │ ├── cp │ ├── cpio │ ├── dash │ ├── date │ ├── dd │ ├── df │ ├── dir │ ├── dmesg │ ├── dnsdomainname -> hostname │ ├── domainname -> hostname │ ├── dumpkeys │ ├── echo │ ├── ed │ ├── egrep │ ├── false │ ├── fgconsole │ ├── fgrep │ ├── findmnt │ ├── fsck.btrfs │ ├── fuser │ ├── fusermount │ ├── getfacl │ ├── grep │ ├── gunzip │ ├── gzexe │ ├── gzip │ ├── hostname │ ├── ip │ ├── journalctl │ ├── kbd_mode │ ├── kill │ ├── kmod │ ├── less │ ├── lessecho │ ├── lessfile -> lesspipe │ ├── lesskey │ ├── lesspipe │ ├── ln │ ├── loadkeys │ ├── login │ ├── loginctl │ ├── lowntfs-3g │ ├── ls │ ├── lsblk │ ├── lsmod -> kmod │ ├── mkdir │ ├── mkfs.btrfs │ ├── mknod │ ├── mktemp │ ├── more │ ├── mount │ ├── mountpoint │ ├── mt -> /etc/alternatives/mt │ ├── mt-gnu │ ├── mv │ ├── nano │ ├── nc -> /etc/alternatives/nc │ ├── nc.openbsd │ ├── netcat -> /etc/alternatives/netcat │ ├── netstat │ ├── networkctl │ ├── nisdomainname -> hostname │ ├── ntfs-3g │ ├── ntfs-3g.probe │ ├── ntfs-3g.secaudit │ ├── ntfs-3g.usermap │ ├── ntfscat │ ├── ntfscluster │ ├── ntfscmp │ ├── ntfsfallocate │ ├── ntfsfix │ ├── ntfsinfo │ ├── ntfsls │ ├── ntfsmove │ ├── ntfstruncate │ ├── ntfswipe │ ├── open -> openvt │ ├── openvt │ ├── pidof -> /sbin/killall5 │ ├── ping │ ├── ping6 │ ├── plymouth │ ├── ps │ ├── pwd │ ├── rbash -> bash │ ├── readlink │ ├── red │ ├── rm │ ├── rmdir │ ├── rnano -> nano │ ├── run-parts │ ├── sed │ ├── setfacl │ ├── setfont │ ├── setupcon │ ├── sh -> dash │ ├── sh.distrib -> dash │ ├── sleep │ ├── ss │ ├── static-sh -> busybox │ ├── stty │ ├── su │ ├── sync │ ├── systemctl │ ├── systemd -> /lib/systemd/systemd │ ├── systemd-ask-password │ ├── systemd-escape │ ├── systemd-hwdb │ ├── systemd-inhibit │ ├── systemd-machine-id-setup │ ├── systemd-notify │ ├── systemd-tmpfiles │ ├── systemd-tty-ask-password-agent │ ├── tailf │ ├── tar │ ├── tempfile │ ├── touch │ ├── true │ ├── udevadm │ ├── ulockmgr_server │ ├── umount │ ├── uname │ ├── uncompress │ ├── unicode_start │ ├── vdir │ ├── wdctl │ ├── which │ ├── whiptail │ ├── ypdomainname -> hostname │ ├── zcat │ ├── zcmp │ ├── zdiff │ ├── zegrep │ ├── zfgrep │ ├── zforce │ ├── zgrep │ ├── zless │ ├── zmore │ └── znew ├── boot │ └── grub │ ├── default │ ├── grub.cfg │ ├── menu.lst │ ├── menu.lst~ │ ├── menu.lst_backup_by_grub2_prerm │ └── unicode.pf2 ├── dev │ ├── core -> /proc/kcore │ ├── hugepages │ ├── lxd │ ├── mqueue │ ├── net │ ├── null │ ├── pts │ ├── shm │ ├── stderr -> /proc/self/fd/2 │ ├── stdout -> /proc/self/fd/1 │ ├── tty │ └── urandom ├── etc ├── home ├── lib ├── lib64 ├── media ├── mnt ├── opt ├── proc ├── root ├── run ├── sbin ├── srv ├── sys ├── tmp ├── usr └── var 27 directories, 184 files ``` It seems that the content from the build host's root directory is somehow copied to $SNAPCRAFT_PART_INSTALL, which seems to conflict with the description of `organize` stanza: Note that the path is relative (even though it is "usr/local") because it refers to content underneath parts/<part-name>/install which is going to be mapped into the stage and prime areas. I suspect that this behavior is either a bug in snapcraft or my misunderstanding of `organize`, any ideas?

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 30
Quick Win: 13.5
Staleness: 92
Complexity: 55
Confidence: 55
Support Request: 20
needs triage Bug report (8+ years old, 0 comments, no labels) that `organize: /: patches/` copies the build host's root directory contents into the part install dir instead of just the patch file. Organize logic since rewritten in craft-parts; never triaged by a maintainer.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 60
Confidence: 85
Support Request: 10
close stale Snapcraft organize directive incorrectly copies host root directory contents into part install directory. Unassessed, 8 years old, zero activity.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 40
Confidence: 85
Support Request: 10
close stale Snapcraft organize stanza unexpectedly copies host root directory contents into the part install directory. Unlabeled, zero comments, inactive for over 8 years.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 45
Confidence: 85
Support Request: 10
close stale organize stanza with /: pattern unexpectedly copies host root directory contents into the part install directory. Issue is 8 years old with no maintainer response, labels, or activity.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 45
Confidence: 80
Support Request: 10
needs triage Unlabeled bug report from ~8 years ago describing unexpected host root directory copying when using organize: /: another-dir/ in Snapcraft. No maintainer response or comments.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.