Skip to content

Commit 1fcd532

Browse files
committed
tools: share CI and benchmark build configuration
Benchmark builds kept Temporal enabled on macOS after the Nix default changed, while shared-library CI disabled it. This forced benchmarks to rebuild V8 instead of reusing the cached derivation. Define the common build defaults in a Nix shell used by CI, benchmark builds, and the V8 cache job to keep their configurations aligned. Signed-off-by: Filip Skokan <panva.ip@gmail.com> Assisted-by: Codex
1 parent 5137638 commit 1fcd532

4 files changed

Lines changed: 36 additions & 28 deletions

File tree

‎.github/workflows/benchmark.yml‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,11 @@ jobs:
121121
--pure --keep TAR_DIR --keep FLAKY_TESTS \
122122
--keep SCCACHE_GHA_ENABLED --keep SCCACHE_GHA_RW_MODE \
123123
--keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \
124-
--arg useSeparateDerivationForV8 true \
125124
--arg withPerfetto ${{ matrix.perfetto || false }} \
126-
--arg loadJSBuiltinsDynamically false \
127125
--arg ccache '(import <nixpkgs> {}).sccache' \
128-
--arg devTools '[]' \
129-
--arg benchmarkTools '[]' \
130126
--run '
131127
make build-ci -j4 V=1 && sccache --stop-server
132-
'
128+
' tools/nix/ci-shell.nix
133129
mv out/Release/node base_node
134130
135131
- name: Checkout the merge commit
@@ -141,15 +137,11 @@ jobs:
141137
nix-shell \
142138
-I nixpkgs=./tools/nix/pkgs.nix \
143139
--pure --keep SCCACHE_LOCAL_RW_MODE \
144-
--arg useSeparateDerivationForV8 true \
145140
--arg withPerfetto ${{ matrix.perfetto || false }} \
146-
--arg loadJSBuiltinsDynamically false \
147141
--arg ccache '(import <nixpkgs> {}).sccache' \
148-
--arg devTools '[]' \
149-
--arg benchmarkTools '[]' \
150142
--run '
151143
make build-ci -j4 V=1
152-
'
144+
' tools/nix/ci-shell.nix
153145
env:
154146
SCCACHE_LOCAL_RW_MODE: READ_ONLY
155147

‎.github/workflows/build-shared.yml‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ on:
1717
required: false
1818
type: boolean
1919
default: false
20+
with-perfetto:
21+
description: Whether to enable Perfetto
22+
required: false
23+
type: boolean
24+
default: false
2025
v8-nar:
2126
description: An optional name for the NAR archive for V8 that needs to be downloaded
2227
required: false
@@ -85,12 +90,10 @@ jobs:
8590
-I "nixpkgs=$TAR_DIR/tools/nix/pkgs.nix" \
8691
--pure --keep TAR_DIR --keep FLAKY_TESTS \
8792
--keep SCCACHE_GHA_ENABLED --keep ACTIONS_CACHE_SERVICE_V2 --keep ACTIONS_RESULTS_URL --keep ACTIONS_RUNTIME_TOKEN \
88-
--arg loadJSBuiltinsDynamically false \
93+
--arg withPerfetto ${{ inputs.with-perfetto }} \
8994
--arg ccache "${NIX_SCCACHE:-null}" \
90-
--arg devTools '[]' \
91-
--arg benchmarkTools '[]' \
9295
--arg pkcs11 ${{ inputs.pkcs11-store-test }} \
9396
${{ inputs.extra-nix-flags }} \
9497
--run '
9598
make -C "$TAR_DIR" run-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9 --skip-tests=$CI_SKIP_TESTS"
96-
' "$TAR_DIR/shell.nix"
99+
' "$TAR_DIR/tools/nix/ci-shell.nix"

‎.github/workflows/test-shared.yml‎

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -165,19 +165,7 @@ jobs:
165165
with:
166166
runner: ${{ matrix.runner }}
167167
with-sccache: ${{ github.base_ref == 'main' || github.ref_name == 'main' }}
168-
extra-nix-flags: |
169-
--arg useSeparateDerivationForV8 true \
170-
${{ matrix.perfetto && '--arg withPerfetto true \' || '\' }}
171-
${{ endsWith(matrix.system, '-darwin') && '\
172-
--arg withAmaro false \
173-
--arg withFFI false \
174-
--arg withLief false \
175-
--arg withSQLite false \
176-
--arg withTemporal false \
177-
--arg extraConfigFlags ''[
178-
"--without-inspector"
179-
"--without-node-options"
180-
]'' \' || '\' }}
168+
with-perfetto: ${{ matrix.perfetto || false }}
181169
secrets:
182170
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
183171

@@ -209,7 +197,7 @@ jobs:
209197
id: v8-drv
210198
run: |
211199
V8_DRV=$(
212-
nix-instantiate -E "builtins.filter (p: p.pname == ''v8'') (import $TAR_DIR/shell.nix { useSeparateDerivationForV8=true; }).buildInputs"
200+
nix-instantiate -E "builtins.filter (p: p.pname == ''v8'') (import $TAR_DIR/tools/nix/ci-shell.nix {}).buildInputs"
213201
)
214202
V8_STORE_PATH=$(nix-store -q --outputs "$V8_DRV")
215203
echo "V8_DRV=$V8_DRV" >> "$GITHUB_OUTPUT"

‎tools/nix/ci-shell.nix‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
args@{
2+
pkgs ? import ./pkgs.nix { },
3+
...
4+
}:
5+
import ../../shell.nix (
6+
{
7+
inherit pkgs;
8+
useSeparateDerivationForV8 = true;
9+
loadJSBuiltinsDynamically = false;
10+
devTools = [ ];
11+
benchmarkTools = [ ];
12+
}
13+
// pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isDarwin {
14+
withAmaro = false;
15+
withFFI = false;
16+
withLief = false;
17+
withSQLite = false;
18+
withTemporal = false;
19+
extraConfigFlags = [
20+
"--without-inspector"
21+
"--without-node-options"
22+
];
23+
}
24+
// args
25+
)

0 commit comments

Comments
 (0)