From f4423979dea598216dc0270aa9421196bb2ffe70 Mon Sep 17 00:00:00 2001 From: Xandor Schiefer Date: Tue, 18 Jun 2024 22:23:00 +0200 Subject: [PATCH] vscode-js-debug: fix missing jq in postPatch Fixes #320507. The `npmConfigHook` used by `buildNpmPackage` does not correctly propagate the `nativeBuildInputs` into its `PATH`, which is why `jq` was not available during the patch phase. Since this `npmConfigHook` is run as part of a fixed-output derivation (`fetchNpmDeps`), if it had already been realised, unless its hash had changed, a missing `jq` would not be noticed, on a rebuild of `vscode-js-debug`. The `postPatch` hook is *also* run during `buildNpmPackage`, but there the `nativeBuildInputs` were correctly added to the `PATH`, which is why a rebuild of `vscode-js-debug` with the previous `postPatch` would succeed (if its `npmDeps`'s hash hadn't changed). --- pkgs/by-name/vs/vscode-js-debug/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/vs/vscode-js-debug/package.nix b/pkgs/by-name/vs/vscode-js-debug/package.nix index 613350da9b8d..542b5cbfc811 100644 --- a/pkgs/by-name/vs/vscode-js-debug/package.nix +++ b/pkgs/by-name/vs/vscode-js-debug/package.nix @@ -1,7 +1,7 @@ { lib , buildNpmPackage , fetchFromGitHub -, jq +, buildPackages , libsecret , pkg-config , nodePackages @@ -23,12 +23,12 @@ buildNpmPackage rec { npmDepsHash = "sha256-DfeaiqKadTnGzOObK01ctlavwqTMa0tqn59sLZMPvUM="; - nativeBuildInputs = [ pkg-config nodePackages.node-gyp jq ]; + nativeBuildInputs = [ pkg-config nodePackages.node-gyp ]; buildInputs = [ libsecret ]; postPatch = '' - jq ' + ${lib.getExe buildPackages.jq} ' .scripts.postinstall |= empty | # tries to install playwright, not necessary for build .scripts.build |= "gulp dapDebugServer" | # there is no build script defined .bin |= "./dist/src/dapDebugServer.js" # there is no bin output defined