Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
strict-dep-builds=false
# Use hardlinks when populating node_modules instead of clone/copyfile.
# pnpm's default "auto" mode ends up using copy_file_range which fails on
# ZFS (https://github.com/pnpm/pnpm/issues/7024) and breaks `docker
# compose build` on hosts with a ZFS root (#7342). Hardlinks are fast,
# save disk, and work on every filesystem Etherpad supports.
package-import-method=hardlink
Comment on lines +2 to +7
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Zfs pnpm hardlink untested 📘 Rule violation ☼ Reliability

This PR changes pnpm behavior to fix ZFS-related Docker build failures but does not add/update any
regression test that would fail if the .npmrc setting were reverted. Without a test, the
mitigation can silently regress and reintroduce the ZFS EAGAIN install failure.
Agent Prompt
## Issue description
A bug fix (pnpm ZFS mitigation via `.npmrc`) was added without a regression test, so reverting/removing the setting would not be caught by automated tests.

## Issue Context
The change introduces `package-import-method=hardlink` to prevent pnpm `EAGAIN` failures on ZFS during Docker builds.

## Fix Focus Areas
- .npmrc[2-7]
- src/tests/backend-new/specs/pnpm_import_method.test.ts[1-200]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +2 to +7
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

2. Docker ignores new pnpm config 🐞 Bug ≡ Correctness

The new package-import-method=hardlink setting is not applied to pnpm commands run by
bin/installDeps.sh/bin/installLocalPlugins.sh during Docker builds because .npmrc is never
copied into the relevant Docker build stages. This can leave Docker builds on ZFS still using pnpm’s
default import method and failing despite this PR.
Agent Prompt
### Issue description
The PR relies on a repo-level `.npmrc` to force `package-import-method=hardlink`, but the Docker build stages that execute `bin/installDeps.sh` and `bin/installLocalPlugins.sh` do not include `.npmrc`. As a result, pnpm in those stages will not pick up the new config and can still fail on ZFS.

### Issue Context
- `.npmrc` is present in the repo and will be present in stages that `COPY . .`, but the main `build` stage uses selective `COPY` instructions and omits `.npmrc`.
- The Dockerfile later runs scripts that invoke pnpm; those invocations need the same config to fully address #7342.

### Fix Focus Areas
- Dockerfile[121-127]
- Dockerfile[154-161]
- Dockerfile[174-191]

### Suggested change
In the Dockerfile `build` stage, add `.npmrc` to the files copied into the image (e.g., alongside `pnpm-workspace.yaml` and `package.json`) before any `RUN ...install...` steps that execute pnpm. This ensures `package-import-method=hardlink` applies consistently to all pnpm invocations during the Docker build.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Loading