Skip to content

Commit 678d1ce

Browse files
committed
fixup! fixup! tools: run CI with shared libs on GHA
1 parent cbb4073 commit 678d1ce

File tree

2 files changed

+58
-36
lines changed

2 files changed

+58
-36
lines changed

nixpkgs.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ let
77
sha256 = "1airrw6l87iyny1a3mb29l28na4s4llifprlgpll2na461jd40iy";
88
}) arg;
99
in
10-
nixpkgs
10+
nixpkgs

shell.nix

Lines changed: 57 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
pkgs ? import "${./nixpkgs.nix}" {},
2+
pkgs ? import "${./nixpkgs.nix}" { },
33
loadJSBuiltinsDynamically ? true, # Load `lib/**.js` from disk instead of embedding
44
ncu-path ? null, # Provide this if you want to use a local version of NCU
55
icu ? pkgs.icu,
@@ -19,7 +19,7 @@
1919
uvwasi
2020
zlib
2121
zstd
22-
;
22+
;
2323
http-parser = pkgs.llhttp;
2424
},
2525
ccache ? pkgs.ccache,
@@ -30,13 +30,17 @@
3030
pkgs.git
3131
pkgs.jq
3232
pkgs.shellcheck
33-
] ++ (if (ncu-path == null) then [
34-
pkgs.node-core-utils
35-
] else [
36-
(pkgs.writeShellScriptBin "git-node" "exec \"${ncu-path}/bin/git-node.js\" \"$@\"")
37-
(pkgs.writeShellScriptBin "ncu-ci" "exec \"${ncu-path}/bin/ncu-ci.js\" \"$@\"")
38-
(pkgs.writeShellScriptBin "ncu-config" "exec \"${ncu-path}/bin/ncu-config.js\" \"$@\"")
39-
]),
33+
]
34+
++ (
35+
if (ncu-path == null) then
36+
[ pkgs.node-core-utils ]
37+
else
38+
[
39+
(pkgs.writeShellScriptBin "git-node" "exec \"${ncu-path}/bin/git-node.js\" \"$@\"")
40+
(pkgs.writeShellScriptBin "ncu-ci" "exec \"${ncu-path}/bin/ncu-ci.js\" \"$@\"")
41+
(pkgs.writeShellScriptBin "ncu-config" "exec \"${ncu-path}/bin/ncu-config.js\" \"$@\"")
42+
]
43+
),
4044
benchmarkTools ? [
4145
pkgs.R
4246
pkgs.rPackages.ggplot2
@@ -61,38 +65,56 @@ pkgs.mkShell {
6165

6266
packages = [
6367
ccache
64-
] ++ devTools ++ benchmarkTools;
68+
]
69+
++ devTools
70+
++ benchmarkTools;
6571

66-
shellHook = if (ccache != null) then ''
67-
export CC="${pkgs.lib.getExe ccache} $CC"
68-
export CXX="${pkgs.lib.getExe ccache} $CXX"
69-
'' else "";
72+
shellHook =
73+
if (ccache != null) then
74+
''
75+
export CC="${pkgs.lib.getExe ccache} $CC"
76+
export CXX="${pkgs.lib.getExe ccache} $CXX"
77+
''
78+
else
79+
"";
7080

7181
BUILD_WITH = if (ninja != null) then "ninja" else "make";
7282
NINJA = if (ninja != null) then "${pkgs.lib.getExe ninja}" else "";
73-
CI_SKIP_TESTS = pkgs.lib.concatStringsSep "," ([
74-
] ++ pkgs.lib.optionals useSharedAda [
83+
CI_SKIP_TESTS = pkgs.lib.concatStringsSep "," (
84+
[ ]
85+
++ pkgs.lib.optionals useSharedAda [
7586
# Different versions of Ada affect the WPT tests
7687
"test-url"
77-
] ++ pkgs.lib.optionals useSharedOpenSSL [
88+
]
89+
++ pkgs.lib.optionals useSharedOpenSSL [
7890
# Path to the openssl.cnf is different from the expected one
7991
"test-strace-openat-openssl"
80-
]);
81-
CONFIG_FLAGS = builtins.toString ([
82-
(if icu == null
83-
then "--without-intl"
84-
else "--with-intl=${if useSharedICU then "system" else icu}-icu")
85-
] ++ extraConfigFlags ++ pkgs.lib.optionals (ninja != null) [
86-
"--ninja"
87-
] ++ pkgs.lib.optionals loadJSBuiltinsDynamically [
88-
"--node-builtin-modules-path=${builtins.toString ./.}"
89-
] ++ pkgs.lib.concatMap (name: [
90-
"--shared-${builtins.replaceStrings [ "c-ares" ] [ "cares" ] name}"
91-
"--shared-${builtins.replaceStrings [ "c-ares" ] [ "cares" ] name}-libpath=${
92-
pkgs.lib.getLib sharedLibDeps.${name}
93-
}/lib"
94-
"--shared-${builtins.replaceStrings [ "c-ares" ] [ "cares" ] name}-include=${
95-
pkgs.lib.getInclude sharedLibDeps.${name}
96-
}/include"
97-
]) (builtins.attrNames sharedLibDeps));
92+
]
93+
);
94+
CONFIG_FLAGS = builtins.toString (
95+
[
96+
(
97+
if icu == null then
98+
"--without-intl"
99+
else
100+
"--with-intl=${if useSharedICU then "system" else icu}-icu"
101+
)
102+
]
103+
++ extraConfigFlags
104+
++ pkgs.lib.optionals (ninja != null) [
105+
"--ninja"
106+
]
107+
++ pkgs.lib.optionals loadJSBuiltinsDynamically [
108+
"--node-builtin-modules-path=${builtins.toString ./.}"
109+
]
110+
++ pkgs.lib.concatMap (name: [
111+
"--shared-${builtins.replaceStrings [ "c-ares" ] [ "cares" ] name}"
112+
"--shared-${builtins.replaceStrings [ "c-ares" ] [ "cares" ] name}-libpath=${
113+
pkgs.lib.getLib sharedLibDeps.${name}
114+
}/lib"
115+
"--shared-${builtins.replaceStrings [ "c-ares" ] [ "cares" ] name}-include=${
116+
pkgs.lib.getInclude sharedLibDeps.${name}
117+
}/include"
118+
]) (builtins.attrNames sharedLibDeps)
119+
);
98120
}

0 commit comments

Comments
 (0)