Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/test-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
33 changes: 19 additions & 14 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand All @@ -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}";
Expand Down
5 changes: 4 additions & 1 deletion tools/nix/list-requisites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading