← Back to issue list

Dump plugin: Don't remove install directory.

View original Github issue

Metadata

Project
snapcraft
Number
#729
Type
pull request
State
merged
Author
kyrofa
Labels
—
Created
Updated
Closed

Current evaluation

Merged as commit 26ae9a507: Dump plugin no longer removes the install dir, enabling stage-packages by porting the Copy plugin's _linktree() logic into a new link_or_copy_tree() in file_utils.py, fixing LP #1611827.

Resolution: closed resolved

Reason: The PR itself was merged into snapcraft as commit 26ae9a507 ("Dump plugin: Don't remove install directory. (#729)"). Following sergiusens' review, the link-or-copy helper was extracted into a new file_utils.py as link_or_copy_tree(); it also fixes LP bug #1611827 where dump parts with stage-packages failed due to install-dir removal and shutil.copytree's inability to merge directories.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Removing the install directory prevents the usage of stage-packages. It was done because `shutil.copytree` simply can't deal with merging two directories, but the Dump plugin needs to be able to deal with that situation. This PR fixes LP: [#1611827](https://bugs.launchpad.net/snapcraft/+bug/1611827) by taking a lightly modified version of the `_linktree()` logic from the Copy plugin and putting it into the Dump plugin. This has the added benefit of not copying broken symlinks into the snap as well.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged as commit 26ae9a507: Dump plugin no longer removes the install dir, enabling stage-packages by porting the Copy plugin's _linktree() logic into a new link_or_copy_tree() in file_utils.py, fixing LP #1611827.
stealth/space-bunny-alpha — closed resolved Merged PR #729 (commit 26ae9a507): Dump plugin now preserves the install directory, enabling stage-packages and directory merges while avoiding broken symlink copies.
qwen/qwen3.6-35b-a3b — — Merged after approval. Fixed a bug where removing the install directory broke stage-packages by adapting _linktree() to handle directory merging and skip broken symlinks. Moved file operations to a new file_utils module per reviewer feedback.
qwen3.6-35b-a3b-mtp-q6 — — Merged. The Dump plugin no longer removes the install directory, resolving stage-packages compatibility and preventing broken symlink copies. Logic was adapted from the Copy plugin and refactored into a new file_utils module after review.

Update history

No update history recorded yet.

Related work

  • Duplicate Of: snapcraft (launchpad)#1611827 (confidence 45%)

    Launchpad bug snapcraft/+bug/1611827 ('dump plugin with stage-packages fails') is the upstream bug explicitly fixed by this PR, not a GitHub issue in this repo.

Related issues

Issue Project State Summary Similarity
#1611827 dump plugin with stage-packages fails snapcraft (launchpad) closed Resolved by merged snapcore/snapcraft PR #729, commit 26ae9a507: the dump plugin no longer removes the install directory, fixing stage-packages builds.
74%
#32 plugins: add the dump plugin craft-parts merged Merged #32, adding a dump plugin that copies part-source content into the install directory via commit 01674687 (merge 4b002854).
74%