tools: store "default" OpenSSL version in openssl-matrix.nix

To help with automating keeping in sync with the bundled version.

Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64962
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
This commit is contained in:
Antoine du Hamel authored and GitHub committed 2026-08-04 16:34:32 +00:00
1 parent bd2e603921
commit 339062296e
4 files changed
+29 -5

No files matched your search

+23 -2
View File
@@ -42,6 +42,14 @@ COMPAT_VERSION_SHA1=$(grep 'rev =' "$NIXPKGS_COMPAT_PIN_FILE" | awk -F'"' '{ pri
COMPAT_UPSTREAM_SHA1=$(git ls-remote "$NIXPKGS_REPO.git" nixpkgs-26.05-darwin | awk '{print $1}')
update_pkgs_file "$NIXPKGS_COMPAT_PIN_FILE" "$COMPAT_VERSION_SHA1" "$COMPAT_UPSTREAM_SHA1"
# === Update openssl-matrix.nix ===
# When bumping the pin, we want to update the openssl-matrix.nix file to keep the list in sync nixpkgs
# i.e. add newly added release lines, remove newly dropped release lines), and make sure the "openssl"
# attribute still refers to the same release line as the bundled version in deps/openssl/.
OPENSSL_MAJOR=$(awk -F= '/^MAJOR=[0-9]+$/ { print $2; exit }' "$BASE_DIR/deps/openssl/openssl/VERSION.dat")
OPENSSL_MINOR=$(awk -F= '/^MINOR=[0-9]+$/ { print $2; exit }' "$BASE_DIR/deps/openssl/openssl/VERSION.dat")
nix-instantiate -I "nixpkgs=$NIXPKGS_PIN_FILE" --eval --strict --json -E "
let
pkgs = import <nixpkgs> {};
@@ -49,15 +57,24 @@ nix-instantiate -I "nixpkgs=$NIXPKGS_PIN_FILE" --eval --strict --json -E "
(n: builtins.match \"openssl_[0-9]+(_[0-9]+)?\" n != null)
(builtins.attrNames pkgs);
extraMatrixAttrs = [ \"boringssl\" ];
default = builtins.head (builtins.filter (n:
let
inherit (pkgs.lib) versions;
t = builtins.tryEval pkgs.\${n};
v = if t.success then builtins.tryEval t.value.version else t;
majorVersion = pkgs.lib.optionalString v.success (versions.major v.value);
minorVersion = pkgs.lib.optionalString v.success (versions.minor v.value);
in
majorVersion == ''$OPENSSL_MAJOR'' && minorVersion == ''$OPENSSL_MINOR'') opensslAttrs);
attrs = builtins.filter
(n:
let t = builtins.tryEval pkgs.\${n}; in
t.success && (builtins.tryEval t.value.version).success
n != default && t.success && (builtins.tryEval t.value.version).success
)
(opensslAttrs ++ extraMatrixAttrs);
in
{
inherit attrs;
inherit attrs default;
permittedInsecurePackages = builtins.map (attr: pkgs.\${attr}.name) (
builtins.filter (attr: (pkgs.\${attr}.meta.insecure)) attrs
);
@@ -69,6 +86,10 @@ nix-instantiate -I "nixpkgs=$NIXPKGS_PIN_FILE" --eval --strict --json -E "
}:
{
# "default" OpenSSL release line, should be kept in sync with the bundled version:
openssl = pkgs.\(.default);
# Other OpenSSL variants we want to test for:
inherit (pkgs)
\(.attrs | sort | join("\n "))
;
+4 -1
View File
@@ -5,11 +5,14 @@
}:
{
# "default" OpenSSL release line, should be kept in sync with the bundled version:
openssl = pkgs.openssl_3_5;
# Other OpenSSL variants we want to test for:
inherit (pkgs)
boringssl
openssl_1_1
openssl_3
openssl_3_5
openssl_3_6
openssl_4_0
;
+1 -1
View File
@@ -10,7 +10,7 @@
# pkcs11-provider is dlopen'd into the libcrypto Node.js itself links, so it
# has to be built against that very OpenSSL. SoftHSM links OpenSSL too;
# building it against the same one keeps a single libcrypto in the process.
openssl ? (import ./sharedLibDeps.nix { inherit pkgs; }).openssl,
openssl ? (import ./openssl-matrix.nix { inherit pkgs; }).openssl,
pin ? "1234",
}:
+1 -1
View File
@@ -48,7 +48,7 @@
ffi = pkgs.libffiReal;
})
// (pkgs.lib.optionalAttrs withSSL ({
openssl = (import ./openssl-matrix.nix { inherit pkgs; }).openssl_3_5;
inherit (import ./openssl-matrix.nix { inherit pkgs; }) openssl;
}))
// (pkgs.lib.optionalAttrs withTemporal {
inherit (pkgs) temporal_capi;