diff --git a/tools/nix/v8.nix b/tools/nix/v8.nix index 73356f067c3a63..fa931092a83f08 100644 --- a/tools/nix/v8.nix +++ b/tools/nix/v8.nix @@ -33,13 +33,8 @@ let ../../deps/v8 ../../node.gyp ../../node.gypi - ../../src/node_version.h - ../../tools/configure.d/nodedownload.py - ../../tools/getmoduleversion.py - ../../tools/getnapibuildversion.py ../../tools/gyp/pylib ../../tools/gyp_node.py - ../../tools/utils.py ../../tools/v8_gypfiles/abseil.gyp ../../tools/v8_gypfiles/features.gypi ../../tools/v8_gypfiles/ForEachFormat.py @@ -103,6 +98,30 @@ stdenv.mkDerivation (finalAttrs: { patches+=("$filtered") fi done + '' + # We also need to mock some Python util files that are not used to configure Python. + # Mocking lets us avoid rebuilding the whole derivation if there's a unrelated + # change in one of those files. + + '' + mkdir -p tools/configure.d + cat -> tools/configure.d/nodedownload.py <<'EOF' + def parse(opt): + return {} + def help(): + return "" + EOF + cat -> tools/getmoduleversion.py <<'EOF' + def get_version(): + return "99" + EOF + cat -> tools/getnapibuildversion.py <<'EOF' + def get_napi_version(): + return "9" + EOF + cat -> tools/utils.py <<'EOF' + def SearchFiles(dir, ext): + return [] + EOF ''; # We need to remove the node_inspector.gypi ref so GYP does not search for it. postPatch = ''