← 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
2025-01-31 13:31:44+00:00
Updated
2025-03-11 14:28:21+00:00
Closed

Current evaluation

No evaluation has been recorded for this issue yet.

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

No evaluation history available.