← Back to issue list

npm plugin fails in the presence of `base-files`

View original Github issue

Metadata

Project
craft-parts
Number
#1001
Type
issue
State
open
Author
tigarmo
Labels
—
Created
Updated
Closed
—

Current evaluation

Cross-part staging rejects directory-vs-symlink collisions such as npm's bin/lib and base-files' usrmerge links; the valid repro remains unresolved and affects more than the npm plugin.

Suggested action: keep open

Reason: @bepri supplied a nil-plugin-only reproducer for the same bin conflict, showing the report is not npm-specific, and @cmatsuoka explicitly noted that #1004 was not merged and asked whether the problem still occurs. Current paths_collide() logic still treats any symlink-versus-non-symlink pair as conflicting, so there is no evidence of resolution, although defining safe coexistence semantics requires nontrivial design work.

Evaluated by: mr-cal-bot

Impact: 57 Quick Win: 14 Complexity: 67 Confidence: 88 Actionability: 76

Issue body

### Bug Description See https://github.com/canonical/rockcraft/issues/790 . The issue seems to be that the `lib/` directory created by the npm plugin conflicts with the `lib` symlink to `usr/lib` created by base-files (same for `bin/` and `usr/bin`). ### To Reproduce Create a package.json file with these contents: ``` { "name": "app", "version": "0.0.0", "private": true, "scripts": { "start": "node ./bin/www" }, "dependencies": { "cookie-parser": "~1.4.4", "debug": "~2.6.9", "express": "~4.16.1", "http-errors": "~1.6.3", "jade": "~1.11.0", "morgan": "~1.9.1" } } ``` Create the described rockcraft.yaml, and run `rockcraft pack`. It should give the following output: ``` Failed to stage: parts list the same file with different contents or permissions. Detailed information: Parts 'npm-part' and 'base-files-part' list the following files, but with different contents or permissions: bin lib Failed to execute rockcraft in instance. ``` ### part yaml ```shell name: demo title: demo version: '0.1' summary: summary description: lib dir issue demo base: bare build-base: ubuntu@24.04 platforms: amd64: parts: npm-part: plugin: npm npm-include-node: true npm-node-version: node source: . base-files-part: plugin: nil stage-packages: - base-files ``` ### Relevant log output ```shell 2025-01-31 10:30:03.451 :: 2025-01-31 10:30:03.122 craft_parts.errors.PartFilesConflict: Failed to stage: parts list the same file with different contents or permissions. 2025-01-31 10:30:03.451 :: 2025-01-31 10:30:03.122 Parts 'npm-part' and 'base-files-part' list the following files, but with different contents or permissions: 2025-01-31 10:30:03.451 :: 2025-01-31 10:30:03.122 bin 2025-01-31 10:30:03.451 :: 2025-01-31 10:30:03.122 lib ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 57
Quick Win: 14
Complexity: 67
Confidence: 88
Actionability: 76
keep open Cross-part staging rejects directory-vs-symlink collisions such as npm's bin/lib and base-files' usrmerge links; the valid repro remains unresolved and affects more than the npm plugin.
qwen/qwen3.6-35b-a3b
Impact: 60
Quick Win: 14
Complexity: 70
Confidence: 70
Actionability: 80
keep open npm plugin creates bin/lib directories that conflict with base-files symlinks, causing staging failures. Unresolved since Jan 2025; PR #1004 attempt was abandoned.
qwen/qwen3.8-27b
Impact: 55
Quick Win: 14
Staleness: 25
Complexity: 75
Confidence: 75
Support Request: 5
keep open npm plugin (and any part creating bin/lib dirs) conflicts with base-files' bin/lib symlinks at staging, breaking rockcraft pack. Triaged (internal ticket); prototype fix #1004 unmerged; maintainer re-asked reporter 10 days ago if still reproducible, awaiting reply.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 40
Confidence: 85
Support Request: 5
keep open Staging conflict between npm plugin and base-files due to bin/lib directory clashes. Validated as a real bug with a linked Jira ticket, currently awaiting maintainer status update on a previous fix attempt.
qwen/qwen3.6-35b-a3b
Staleness: 90
Complexity: 60
Confidence: 90
Support Request: 10
needs triage Bug where npm and nil plugins conflict with base-files during staging due to overlapping bin and lib directories. Unlabeled, inactive for over a year, awaiting maintainer triage.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 60
Confidence: 80
Support Request: 5
needs triage Staging conflict between npm/nil plugin directories and base-files symlinks. Reported over a year ago with clear reproduction steps, but lacks maintainer labels, assignment, or response.

Update history

Date Change
updated
updated

Related work

  • Related To: canonical/craft-parts#1004 (confidence 98%)

    An npm-specific symlink prototype was closed unmerged and is the solution attempt cited by the maintainer.

  • Related To: canonical/rockcraft#790 (confidence 95%)

    Original Rockcraft report explicitly referenced by this issue.

Related issues

No related issues found above the similarity threshold.