← Back to issue list

fix(organize): use the part's install directories

View original Github issue

Metadata

Project
craft-parts
Number
#689
Type
pull request
State
merged
Author
mr-cal
Labels
—
Created
Updated
Closed

Current evaluation

Merged craft-parts#689: organize_files now receives each part's install directories instead of recreating relative paths, ensuring organization uses base_dir rather than cwd.

Resolution: closed resolved

Reason: PR craft-parts#689 was approved by two reviewers, had no unresolved comments, and merged the fix. It prevents organize_files from incorrectly deriving part install directories relative to the working directory.

Evaluated by: mr-cal-bot

No scores available.

Issue body

- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? ----- Fixes an issue discovered via https://github.com/canonical/snapcraft/pull/4654 where `organize_files()` would organize in the `cwd` instead of the project's `base_dir`. The problem was that `organize_files()` was redefining a part's install directories incorrectly by creating relative filepaths. To fix this, `organize_files` now accepts the part's install directories instead of redefining them.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged craft-parts#689: organize_files now receives each part's install directories instead of recreating relative paths, ensuring organization uses base_dir rather than cwd.
stealth/space-bunny-alpha — closed resolved Merged in canonical/craft-parts#689 as commit c349e740, and forward-ported to 2.x by #690 (0eff7cc9), fixing organize_files() to use each part's install directories instead of cwd-relative paths.
qwen/qwen3.6-35b-a3b — — Merged fix for organize_files() which incorrectly used relative paths, organizing files in cwd instead of base_dir. The function now accepts the part's install directories directly. Approved by two reviewers and passed CI.
qwen3.6-35b-a3b-mtp-q6 — — Merged fix for organize_files() which incorrectly organized files in the current working directory. The function now accepts the part's install directories directly, resolving the relative path bug.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/snapcraft#4654 (confidence 99%)

    The problem was discovered while reviewing this Snapcraft PR, where organize_files used cwd instead of the project's base_dir.

Related issues

Issue Project State Summary Similarity
#690 fix(organize): use the part's install directories (#689) craft-parts merged Merged PR #690 in commit 0eff7cc9 (change c349e740), fixing organize_files() to use part install directories and organize under base_dir.
88%
#1775582 `organize:{ /: another-dir/ }` causes the items under host root directory to be copied in another-dir snapcraft (launchpad) closed organize: { /: ... } incorrectly copied host root directory contents into the part install directory. Fixed in craft-parts via PR #1562.
72%
#1487 Multiple parts cannot organize to the same directory in the overlay craft-parts closed Fixed by merged PR canonical/craft-parts#1586 (commit 0797420f), allowing wildcard-organized overlay directories from multiple parts to merge despite metadata differences.
71%
#1525 Directory traversal issue when organizing a part craft-parts closed Fixed by merged PR #1562 (commit 32b95b4f), rejecting organize sources that escape the install directory via absolute paths or traversal.
70%