Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pnpm.fetchDeps: ensure consistent hashes by setting file permissions after fetching #350063

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
12 changes: 12 additions & 0 deletions pkgs/development/tools/pnpm/fetch-deps/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,18 @@
jq --sort-keys "del(.. | .checkedAt?)" $f | sponge $f
done

# NOTE: For reasons not yet known, pnpm might create files with
# inconsistent permissions, for example inside the ubuntu-24.04
# github actions runner.
# To ensure stable derivations, we need to set permissions
# consistently, namely:
# * All files with `-exec` suffix have 555.
# * All other files have 444.
# * All folders have 555.
find $out -type f -name "*-exec" -print0 | xargs -0 chmod 555
find $out -type f -not -name "*-exec" -print0 | xargs -0 chmod 444
find $out -type d -print0 | xargs -0 chmod 555

runHook postFixup
'';

Expand Down