diff --git a/.github/workflows/test-shared.yml b/.github/workflows/test-shared.yml index 8292ac253fd2..bcf70cd6a92a 100644 --- a/.github/workflows/test-shared.yml +++ b/.github/workflows/test-shared.yml @@ -199,7 +199,7 @@ jobs: id: v8-drv run: | V8_DRV=$( - nix-instantiate -E "builtins.filter (p: p.pname == ''v8'') (import $TAR_DIR/tools/nix/ci-shell.nix {}).buildInputs" + nix-instantiate -E "(import $TAR_DIR/tools/nix/ci-shell.nix {}).v8Derivation" ) V8_STORE_PATH=$(nix-store -q --outputs "$V8_DRV") echo "V8_DRV=$V8_DRV" >> "$GITHUB_OUTPUT" diff --git a/shell.nix b/shell.nix index a1d917bf864a..cb5f0a8f102b 100644 --- a/shell.nix +++ b/shell.nix @@ -88,6 +88,20 @@ let ] ++ builtins.map (depName: "--shared-${depName}") sharedV8Deps ++ pkgs.lib.optional withPerfetto "--with-perfetto"; + + v8Derivation = + if useSeparateDerivationForV8 == true then + let + sharedLibsToMock = pkgs.callPackage ./tools/nix/non-v8-deps-mock.nix { }; + in + pkgs.callPackage ./tools/nix/v8.nix { + inherit nativeBuildInputs icu; + + configureFlags = configureFlags ++ sharedLibsToMock.configureFlags ++ [ "--ninja" ]; + buildInputs = buildInputs ++ [ sharedLibsToMock ]; + } + else + useSeparateDerivationForV8; in pkgs.mkShell { inherit nativeBuildInputs; @@ -98,20 +112,7 @@ pkgs.mkShell { buildInputs = builtins.attrValues sharedLibDeps ++ buildInputs - ++ pkgs.lib.optional (useSeparateDerivationForV8 != false) ( - if useSeparateDerivationForV8 == true then - let - sharedLibsToMock = pkgs.callPackage ./tools/nix/non-v8-deps-mock.nix { }; - in - pkgs.callPackage ./tools/nix/v8.nix { - inherit nativeBuildInputs icu; - - configureFlags = configureFlags ++ sharedLibsToMock.configureFlags ++ [ "--ninja" ]; - buildInputs = buildInputs ++ [ sharedLibsToMock ]; - } - else - useSeparateDerivationForV8 - ); + ++ pkgs.lib.optional (useSeparateDerivationForV8 != false) v8Derivation; packages = devTools ++ benchmarkTools ++ pkgs.lib.optional (ccache != null) ccache; @@ -120,6 +121,10 @@ pkgs.mkShell { export CXX="${pkgs.lib.getExe ccache} $CXX" ''; + passthru = { + inherit v8Derivation; + }; + env = { BUILD_WITH = if (ninja != null) then "ninja" else "make"; NINJA = pkgs.lib.optionalString (ninja != null) "${pkgs.lib.getExe ninja}"; diff --git a/tools/nix/list-requisites.sh b/tools/nix/list-requisites.sh index a66a89eb7def..6d470d1de28d 100755 --- a/tools/nix/list-requisites.sh +++ b/tools/nix/list-requisites.sh @@ -59,4 +59,7 @@ REFS=$(nix-store --query --references "$DRV") STORE_PATHS=$(echo "$REFS" | xargs nix-store --realise) REQUISITES=$(echo "$STORE_PATHS" | xargs nix-store --query --requisites) -echo "$REQUISITES" | sort -k1.45 | uniq +V8_DRV=$(nix-instantiate -E "(import $BASE_DIR/tools/nix/ci-shell.nix {}).v8Derivation") +V8_STORE_PATH=$(nix-store -q --outputs "$V8_DRV") + +printf '%s\n%s\n' "$REQUISITES" "$V8_STORE_PATH" | sort -k1.45 | uniq