Commit 78175c6

Browse files
committed
tools: improve nix-changes coverage
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #65403 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
1 parent 6f0c08b commit 78175c6

7 files changed

Lines changed: 81 additions & 30 deletions

File tree

β€Ž.github/workflows/build-tarball.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- vcbuild.bat
2829
- .**
@@ -52,6 +53,7 @@ on:
5253
- tools/eslint-rules/**
5354
- tools/eslint/**
5455
- tools/lint-md/**
56+
- tools/nix/**
5557
- typings/**
5658
- vcbuild.bat
5759
- .**

β€Ž.github/workflows/coverage-windows.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- .**
2829
- '!.github/workflows/coverage-windows.yml'
@@ -49,6 +50,7 @@ on:
4950
- tools/eslint-rules/**
5051
- tools/eslint/**
5152
- tools/lint-md/**
53+
- tools/nix/**
5254
- typings/**
5355
- .**
5456
- '!.github/workflows/coverage-windows.yml'

β€Ž.github/workflows/nix-changes.ymlβ€Ž

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ on:
1111
- v[0-9]+.x
1212
paths:
1313
- '**.nix'
14+
- tools/nix/**
1415
- .github/workflows/nix-changes.yml
1516
pull_request:
1617
paths:
1718
- '**.nix'
19+
- tools/nix/**
1820
- .github/workflows/nix-changes.yml
1921
types: [opened, synchronize, reopened, ready_for_review]
2022

@@ -47,7 +49,9 @@ jobs:
4749
with:
4850
fetch-depth: 2
4951
persist-credentials: false
50-
sparse-checkout: '*.nix'
52+
sparse-checkout: |
53+
shell.nix
54+
tools/nix/
5155
sparse-checkout-cone-mode: false
5256

5357
- uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
@@ -60,39 +64,14 @@ jobs:
6064
name: nodejs
6165

6266
- name: Compute requisites after change
63-
shell: bash # See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference, we want the pipefail option.
64-
run: |
65-
nix-store --query --references "$(
66-
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
67-
--arg devTools "
68-
(import ./tools/nix/devTools.nix {})
69-
++ builtins.attrValues (
70-
{ inherit (import <nixpkgs> {}) nixfmt-tree sccache; }
71-
// import ./tools/nix/openssl-matrix.nix {}
72-
// import ./tools/nix/pkcs11.nix {}
73-
)")" \
74-
| xargs nix-store --realise \
75-
| xargs nix-store --query --requisites \
76-
| sort -k1.45 \
77-
> requisites-${{ matrix.system }}-after.list
67+
run: ./tools/nix/list-requisites.sh > requisites-${{ matrix.system }}-after.list
7868

7969
- name: Compute requisites before change
80-
shell: bash # See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference, we want the pipefail option.
8170
run: |
8271
git reset HEAD^ --hard
83-
nix-store --query --references "$(
84-
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
85-
--arg devTools "
86-
(import ./tools/nix/devTools.nix {})
87-
++ builtins.attrValues (
88-
{ inherit (import <nixpkgs> {}) nixfmt-tree sccache; }
89-
// import ./tools/nix/openssl-matrix.nix {}
90-
// import ./tools/nix/pkcs11.nix {}
91-
)")" \
92-
| xargs nix-store --realise \
93-
| xargs nix-store --query --requisites \
94-
| sort -k1.45 \
95-
> requisites-${{ matrix.system }}-before.list
72+
# TODO(aduh95): remove this once list-requisites.sh has reached `main`
73+
[ -f tools/nix/list-requisites.sh ] || git checkout FETCH_HEAD -- tools/nix/list-requisites.sh
74+
./tools/nix/list-requisites.sh > requisites-${{ matrix.system }}-before.list
9675
9776
- name: Output diff
9877
run: |

β€Ž.github/workflows/test-linux.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- tools/actions/**
1010
- tools/clang-format/**
1111
- tools/dep_updaters/**
12+
- tools/nix/**
1213
- test/internet/**
1314
- '**.nix'
1415
- .github/**
@@ -27,6 +28,7 @@ on:
2728
- tools/actions/**
2829
- tools/clang-format/**
2930
- tools/dep_updaters/**
31+
- tools/nix/**
3032
- test/internet/**
3133
- '**.nix'
3234
- .github/**

β€Ž.github/workflows/test-macos.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- vcbuild.bat
2829
- .**
@@ -53,6 +54,7 @@ on:
5354
- tools/eslint-rules/**
5455
- tools/eslint/**
5556
- tools/lint-md/**
57+
- tools/nix/**
5658
- typings/**
5759
- vcbuild.bat
5860
- .**

β€Ž.github/workflows/test-shared.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ on:
4444
- '!tools/nix/**'
4545
- '!tools/v8/**'
4646
- '!tools/v8_gypfiles/**'
47+
- tools/nix/list-requisites.sh
4748
- typings/**
4849
- vcbuild.bat
4950
- .**
@@ -96,6 +97,7 @@ on:
9697
- '!tools/nix/**'
9798
- '!tools/v8/**'
9899
- '!tools/v8_gypfiles/**'
100+
- tools/nix/list-requisites.sh
99101
- typings/**
100102
- vcbuild.bat
101103
- .**

β€Žtools/nix/list-requisites.shβ€Ž

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
BASE_DIR=$(cd "$(dirname "$0")/../.."&& pwd)
6+
7+
OPTIONAL_FLAGS=$(nix-instantiate -I "nixpkgs=$BASE_DIR/tools/nix/pkgs.nix" --eval --strict --raw -E "
8+
(import <nixpkgs> {}).lib.concatMapStrings
9+
(n: ''--arg \${n} true '')
10+
(builtins.filter
11+
(n: builtins.match ''with[A-Z].+'' n != null)
12+
(builtins.attrNames (builtins.functionArgs (import $BASE_DIR/shell.nix))))
13+
"
14+
)
15+
16+
DRV=$(
17+
cd"$BASE_DIR"
18+
# shellcheck disable=SC2086
19+
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
20+
$OPTIONAL_FLAGS \
21+
--arg sharedLibDeps '{
22+
# Using an empty set as some build dependencies are required only in the absence of shared deps (e.g. Cargo).
23+
# We pass the shared deps as devTools below so they are still accounted for.
24+
}' \
25+
--arg pkcs11 'import ./tools/nix/pkcs11.nix {
26+
# Passing an import call rather than "true" to workaround sharedLibDeps being empty.
27+
}' \
28+
--arg devTools '
29+
let
30+
pkgs = import <nixpkgs> { };
31+
sharedLibDepsFn = import ./tools/nix/sharedLibDeps.nix;
32+
in
33+
(import ./tools/nix/devTools.nix { })
34+
++ pkgs.lib.flatten (
35+
with (pkgs.callPackage ./tools/nix/v8.nix { });
36+
[
37+
# We do not want to build V8 here, but still want to list its requisites.
38+
buildInputs
39+
nativeBuildInputs
40+
propagatedBuildInputs
41+
propagatedNativeBuildInputs
42+
(pkgs.callPackage ./tools/nix/non-v8-deps-mock.nix { })
43+
]
44+
)
45+
++ builtins.attrValues (
46+
{
47+
# Additional packages we are using across the codebase
48+
inherit (pkgs) nixfmt-tree sccache;
49+
}
50+
// import ./tools/nix/openssl-matrix.nix { }
51+
// sharedLibDepsFn (
52+
pkgs.lib.filterAttrs (n: v: builtins.match "with[A-Z].+" n != null) (
53+
builtins.functionArgs sharedLibDepsFn
54+
)
55+
)
56+
)'
57+
)
58+
REFS=$(nix-store --query --references "$DRV")
59+
STORE_PATHS=$(echo "$REFS"| xargs nix-store --realise)
60+
REQUISITES=$(echo "$STORE_PATHS"| xargs nix-store --query --requisites)
61+
62+
echo"$REQUISITES"| sort -k1.45 | uniq

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Commit 78175c6

Browse files
committed
tools: improve nix-changes coverage
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #65403 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
1 parent 6f0c08b commit 78175c6

7 files changed

Lines changed: 81 additions & 30 deletions

File tree

β€Ž.github/workflows/build-tarball.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- vcbuild.bat
2829
- .**
@@ -52,6 +53,7 @@ on:
5253
- tools/eslint-rules/**
5354
- tools/eslint/**
5455
- tools/lint-md/**
56+
- tools/nix/**
5557
- typings/**
5658
- vcbuild.bat
5759
- .**

β€Ž.github/workflows/coverage-windows.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- .**
2829
- '!.github/workflows/coverage-windows.yml'
@@ -49,6 +50,7 @@ on:
4950
- tools/eslint-rules/**
5051
- tools/eslint/**
5152
- tools/lint-md/**
53+
- tools/nix/**
5254
- typings/**
5355
- .**
5456
- '!.github/workflows/coverage-windows.yml'

β€Ž.github/workflows/nix-changes.ymlβ€Ž

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ on:
1111
- v[0-9]+.x
1212
paths:
1313
- '**.nix'
14+
- tools/nix/**
1415
- .github/workflows/nix-changes.yml
1516
pull_request:
1617
paths:
1718
- '**.nix'
19+
- tools/nix/**
1820
- .github/workflows/nix-changes.yml
1921
types: [opened, synchronize, reopened, ready_for_review]
2022

@@ -47,7 +49,9 @@ jobs:
4749
with:
4850
fetch-depth: 2
4951
persist-credentials: false
50-
sparse-checkout: '*.nix'
52+
sparse-checkout: |
53+
shell.nix
54+
tools/nix/
5155
sparse-checkout-cone-mode: false
5256

5357
- uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
@@ -60,39 +64,14 @@ jobs:
6064
name: nodejs
6165

6266
- name: Compute requisites after change
63-
shell: bash # See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference, we want the pipefail option.
64-
run: |
65-
nix-store --query --references "$(
66-
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
67-
--arg devTools "
68-
(import ./tools/nix/devTools.nix {})
69-
++ builtins.attrValues (
70-
{ inherit (import <nixpkgs> {}) nixfmt-tree sccache; }
71-
// import ./tools/nix/openssl-matrix.nix {}
72-
// import ./tools/nix/pkcs11.nix {}
73-
)")" \
74-
| xargs nix-store --realise \
75-
| xargs nix-store --query --requisites \
76-
| sort -k1.45 \
77-
> requisites-${{ matrix.system }}-after.list
67+
run: ./tools/nix/list-requisites.sh > requisites-${{ matrix.system }}-after.list
7868

7969
- name: Compute requisites before change
80-
shell: bash # See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference, we want the pipefail option.
8170
run: |
8271
git reset HEAD^ --hard
83-
nix-store --query --references "$(
84-
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
85-
--arg devTools "
86-
(import ./tools/nix/devTools.nix {})
87-
++ builtins.attrValues (
88-
{ inherit (import <nixpkgs> {}) nixfmt-tree sccache; }
89-
// import ./tools/nix/openssl-matrix.nix {}
90-
// import ./tools/nix/pkcs11.nix {}
91-
)")" \
92-
| xargs nix-store --realise \
93-
| xargs nix-store --query --requisites \
94-
| sort -k1.45 \
95-
> requisites-${{ matrix.system }}-before.list
72+
# TODO(aduh95): remove this once list-requisites.sh has reached `main`
73+
[ -f tools/nix/list-requisites.sh ] || git checkout FETCH_HEAD -- tools/nix/list-requisites.sh
74+
./tools/nix/list-requisites.sh > requisites-${{ matrix.system }}-before.list
9675
9776
- name: Output diff
9877
run: |

β€Ž.github/workflows/test-linux.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- tools/actions/**
1010
- tools/clang-format/**
1111
- tools/dep_updaters/**
12+
- tools/nix/**
1213
- test/internet/**
1314
- '**.nix'
1415
- .github/**
@@ -27,6 +28,7 @@ on:
2728
- tools/actions/**
2829
- tools/clang-format/**
2930
- tools/dep_updaters/**
31+
- tools/nix/**
3032
- test/internet/**
3133
- '**.nix'
3234
- .github/**

β€Ž.github/workflows/test-macos.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- vcbuild.bat
2829
- .**
@@ -53,6 +54,7 @@ on:
5354
- tools/eslint-rules/**
5455
- tools/eslint/**
5556
- tools/lint-md/**
57+
- tools/nix/**
5658
- typings/**
5759
- vcbuild.bat
5860
- .**

β€Ž.github/workflows/test-shared.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ on:
4444
- '!tools/nix/**'
4545
- '!tools/v8/**'
4646
- '!tools/v8_gypfiles/**'
47+
- tools/nix/list-requisites.sh
4748
- typings/**
4849
- vcbuild.bat
4950
- .**
@@ -96,6 +97,7 @@ on:
9697
- '!tools/nix/**'
9798
- '!tools/v8/**'
9899
- '!tools/v8_gypfiles/**'
100+
- tools/nix/list-requisites.sh
99101
- typings/**
100102
- vcbuild.bat
101103
- .**

β€Žtools/nix/list-requisites.shβ€Ž

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
BASE_DIR=$(cd "$(dirname "$0")/../.."&& pwd)
6+
7+
OPTIONAL_FLAGS=$(nix-instantiate -I "nixpkgs=$BASE_DIR/tools/nix/pkgs.nix" --eval --strict --raw -E "
8+
(import <nixpkgs> {}).lib.concatMapStrings
9+
(n: ''--arg \${n} true '')
10+
(builtins.filter
11+
(n: builtins.match ''with[A-Z].+'' n != null)
12+
(builtins.attrNames (builtins.functionArgs (import $BASE_DIR/shell.nix))))
13+
"
14+
)
15+
16+
DRV=$(
17+
cd"$BASE_DIR"
18+
# shellcheck disable=SC2086
19+
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
20+
$OPTIONAL_FLAGS \
21+
--arg sharedLibDeps '{
22+
# Using an empty set as some build dependencies are required only in the absence of shared deps (e.g. Cargo).
23+
# We pass the shared deps as devTools below so they are still accounted for.
24+
}' \
25+
--arg pkcs11 'import ./tools/nix/pkcs11.nix {
26+
# Passing an import call rather than "true" to workaround sharedLibDeps being empty.
27+
}' \
28+
--arg devTools '
29+
let
30+
pkgs = import <nixpkgs> { };
31+
sharedLibDepsFn = import ./tools/nix/sharedLibDeps.nix;
32+
in
33+
(import ./tools/nix/devTools.nix { })
34+
++ pkgs.lib.flatten (
35+
with (pkgs.callPackage ./tools/nix/v8.nix { });
36+
[
37+
# We do not want to build V8 here, but still want to list its requisites.
38+
buildInputs
39+
nativeBuildInputs
40+
propagatedBuildInputs
41+
propagatedNativeBuildInputs
42+
(pkgs.callPackage ./tools/nix/non-v8-deps-mock.nix { })
43+
]
44+
)
45+
++ builtins.attrValues (
46+
{
47+
# Additional packages we are using across the codebase
48+
inherit (pkgs) nixfmt-tree sccache;
49+
}
50+
// import ./tools/nix/openssl-matrix.nix { }
51+
// sharedLibDepsFn (
52+
pkgs.lib.filterAttrs (n: v: builtins.match "with[A-Z].+" n != null) (
53+
builtins.functionArgs sharedLibDepsFn
54+
)
55+
)
56+
)'
57+
)
58+
REFS=$(nix-store --query --references "$DRV")
59+
STORE_PATHS=$(echo "$REFS"| xargs nix-store --realise)
60+
REQUISITES=$(echo "$STORE_PATHS"| xargs nix-store --query --requisites)
61+
62+
echo"$REQUISITES"| sort -k1.45 | uniq

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit 78175c6

Browse files
committed
tools: improve nix-changes coverage
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #65403 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
1 parent 6f0c08b commit 78175c6

7 files changed

Lines changed: 81 additions & 30 deletions

File tree

β€Ž.github/workflows/build-tarball.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- vcbuild.bat
2829
- .**
@@ -52,6 +53,7 @@ on:
5253
- tools/eslint-rules/**
5354
- tools/eslint/**
5455
- tools/lint-md/**
56+
- tools/nix/**
5557
- typings/**
5658
- vcbuild.bat
5759
- .**

β€Ž.github/workflows/coverage-windows.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- .**
2829
- '!.github/workflows/coverage-windows.yml'
@@ -49,6 +50,7 @@ on:
4950
- tools/eslint-rules/**
5051
- tools/eslint/**
5152
- tools/lint-md/**
53+
- tools/nix/**
5254
- typings/**
5355
- .**
5456
- '!.github/workflows/coverage-windows.yml'

β€Ž.github/workflows/nix-changes.ymlβ€Ž

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ on:
1111
- v[0-9]+.x
1212
paths:
1313
- '**.nix'
14+
- tools/nix/**
1415
- .github/workflows/nix-changes.yml
1516
pull_request:
1617
paths:
1718
- '**.nix'
19+
- tools/nix/**
1820
- .github/workflows/nix-changes.yml
1921
types: [opened, synchronize, reopened, ready_for_review]
2022

@@ -47,7 +49,9 @@ jobs:
4749
with:
4850
fetch-depth: 2
4951
persist-credentials: false
50-
sparse-checkout: '*.nix'
52+
sparse-checkout: |
53+
shell.nix
54+
tools/nix/
5155
sparse-checkout-cone-mode: false
5256

5357
- uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
@@ -60,39 +64,14 @@ jobs:
6064
name: nodejs
6165

6266
- name: Compute requisites after change
63-
shell: bash # See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference, we want the pipefail option.
64-
run: |
65-
nix-store --query --references "$(
66-
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
67-
--arg devTools "
68-
(import ./tools/nix/devTools.nix {})
69-
++ builtins.attrValues (
70-
{ inherit (import <nixpkgs> {}) nixfmt-tree sccache; }
71-
// import ./tools/nix/openssl-matrix.nix {}
72-
// import ./tools/nix/pkcs11.nix {}
73-
)")" \
74-
| xargs nix-store --realise \
75-
| xargs nix-store --query --requisites \
76-
| sort -k1.45 \
77-
> requisites-${{ matrix.system }}-after.list
67+
run: ./tools/nix/list-requisites.sh > requisites-${{ matrix.system }}-after.list
7868

7969
- name: Compute requisites before change
80-
shell: bash # See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference, we want the pipefail option.
8170
run: |
8271
git reset HEAD^ --hard
83-
nix-store --query --references "$(
84-
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
85-
--arg devTools "
86-
(import ./tools/nix/devTools.nix {})
87-
++ builtins.attrValues (
88-
{ inherit (import <nixpkgs> {}) nixfmt-tree sccache; }
89-
// import ./tools/nix/openssl-matrix.nix {}
90-
// import ./tools/nix/pkcs11.nix {}
91-
)")" \
92-
| xargs nix-store --realise \
93-
| xargs nix-store --query --requisites \
94-
| sort -k1.45 \
95-
> requisites-${{ matrix.system }}-before.list
72+
# TODO(aduh95): remove this once list-requisites.sh has reached `main`
73+
[ -f tools/nix/list-requisites.sh ] || git checkout FETCH_HEAD -- tools/nix/list-requisites.sh
74+
./tools/nix/list-requisites.sh > requisites-${{ matrix.system }}-before.list
9675
9776
- name: Output diff
9877
run: |

β€Ž.github/workflows/test-linux.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- tools/actions/**
1010
- tools/clang-format/**
1111
- tools/dep_updaters/**
12+
- tools/nix/**
1213
- test/internet/**
1314
- '**.nix'
1415
- .github/**
@@ -27,6 +28,7 @@ on:
2728
- tools/actions/**
2829
- tools/clang-format/**
2930
- tools/dep_updaters/**
31+
- tools/nix/**
3032
- test/internet/**
3133
- '**.nix'
3234
- .github/**

β€Ž.github/workflows/test-macos.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- vcbuild.bat
2829
- .**
@@ -53,6 +54,7 @@ on:
5354
- tools/eslint-rules/**
5455
- tools/eslint/**
5556
- tools/lint-md/**
57+
- tools/nix/**
5658
- typings/**
5759
- vcbuild.bat
5860
- .**

β€Ž.github/workflows/test-shared.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ on:
4444
- '!tools/nix/**'
4545
- '!tools/v8/**'
4646
- '!tools/v8_gypfiles/**'
47+
- tools/nix/list-requisites.sh
4748
- typings/**
4849
- vcbuild.bat
4950
- .**
@@ -96,6 +97,7 @@ on:
9697
- '!tools/nix/**'
9798
- '!tools/v8/**'
9899
- '!tools/v8_gypfiles/**'
100+
- tools/nix/list-requisites.sh
99101
- typings/**
100102
- vcbuild.bat
101103
- .**

β€Žtools/nix/list-requisites.shβ€Ž

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
BASE_DIR=$(cd "$(dirname "$0")/../.."&& pwd)
6+
7+
OPTIONAL_FLAGS=$(nix-instantiate -I "nixpkgs=$BASE_DIR/tools/nix/pkgs.nix" --eval --strict --raw -E "
8+
(import <nixpkgs> {}).lib.concatMapStrings
9+
(n: ''--arg \${n} true '')
10+
(builtins.filter
11+
(n: builtins.match ''with[A-Z].+'' n != null)
12+
(builtins.attrNames (builtins.functionArgs (import $BASE_DIR/shell.nix))))
13+
"
14+
)
15+
16+
DRV=$(
17+
cd"$BASE_DIR"
18+
# shellcheck disable=SC2086
19+
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
20+
$OPTIONAL_FLAGS \
21+
--arg sharedLibDeps '{
22+
# Using an empty set as some build dependencies are required only in the absence of shared deps (e.g. Cargo).
23+
# We pass the shared deps as devTools below so they are still accounted for.
24+
}' \
25+
--arg pkcs11 'import ./tools/nix/pkcs11.nix {
26+
# Passing an import call rather than "true" to workaround sharedLibDeps being empty.
27+
}' \
28+
--arg devTools '
29+
let
30+
pkgs = import <nixpkgs> { };
31+
sharedLibDepsFn = import ./tools/nix/sharedLibDeps.nix;
32+
in
33+
(import ./tools/nix/devTools.nix { })
34+
++ pkgs.lib.flatten (
35+
with (pkgs.callPackage ./tools/nix/v8.nix { });
36+
[
37+
# We do not want to build V8 here, but still want to list its requisites.
38+
buildInputs
39+
nativeBuildInputs
40+
propagatedBuildInputs
41+
propagatedNativeBuildInputs
42+
(pkgs.callPackage ./tools/nix/non-v8-deps-mock.nix { })
43+
]
44+
)
45+
++ builtins.attrValues (
46+
{
47+
# Additional packages we are using across the codebase
48+
inherit (pkgs) nixfmt-tree sccache;
49+
}
50+
// import ./tools/nix/openssl-matrix.nix { }
51+
// sharedLibDepsFn (
52+
pkgs.lib.filterAttrs (n: v: builtins.match "with[A-Z].+" n != null) (
53+
builtins.functionArgs sharedLibDepsFn
54+
)
55+
)
56+
)'
57+
)
58+
REFS=$(nix-store --query --references "$DRV")
59+
STORE_PATHS=$(echo "$REFS"| xargs nix-store --realise)
60+
REQUISITES=$(echo "$STORE_PATHS"| xargs nix-store --query --requisites)
61+
62+
echo"$REQUISITES"| sort -k1.45 | uniq

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit 78175c6

Browse files
committed
tools: improve nix-changes coverage
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #65403 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
1 parent 6f0c08b commit 78175c6

7 files changed

Lines changed: 81 additions & 30 deletions

File tree

β€Ž.github/workflows/build-tarball.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- vcbuild.bat
2829
- .**
@@ -52,6 +53,7 @@ on:
5253
- tools/eslint-rules/**
5354
- tools/eslint/**
5455
- tools/lint-md/**
56+
- tools/nix/**
5557
- typings/**
5658
- vcbuild.bat
5759
- .**

β€Ž.github/workflows/coverage-windows.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- .**
2829
- '!.github/workflows/coverage-windows.yml'
@@ -49,6 +50,7 @@ on:
4950
- tools/eslint-rules/**
5051
- tools/eslint/**
5152
- tools/lint-md/**
53+
- tools/nix/**
5254
- typings/**
5355
- .**
5456
- '!.github/workflows/coverage-windows.yml'

β€Ž.github/workflows/nix-changes.ymlβ€Ž

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ on:
1111
- v[0-9]+.x
1212
paths:
1313
- '**.nix'
14+
- tools/nix/**
1415
- .github/workflows/nix-changes.yml
1516
pull_request:
1617
paths:
1718
- '**.nix'
19+
- tools/nix/**
1820
- .github/workflows/nix-changes.yml
1921
types: [opened, synchronize, reopened, ready_for_review]
2022

@@ -47,7 +49,9 @@ jobs:
4749
with:
4850
fetch-depth: 2
4951
persist-credentials: false
50-
sparse-checkout: '*.nix'
52+
sparse-checkout: |
53+
shell.nix
54+
tools/nix/
5155
sparse-checkout-cone-mode: false
5256

5357
- uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
@@ -60,39 +64,14 @@ jobs:
6064
name: nodejs
6165

6266
- name: Compute requisites after change
63-
shell: bash # See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference, we want the pipefail option.
64-
run: |
65-
nix-store --query --references "$(
66-
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
67-
--arg devTools "
68-
(import ./tools/nix/devTools.nix {})
69-
++ builtins.attrValues (
70-
{ inherit (import <nixpkgs> {}) nixfmt-tree sccache; }
71-
// import ./tools/nix/openssl-matrix.nix {}
72-
// import ./tools/nix/pkcs11.nix {}
73-
)")" \
74-
| xargs nix-store --realise \
75-
| xargs nix-store --query --requisites \
76-
| sort -k1.45 \
77-
> requisites-${{ matrix.system }}-after.list
67+
run: ./tools/nix/list-requisites.sh > requisites-${{ matrix.system }}-after.list
7868

7969
- name: Compute requisites before change
80-
shell: bash # See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference, we want the pipefail option.
8170
run: |
8271
git reset HEAD^ --hard
83-
nix-store --query --references "$(
84-
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
85-
--arg devTools "
86-
(import ./tools/nix/devTools.nix {})
87-
++ builtins.attrValues (
88-
{ inherit (import <nixpkgs> {}) nixfmt-tree sccache; }
89-
// import ./tools/nix/openssl-matrix.nix {}
90-
// import ./tools/nix/pkcs11.nix {}
91-
)")" \
92-
| xargs nix-store --realise \
93-
| xargs nix-store --query --requisites \
94-
| sort -k1.45 \
95-
> requisites-${{ matrix.system }}-before.list
72+
# TODO(aduh95): remove this once list-requisites.sh has reached `main`
73+
[ -f tools/nix/list-requisites.sh ] || git checkout FETCH_HEAD -- tools/nix/list-requisites.sh
74+
./tools/nix/list-requisites.sh > requisites-${{ matrix.system }}-before.list
9675
9776
- name: Output diff
9877
run: |

β€Ž.github/workflows/test-linux.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- tools/actions/**
1010
- tools/clang-format/**
1111
- tools/dep_updaters/**
12+
- tools/nix/**
1213
- test/internet/**
1314
- '**.nix'
1415
- .github/**
@@ -27,6 +28,7 @@ on:
2728
- tools/actions/**
2829
- tools/clang-format/**
2930
- tools/dep_updaters/**
31+
- tools/nix/**
3032
- test/internet/**
3133
- '**.nix'
3234
- .github/**

β€Ž.github/workflows/test-macos.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- vcbuild.bat
2829
- .**
@@ -53,6 +54,7 @@ on:
5354
- tools/eslint-rules/**
5455
- tools/eslint/**
5556
- tools/lint-md/**
57+
- tools/nix/**
5658
- typings/**
5759
- vcbuild.bat
5860
- .**

β€Ž.github/workflows/test-shared.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ on:
4444
- '!tools/nix/**'
4545
- '!tools/v8/**'
4646
- '!tools/v8_gypfiles/**'
47+
- tools/nix/list-requisites.sh
4748
- typings/**
4849
- vcbuild.bat
4950
- .**
@@ -96,6 +97,7 @@ on:
9697
- '!tools/nix/**'
9798
- '!tools/v8/**'
9899
- '!tools/v8_gypfiles/**'
100+
- tools/nix/list-requisites.sh
99101
- typings/**
100102
- vcbuild.bat
101103
- .**

β€Žtools/nix/list-requisites.shβ€Ž

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
BASE_DIR=$(cd "$(dirname "$0")/../.."&& pwd)
6+
7+
OPTIONAL_FLAGS=$(nix-instantiate -I "nixpkgs=$BASE_DIR/tools/nix/pkgs.nix" --eval --strict --raw -E "
8+
(import <nixpkgs> {}).lib.concatMapStrings
9+
(n: ''--arg \${n} true '')
10+
(builtins.filter
11+
(n: builtins.match ''with[A-Z].+'' n != null)
12+
(builtins.attrNames (builtins.functionArgs (import $BASE_DIR/shell.nix))))
13+
"
14+
)
15+
16+
DRV=$(
17+
cd"$BASE_DIR"
18+
# shellcheck disable=SC2086
19+
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
20+
$OPTIONAL_FLAGS \
21+
--arg sharedLibDeps '{
22+
# Using an empty set as some build dependencies are required only in the absence of shared deps (e.g. Cargo).
23+
# We pass the shared deps as devTools below so they are still accounted for.
24+
}' \
25+
--arg pkcs11 'import ./tools/nix/pkcs11.nix {
26+
# Passing an import call rather than "true" to workaround sharedLibDeps being empty.
27+
}' \
28+
--arg devTools '
29+
let
30+
pkgs = import <nixpkgs> { };
31+
sharedLibDepsFn = import ./tools/nix/sharedLibDeps.nix;
32+
in
33+
(import ./tools/nix/devTools.nix { })
34+
++ pkgs.lib.flatten (
35+
with (pkgs.callPackage ./tools/nix/v8.nix { });
36+
[
37+
# We do not want to build V8 here, but still want to list its requisites.
38+
buildInputs
39+
nativeBuildInputs
40+
propagatedBuildInputs
41+
propagatedNativeBuildInputs
42+
(pkgs.callPackage ./tools/nix/non-v8-deps-mock.nix { })
43+
]
44+
)
45+
++ builtins.attrValues (
46+
{
47+
# Additional packages we are using across the codebase
48+
inherit (pkgs) nixfmt-tree sccache;
49+
}
50+
// import ./tools/nix/openssl-matrix.nix { }
51+
// sharedLibDepsFn (
52+
pkgs.lib.filterAttrs (n: v: builtins.match "with[A-Z].+" n != null) (
53+
builtins.functionArgs sharedLibDepsFn
54+
)
55+
)
56+
)'
57+
)
58+
REFS=$(nix-store --query --references "$DRV")
59+
STORE_PATHS=$(echo "$REFS"| xargs nix-store --realise)
60+
REQUISITES=$(echo "$STORE_PATHS"| xargs nix-store --query --requisites)
61+
62+
echo"$REQUISITES"| sort -k1.45 | uniq

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Commit 78175c6

Browse files
committed
tools: improve nix-changes coverage
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #65403 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
1 parent 6f0c08b commit 78175c6

7 files changed

Lines changed: 81 additions & 30 deletions

File tree

β€Ž.github/workflows/build-tarball.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- vcbuild.bat
2829
- .**
@@ -52,6 +53,7 @@ on:
5253
- tools/eslint-rules/**
5354
- tools/eslint/**
5455
- tools/lint-md/**
56+
- tools/nix/**
5557
- typings/**
5658
- vcbuild.bat
5759
- .**

β€Ž.github/workflows/coverage-windows.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- .**
2829
- '!.github/workflows/coverage-windows.yml'
@@ -49,6 +50,7 @@ on:
4950
- tools/eslint-rules/**
5051
- tools/eslint/**
5152
- tools/lint-md/**
53+
- tools/nix/**
5254
- typings/**
5355
- .**
5456
- '!.github/workflows/coverage-windows.yml'

β€Ž.github/workflows/nix-changes.ymlβ€Ž

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ on:
1111
- v[0-9]+.x
1212
paths:
1313
- '**.nix'
14+
- tools/nix/**
1415
- .github/workflows/nix-changes.yml
1516
pull_request:
1617
paths:
1718
- '**.nix'
19+
- tools/nix/**
1820
- .github/workflows/nix-changes.yml
1921
types: [opened, synchronize, reopened, ready_for_review]
2022

@@ -47,7 +49,9 @@ jobs:
4749
with:
4850
fetch-depth: 2
4951
persist-credentials: false
50-
sparse-checkout: '*.nix'
52+
sparse-checkout: |
53+
shell.nix
54+
tools/nix/
5155
sparse-checkout-cone-mode: false
5256

5357
- uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
@@ -60,39 +64,14 @@ jobs:
6064
name: nodejs
6165

6266
- name: Compute requisites after change
63-
shell: bash # See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference, we want the pipefail option.
64-
run: |
65-
nix-store --query --references "$(
66-
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
67-
--arg devTools "
68-
(import ./tools/nix/devTools.nix {})
69-
++ builtins.attrValues (
70-
{ inherit (import <nixpkgs> {}) nixfmt-tree sccache; }
71-
// import ./tools/nix/openssl-matrix.nix {}
72-
// import ./tools/nix/pkcs11.nix {}
73-
)")" \
74-
| xargs nix-store --realise \
75-
| xargs nix-store --query --requisites \
76-
| sort -k1.45 \
77-
> requisites-${{ matrix.system }}-after.list
67+
run: ./tools/nix/list-requisites.sh > requisites-${{ matrix.system }}-after.list
7868

7969
- name: Compute requisites before change
80-
shell: bash # See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference, we want the pipefail option.
8170
run: |
8271
git reset HEAD^ --hard
83-
nix-store --query --references "$(
84-
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
85-
--arg devTools "
86-
(import ./tools/nix/devTools.nix {})
87-
++ builtins.attrValues (
88-
{ inherit (import <nixpkgs> {}) nixfmt-tree sccache; }
89-
// import ./tools/nix/openssl-matrix.nix {}
90-
// import ./tools/nix/pkcs11.nix {}
91-
)")" \
92-
| xargs nix-store --realise \
93-
| xargs nix-store --query --requisites \
94-
| sort -k1.45 \
95-
> requisites-${{ matrix.system }}-before.list
72+
# TODO(aduh95): remove this once list-requisites.sh has reached `main`
73+
[ -f tools/nix/list-requisites.sh ] || git checkout FETCH_HEAD -- tools/nix/list-requisites.sh
74+
./tools/nix/list-requisites.sh > requisites-${{ matrix.system }}-before.list
9675
9776
- name: Output diff
9877
run: |

β€Ž.github/workflows/test-linux.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- tools/actions/**
1010
- tools/clang-format/**
1111
- tools/dep_updaters/**
12+
- tools/nix/**
1213
- test/internet/**
1314
- '**.nix'
1415
- .github/**
@@ -27,6 +28,7 @@ on:
2728
- tools/actions/**
2829
- tools/clang-format/**
2930
- tools/dep_updaters/**
31+
- tools/nix/**
3032
- test/internet/**
3133
- '**.nix'
3234
- .github/**

β€Ž.github/workflows/test-macos.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- vcbuild.bat
2829
- .**
@@ -53,6 +54,7 @@ on:
5354
- tools/eslint-rules/**
5455
- tools/eslint/**
5556
- tools/lint-md/**
57+
- tools/nix/**
5658
- typings/**
5759
- vcbuild.bat
5860
- .**

β€Ž.github/workflows/test-shared.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ on:
4444
- '!tools/nix/**'
4545
- '!tools/v8/**'
4646
- '!tools/v8_gypfiles/**'
47+
- tools/nix/list-requisites.sh
4748
- typings/**
4849
- vcbuild.bat
4950
- .**
@@ -96,6 +97,7 @@ on:
9697
- '!tools/nix/**'
9798
- '!tools/v8/**'
9899
- '!tools/v8_gypfiles/**'
100+
- tools/nix/list-requisites.sh
99101
- typings/**
100102
- vcbuild.bat
101103
- .**

β€Žtools/nix/list-requisites.shβ€Ž

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
BASE_DIR=$(cd "$(dirname "$0")/../.."&& pwd)
6+
7+
OPTIONAL_FLAGS=$(nix-instantiate -I "nixpkgs=$BASE_DIR/tools/nix/pkgs.nix" --eval --strict --raw -E "
8+
(import <nixpkgs> {}).lib.concatMapStrings
9+
(n: ''--arg \${n} true '')
10+
(builtins.filter
11+
(n: builtins.match ''with[A-Z].+'' n != null)
12+
(builtins.attrNames (builtins.functionArgs (import $BASE_DIR/shell.nix))))
13+
"
14+
)
15+
16+
DRV=$(
17+
cd"$BASE_DIR"
18+
# shellcheck disable=SC2086
19+
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
20+
$OPTIONAL_FLAGS \
21+
--arg sharedLibDeps '{
22+
# Using an empty set as some build dependencies are required only in the absence of shared deps (e.g. Cargo).
23+
# We pass the shared deps as devTools below so they are still accounted for.
24+
}' \
25+
--arg pkcs11 'import ./tools/nix/pkcs11.nix {
26+
# Passing an import call rather than "true" to workaround sharedLibDeps being empty.
27+
}' \
28+
--arg devTools '
29+
let
30+
pkgs = import <nixpkgs> { };
31+
sharedLibDepsFn = import ./tools/nix/sharedLibDeps.nix;
32+
in
33+
(import ./tools/nix/devTools.nix { })
34+
++ pkgs.lib.flatten (
35+
with (pkgs.callPackage ./tools/nix/v8.nix { });
36+
[
37+
# We do not want to build V8 here, but still want to list its requisites.
38+
buildInputs
39+
nativeBuildInputs
40+
propagatedBuildInputs
41+
propagatedNativeBuildInputs
42+
(pkgs.callPackage ./tools/nix/non-v8-deps-mock.nix { })
43+
]
44+
)
45+
++ builtins.attrValues (
46+
{
47+
# Additional packages we are using across the codebase
48+
inherit (pkgs) nixfmt-tree sccache;
49+
}
50+
// import ./tools/nix/openssl-matrix.nix { }
51+
// sharedLibDepsFn (
52+
pkgs.lib.filterAttrs (n: v: builtins.match "with[A-Z].+" n != null) (
53+
builtins.functionArgs sharedLibDepsFn
54+
)
55+
)
56+
)'
57+
)
58+
REFS=$(nix-store --query --references "$DRV")
59+
STORE_PATHS=$(echo "$REFS"| xargs nix-store --realise)
60+
REQUISITES=$(echo "$STORE_PATHS"| xargs nix-store --query --requisites)
61+
62+
echo"$REQUISITES"| sort -k1.45 | uniq

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit 78175c6

Browse files
committed
tools: improve nix-changes coverage
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #65403 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
1 parent 6f0c08b commit 78175c6

7 files changed

Lines changed: 81 additions & 30 deletions

File tree

β€Ž.github/workflows/build-tarball.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- vcbuild.bat
2829
- .**
@@ -52,6 +53,7 @@ on:
5253
- tools/eslint-rules/**
5354
- tools/eslint/**
5455
- tools/lint-md/**
56+
- tools/nix/**
5557
- typings/**
5658
- vcbuild.bat
5759
- .**

β€Ž.github/workflows/coverage-windows.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- .**
2829
- '!.github/workflows/coverage-windows.yml'
@@ -49,6 +50,7 @@ on:
4950
- tools/eslint-rules/**
5051
- tools/eslint/**
5152
- tools/lint-md/**
53+
- tools/nix/**
5254
- typings/**
5355
- .**
5456
- '!.github/workflows/coverage-windows.yml'

β€Ž.github/workflows/nix-changes.ymlβ€Ž

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ on:
1111
- v[0-9]+.x
1212
paths:
1313
- '**.nix'
14+
- tools/nix/**
1415
- .github/workflows/nix-changes.yml
1516
pull_request:
1617
paths:
1718
- '**.nix'
19+
- tools/nix/**
1820
- .github/workflows/nix-changes.yml
1921
types: [opened, synchronize, reopened, ready_for_review]
2022

@@ -47,7 +49,9 @@ jobs:
4749
with:
4850
fetch-depth: 2
4951
persist-credentials: false
50-
sparse-checkout: '*.nix'
52+
sparse-checkout: |
53+
shell.nix
54+
tools/nix/
5155
sparse-checkout-cone-mode: false
5256

5357
- uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
@@ -60,39 +64,14 @@ jobs:
6064
name: nodejs
6165

6266
- name: Compute requisites after change
63-
shell: bash # See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference, we want the pipefail option.
64-
run: |
65-
nix-store --query --references "$(
66-
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
67-
--arg devTools "
68-
(import ./tools/nix/devTools.nix {})
69-
++ builtins.attrValues (
70-
{ inherit (import <nixpkgs> {}) nixfmt-tree sccache; }
71-
// import ./tools/nix/openssl-matrix.nix {}
72-
// import ./tools/nix/pkcs11.nix {}
73-
)")" \
74-
| xargs nix-store --realise \
75-
| xargs nix-store --query --requisites \
76-
| sort -k1.45 \
77-
> requisites-${{ matrix.system }}-after.list
67+
run: ./tools/nix/list-requisites.sh > requisites-${{ matrix.system }}-after.list
7868

7969
- name: Compute requisites before change
80-
shell: bash # See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference, we want the pipefail option.
8170
run: |
8271
git reset HEAD^ --hard
83-
nix-store --query --references "$(
84-
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
85-
--arg devTools "
86-
(import ./tools/nix/devTools.nix {})
87-
++ builtins.attrValues (
88-
{ inherit (import <nixpkgs> {}) nixfmt-tree sccache; }
89-
// import ./tools/nix/openssl-matrix.nix {}
90-
// import ./tools/nix/pkcs11.nix {}
91-
)")" \
92-
| xargs nix-store --realise \
93-
| xargs nix-store --query --requisites \
94-
| sort -k1.45 \
95-
> requisites-${{ matrix.system }}-before.list
72+
# TODO(aduh95): remove this once list-requisites.sh has reached `main`
73+
[ -f tools/nix/list-requisites.sh ] || git checkout FETCH_HEAD -- tools/nix/list-requisites.sh
74+
./tools/nix/list-requisites.sh > requisites-${{ matrix.system }}-before.list
9675
9776
- name: Output diff
9877
run: |

β€Ž.github/workflows/test-linux.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- tools/actions/**
1010
- tools/clang-format/**
1111
- tools/dep_updaters/**
12+
- tools/nix/**
1213
- test/internet/**
1314
- '**.nix'
1415
- .github/**
@@ -27,6 +28,7 @@ on:
2728
- tools/actions/**
2829
- tools/clang-format/**
2930
- tools/dep_updaters/**
31+
- tools/nix/**
3032
- test/internet/**
3133
- '**.nix'
3234
- .github/**

β€Ž.github/workflows/test-macos.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- vcbuild.bat
2829
- .**
@@ -53,6 +54,7 @@ on:
5354
- tools/eslint-rules/**
5455
- tools/eslint/**
5556
- tools/lint-md/**
57+
- tools/nix/**
5658
- typings/**
5759
- vcbuild.bat
5860
- .**

β€Ž.github/workflows/test-shared.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ on:
4444
- '!tools/nix/**'
4545
- '!tools/v8/**'
4646
- '!tools/v8_gypfiles/**'
47+
- tools/nix/list-requisites.sh
4748
- typings/**
4849
- vcbuild.bat
4950
- .**
@@ -96,6 +97,7 @@ on:
9697
- '!tools/nix/**'
9798
- '!tools/v8/**'
9899
- '!tools/v8_gypfiles/**'
100+
- tools/nix/list-requisites.sh
99101
- typings/**
100102
- vcbuild.bat
101103
- .**

β€Žtools/nix/list-requisites.shβ€Ž

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
BASE_DIR=$(cd "$(dirname "$0")/../.."&& pwd)
6+
7+
OPTIONAL_FLAGS=$(nix-instantiate -I "nixpkgs=$BASE_DIR/tools/nix/pkgs.nix" --eval --strict --raw -E "
8+
(import <nixpkgs> {}).lib.concatMapStrings
9+
(n: ''--arg \${n} true '')
10+
(builtins.filter
11+
(n: builtins.match ''with[A-Z].+'' n != null)
12+
(builtins.attrNames (builtins.functionArgs (import $BASE_DIR/shell.nix))))
13+
"
14+
)
15+
16+
DRV=$(
17+
cd"$BASE_DIR"
18+
# shellcheck disable=SC2086
19+
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
20+
$OPTIONAL_FLAGS \
21+
--arg sharedLibDeps '{
22+
# Using an empty set as some build dependencies are required only in the absence of shared deps (e.g. Cargo).
23+
# We pass the shared deps as devTools below so they are still accounted for.
24+
}' \
25+
--arg pkcs11 'import ./tools/nix/pkcs11.nix {
26+
# Passing an import call rather than "true" to workaround sharedLibDeps being empty.
27+
}' \
28+
--arg devTools '
29+
let
30+
pkgs = import <nixpkgs> { };
31+
sharedLibDepsFn = import ./tools/nix/sharedLibDeps.nix;
32+
in
33+
(import ./tools/nix/devTools.nix { })
34+
++ pkgs.lib.flatten (
35+
with (pkgs.callPackage ./tools/nix/v8.nix { });
36+
[
37+
# We do not want to build V8 here, but still want to list its requisites.
38+
buildInputs
39+
nativeBuildInputs
40+
propagatedBuildInputs
41+
propagatedNativeBuildInputs
42+
(pkgs.callPackage ./tools/nix/non-v8-deps-mock.nix { })
43+
]
44+
)
45+
++ builtins.attrValues (
46+
{
47+
# Additional packages we are using across the codebase
48+
inherit (pkgs) nixfmt-tree sccache;
49+
}
50+
// import ./tools/nix/openssl-matrix.nix { }
51+
// sharedLibDepsFn (
52+
pkgs.lib.filterAttrs (n: v: builtins.match "with[A-Z].+" n != null) (
53+
builtins.functionArgs sharedLibDepsFn
54+
)
55+
)
56+
)'
57+
)
58+
REFS=$(nix-store --query --references "$DRV")
59+
STORE_PATHS=$(echo "$REFS"| xargs nix-store --realise)
60+
REQUISITES=$(echo "$STORE_PATHS"| xargs nix-store --query --requisites)
61+
62+
echo"$REQUISITES"| sort -k1.45 | uniq

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit 78175c6

Browse files
committed
tools: improve nix-changes coverage
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #65403 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
1 parent 6f0c08b commit 78175c6

7 files changed

Lines changed: 81 additions & 30 deletions

File tree

β€Ž.github/workflows/build-tarball.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- vcbuild.bat
2829
- .**
@@ -52,6 +53,7 @@ on:
5253
- tools/eslint-rules/**
5354
- tools/eslint/**
5455
- tools/lint-md/**
56+
- tools/nix/**
5557
- typings/**
5658
- vcbuild.bat
5759
- .**

β€Ž.github/workflows/coverage-windows.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- .**
2829
- '!.github/workflows/coverage-windows.yml'
@@ -49,6 +50,7 @@ on:
4950
- tools/eslint-rules/**
5051
- tools/eslint/**
5152
- tools/lint-md/**
53+
- tools/nix/**
5254
- typings/**
5355
- .**
5456
- '!.github/workflows/coverage-windows.yml'

β€Ž.github/workflows/nix-changes.ymlβ€Ž

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ on:
1111
- v[0-9]+.x
1212
paths:
1313
- '**.nix'
14+
- tools/nix/**
1415
- .github/workflows/nix-changes.yml
1516
pull_request:
1617
paths:
1718
- '**.nix'
19+
- tools/nix/**
1820
- .github/workflows/nix-changes.yml
1921
types: [opened, synchronize, reopened, ready_for_review]
2022

@@ -47,7 +49,9 @@ jobs:
4749
with:
4850
fetch-depth: 2
4951
persist-credentials: false
50-
sparse-checkout: '*.nix'
52+
sparse-checkout: |
53+
shell.nix
54+
tools/nix/
5155
sparse-checkout-cone-mode: false
5256

5357
- uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
@@ -60,39 +64,14 @@ jobs:
6064
name: nodejs
6165

6266
- name: Compute requisites after change
63-
shell: bash # See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference, we want the pipefail option.
64-
run: |
65-
nix-store --query --references "$(
66-
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
67-
--arg devTools "
68-
(import ./tools/nix/devTools.nix {})
69-
++ builtins.attrValues (
70-
{ inherit (import <nixpkgs> {}) nixfmt-tree sccache; }
71-
// import ./tools/nix/openssl-matrix.nix {}
72-
// import ./tools/nix/pkcs11.nix {}
73-
)")" \
74-
| xargs nix-store --realise \
75-
| xargs nix-store --query --requisites \
76-
| sort -k1.45 \
77-
> requisites-${{ matrix.system }}-after.list
67+
run: ./tools/nix/list-requisites.sh > requisites-${{ matrix.system }}-after.list
7868

7969
- name: Compute requisites before change
80-
shell: bash # See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference, we want the pipefail option.
8170
run: |
8271
git reset HEAD^ --hard
83-
nix-store --query --references "$(
84-
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
85-
--arg devTools "
86-
(import ./tools/nix/devTools.nix {})
87-
++ builtins.attrValues (
88-
{ inherit (import <nixpkgs> {}) nixfmt-tree sccache; }
89-
// import ./tools/nix/openssl-matrix.nix {}
90-
// import ./tools/nix/pkcs11.nix {}
91-
)")" \
92-
| xargs nix-store --realise \
93-
| xargs nix-store --query --requisites \
94-
| sort -k1.45 \
95-
> requisites-${{ matrix.system }}-before.list
72+
# TODO(aduh95): remove this once list-requisites.sh has reached `main`
73+
[ -f tools/nix/list-requisites.sh ] || git checkout FETCH_HEAD -- tools/nix/list-requisites.sh
74+
./tools/nix/list-requisites.sh > requisites-${{ matrix.system }}-before.list
9675
9776
- name: Output diff
9877
run: |

β€Ž.github/workflows/test-linux.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- tools/actions/**
1010
- tools/clang-format/**
1111
- tools/dep_updaters/**
12+
- tools/nix/**
1213
- test/internet/**
1314
- '**.nix'
1415
- .github/**
@@ -27,6 +28,7 @@ on:
2728
- tools/actions/**
2829
- tools/clang-format/**
2930
- tools/dep_updaters/**
31+
- tools/nix/**
3032
- test/internet/**
3133
- '**.nix'
3234
- .github/**

β€Ž.github/workflows/test-macos.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- vcbuild.bat
2829
- .**
@@ -53,6 +54,7 @@ on:
5354
- tools/eslint-rules/**
5455
- tools/eslint/**
5556
- tools/lint-md/**
57+
- tools/nix/**
5658
- typings/**
5759
- vcbuild.bat
5860
- .**

β€Ž.github/workflows/test-shared.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ on:
4444
- '!tools/nix/**'
4545
- '!tools/v8/**'
4646
- '!tools/v8_gypfiles/**'
47+
- tools/nix/list-requisites.sh
4748
- typings/**
4849
- vcbuild.bat
4950
- .**
@@ -96,6 +97,7 @@ on:
9697
- '!tools/nix/**'
9798
- '!tools/v8/**'
9899
- '!tools/v8_gypfiles/**'
100+
- tools/nix/list-requisites.sh
99101
- typings/**
100102
- vcbuild.bat
101103
- .**

β€Žtools/nix/list-requisites.shβ€Ž

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
BASE_DIR=$(cd "$(dirname "$0")/../.."&& pwd)
6+
7+
OPTIONAL_FLAGS=$(nix-instantiate -I "nixpkgs=$BASE_DIR/tools/nix/pkgs.nix" --eval --strict --raw -E "
8+
(import <nixpkgs> {}).lib.concatMapStrings
9+
(n: ''--arg \${n} true '')
10+
(builtins.filter
11+
(n: builtins.match ''with[A-Z].+'' n != null)
12+
(builtins.attrNames (builtins.functionArgs (import $BASE_DIR/shell.nix))))
13+
"
14+
)
15+
16+
DRV=$(
17+
cd"$BASE_DIR"
18+
# shellcheck disable=SC2086
19+
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
20+
$OPTIONAL_FLAGS \
21+
--arg sharedLibDeps '{
22+
# Using an empty set as some build dependencies are required only in the absence of shared deps (e.g. Cargo).
23+
# We pass the shared deps as devTools below so they are still accounted for.
24+
}' \
25+
--arg pkcs11 'import ./tools/nix/pkcs11.nix {
26+
# Passing an import call rather than "true" to workaround sharedLibDeps being empty.
27+
}' \
28+
--arg devTools '
29+
let
30+
pkgs = import <nixpkgs> { };
31+
sharedLibDepsFn = import ./tools/nix/sharedLibDeps.nix;
32+
in
33+
(import ./tools/nix/devTools.nix { })
34+
++ pkgs.lib.flatten (
35+
with (pkgs.callPackage ./tools/nix/v8.nix { });
36+
[
37+
# We do not want to build V8 here, but still want to list its requisites.
38+
buildInputs
39+
nativeBuildInputs
40+
propagatedBuildInputs
41+
propagatedNativeBuildInputs
42+
(pkgs.callPackage ./tools/nix/non-v8-deps-mock.nix { })
43+
]
44+
)
45+
++ builtins.attrValues (
46+
{
47+
# Additional packages we are using across the codebase
48+
inherit (pkgs) nixfmt-tree sccache;
49+
}
50+
// import ./tools/nix/openssl-matrix.nix { }
51+
// sharedLibDepsFn (
52+
pkgs.lib.filterAttrs (n: v: builtins.match "with[A-Z].+" n != null) (
53+
builtins.functionArgs sharedLibDepsFn
54+
)
55+
)
56+
)'
57+
)
58+
REFS=$(nix-store --query --references "$DRV")
59+
STORE_PATHS=$(echo "$REFS"| xargs nix-store --realise)
60+
REQUISITES=$(echo "$STORE_PATHS"| xargs nix-store --query --requisites)
61+
62+
echo"$REQUISITES"| sort -k1.45 | uniq

0 commit comments

Comments
Β (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Commit 78175c6

Browse files
committed
tools: improve nix-changes coverage
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #65403 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com>
1 parent 6f0c08b commit 78175c6

7 files changed

Lines changed: 81 additions & 30 deletions

File tree

β€Ž.github/workflows/build-tarball.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- vcbuild.bat
2829
- .**
@@ -52,6 +53,7 @@ on:
5253
- tools/eslint-rules/**
5354
- tools/eslint/**
5455
- tools/lint-md/**
56+
- tools/nix/**
5557
- typings/**
5658
- vcbuild.bat
5759
- .**

β€Ž.github/workflows/coverage-windows.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- .**
2829
- '!.github/workflows/coverage-windows.yml'
@@ -49,6 +50,7 @@ on:
4950
- tools/eslint-rules/**
5051
- tools/eslint/**
5152
- tools/lint-md/**
53+
- tools/nix/**
5254
- typings/**
5355
- .**
5456
- '!.github/workflows/coverage-windows.yml'

β€Ž.github/workflows/nix-changes.ymlβ€Ž

Lines changed: 9 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ on:
1111
- v[0-9]+.x
1212
paths:
1313
- '**.nix'
14+
- tools/nix/**
1415
- .github/workflows/nix-changes.yml
1516
pull_request:
1617
paths:
1718
- '**.nix'
19+
- tools/nix/**
1820
- .github/workflows/nix-changes.yml
1921
types: [opened, synchronize, reopened, ready_for_review]
2022

@@ -47,7 +49,9 @@ jobs:
4749
with:
4850
fetch-depth: 2
4951
persist-credentials: false
50-
sparse-checkout: '*.nix'
52+
sparse-checkout: |
53+
shell.nix
54+
tools/nix/
5155
sparse-checkout-cone-mode: false
5256

5357
- uses: cachix/install-nix-action@630ae543ea3a38a9a4166f03376c02c50f408342 # v31.11.0
@@ -60,39 +64,14 @@ jobs:
6064
name: nodejs
6165

6266
- name: Compute requisites after change
63-
shell: bash # See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference, we want the pipefail option.
64-
run: |
65-
nix-store --query --references "$(
66-
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
67-
--arg devTools "
68-
(import ./tools/nix/devTools.nix {})
69-
++ builtins.attrValues (
70-
{ inherit (import <nixpkgs> {}) nixfmt-tree sccache; }
71-
// import ./tools/nix/openssl-matrix.nix {}
72-
// import ./tools/nix/pkcs11.nix {}
73-
)")" \
74-
| xargs nix-store --realise \
75-
| xargs nix-store --query --requisites \
76-
| sort -k1.45 \
77-
> requisites-${{ matrix.system }}-after.list
67+
run: ./tools/nix/list-requisites.sh > requisites-${{ matrix.system }}-after.list
7868

7969
- name: Compute requisites before change
80-
shell: bash # See https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference, we want the pipefail option.
8170
run: |
8271
git reset HEAD^ --hard
83-
nix-store --query --references "$(
84-
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
85-
--arg devTools "
86-
(import ./tools/nix/devTools.nix {})
87-
++ builtins.attrValues (
88-
{ inherit (import <nixpkgs> {}) nixfmt-tree sccache; }
89-
// import ./tools/nix/openssl-matrix.nix {}
90-
// import ./tools/nix/pkcs11.nix {}
91-
)")" \
92-
| xargs nix-store --realise \
93-
| xargs nix-store --query --requisites \
94-
| sort -k1.45 \
95-
> requisites-${{ matrix.system }}-before.list
72+
# TODO(aduh95): remove this once list-requisites.sh has reached `main`
73+
[ -f tools/nix/list-requisites.sh ] || git checkout FETCH_HEAD -- tools/nix/list-requisites.sh
74+
./tools/nix/list-requisites.sh > requisites-${{ matrix.system }}-before.list
9675
9776
- name: Output diff
9877
run: |

β€Ž.github/workflows/test-linux.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- tools/actions/**
1010
- tools/clang-format/**
1111
- tools/dep_updaters/**
12+
- tools/nix/**
1213
- test/internet/**
1314
- '**.nix'
1415
- .github/**
@@ -27,6 +28,7 @@ on:
2728
- tools/actions/**
2829
- tools/clang-format/**
2930
- tools/dep_updaters/**
31+
- tools/nix/**
3032
- test/internet/**
3133
- '**.nix'
3234
- .github/**

β€Ž.github/workflows/test-macos.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- tools/eslint-rules/**
2424
- tools/eslint/**
2525
- tools/lint-md/**
26+
- tools/nix/**
2627
- typings/**
2728
- vcbuild.bat
2829
- .**
@@ -53,6 +54,7 @@ on:
5354
- tools/eslint-rules/**
5455
- tools/eslint/**
5556
- tools/lint-md/**
57+
- tools/nix/**
5658
- typings/**
5759
- vcbuild.bat
5860
- .**

β€Ž.github/workflows/test-shared.ymlβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ on:
4444
- '!tools/nix/**'
4545
- '!tools/v8/**'
4646
- '!tools/v8_gypfiles/**'
47+
- tools/nix/list-requisites.sh
4748
- typings/**
4849
- vcbuild.bat
4950
- .**
@@ -96,6 +97,7 @@ on:
9697
- '!tools/nix/**'
9798
- '!tools/v8/**'
9899
- '!tools/v8_gypfiles/**'
100+
- tools/nix/list-requisites.sh
99101
- typings/**
100102
- vcbuild.bat
101103
- .**

β€Žtools/nix/list-requisites.shβ€Ž

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/sh
2+
3+
set -ex
4+
5+
BASE_DIR=$(cd "$(dirname "$0")/../.."&& pwd)
6+
7+
OPTIONAL_FLAGS=$(nix-instantiate -I "nixpkgs=$BASE_DIR/tools/nix/pkgs.nix" --eval --strict --raw -E "
8+
(import <nixpkgs> {}).lib.concatMapStrings
9+
(n: ''--arg \${n} true '')
10+
(builtins.filter
11+
(n: builtins.match ''with[A-Z].+'' n != null)
12+
(builtins.attrNames (builtins.functionArgs (import $BASE_DIR/shell.nix))))
13+
"
14+
)
15+
16+
DRV=$(
17+
cd"$BASE_DIR"
18+
# shellcheck disable=SC2086
19+
nix-instantiate -I "nixpkgs=./tools/nix/pkgs.nix" shell.nix \
20+
$OPTIONAL_FLAGS \
21+
--arg sharedLibDeps '{
22+
# Using an empty set as some build dependencies are required only in the absence of shared deps (e.g. Cargo).
23+
# We pass the shared deps as devTools below so they are still accounted for.
24+
}' \
25+
--arg pkcs11 'import ./tools/nix/pkcs11.nix {
26+
# Passing an import call rather than "true" to workaround sharedLibDeps being empty.
27+
}' \
28+
--arg devTools '
29+
let
30+
pkgs = import <nixpkgs> { };
31+
sharedLibDepsFn = import ./tools/nix/sharedLibDeps.nix;
32+
in
33+
(import ./tools/nix/devTools.nix { })
34+
++ pkgs.lib.flatten (
35+
with (pkgs.callPackage ./tools/nix/v8.nix { });
36+
[
37+
# We do not want to build V8 here, but still want to list its requisites.
38+
buildInputs
39+
nativeBuildInputs
40+
propagatedBuildInputs
41+
propagatedNativeBuildInputs
42+
(pkgs.callPackage ./tools/nix/non-v8-deps-mock.nix { })
43+
]
44+
)
45+
++ builtins.attrValues (
46+
{
47+
# Additional packages we are using across the codebase
48+
inherit (pkgs) nixfmt-tree sccache;
49+
}
50+
// import ./tools/nix/openssl-matrix.nix { }
51+
// sharedLibDepsFn (
52+
pkgs.lib.filterAttrs (n: v: builtins.match "with[A-Z].+" n != null) (
53+
builtins.functionArgs sharedLibDepsFn
54+
)
55+
)
56+
)'
57+
)
58+
REFS=$(nix-store --query --references "$DRV")
59+
STORE_PATHS=$(echo "$REFS"| xargs nix-store --realise)
60+
REQUISITES=$(echo "$STORE_PATHS"| xargs nix-store --query --requisites)
61+
62+
echo"$REQUISITES"| sort -k1.45 | uniq

0 commit comments

Comments
Β (0)