fetchPnpmDeps: don't fail on empty lockfile (#513736)

This commit is contained in:
Sefa Eyeoglu
2026-04-26 18:42:48 +00:00
committed by GitHub
7 changed files with 56 additions and 3 deletions
@@ -162,9 +162,9 @@ in
# See https://github.com/NixOS/nixpkgs/pull/350063
# See https://github.com/NixOS/nixpkgs/issues/422889
if [[ ${toString fetcherVersion} -ge 2 ]]; then
find $storePath -type f -name "*-exec" -print0 | xargs -0 chmod 555
find $storePath -type f -not -name "*-exec" -print0 | xargs -0 chmod 444
find $storePath -type d -print0 | xargs -0 chmod 555
find $storePath -type f -name "*-exec" -print0 | xargs --no-run-if-empty -0 chmod 555
find $storePath -type f -not -name "*-exec" -print0 | xargs --no-run-if-empty -0 chmod 444
find $storePath -type d -print0 | xargs --no-run-if-empty -0 chmod 555
fi
if [[ ${toString fetcherVersion} -ge 3 ]]; then
+2
View File
@@ -170,6 +170,8 @@ in
php = recurseIntoAttrs (callPackages ./php { });
pnpm = recurseIntoAttrs (callPackages ./pnpm { });
go = recurseIntoAttrs (callPackage ../build-support/go/tests.nix { });
lake = callPackage ../build-support/lake/test { };
+4
View File
@@ -0,0 +1,4 @@
{ callPackage }:
{
pnpm-empty-lockfile = callPackage ./pnpm-empty-lockfile { };
}
@@ -0,0 +1,32 @@
{
pkgs,
stdenv,
fetchPnpmDeps,
nodejs,
pnpm_10,
pnpmConfigHook,
}:
stdenv.mkDerivation {
name = "pnpm-empty-lockfile";
src = ./.;
nativeBuildInputs = [
pnpm_10
pnpmConfigHook
];
pnpmDeps = fetchPnpmDeps {
pname = "pnpm-empty-lockfile";
fetcherVersion = 3;
pnpm = pnpm_10;
src = ./.;
hash = "sha256-u0GOAX5B1f2ANWbOezScp/eKQRRZA/JoYfQ5zLrNip4=";
};
buildPhase = ''
runHook preBuild
touch $out
runHook postBuild
'';
}
@@ -0,0 +1,6 @@
{
"name": "pnpm-empty-lockfile",
"main": "main.mjs",
"dependencies": {
}
}
+9
View File
@@ -0,0 +1,9 @@
lockfileVersion: '9.0'
settings:
autoInstallPeers: true
excludeLinksFromLockfile: false
importers:
.: {}