Skip to content
Open
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
25 changes: 23 additions & 2 deletions tools/dep_updaters/update-nixpkgs-pin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,39 @@ 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> {};
opensslAttrs = builtins.filter
(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
);
Expand All @@ -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 "))
;
Expand Down
5 changes: 4 additions & 1 deletion tools/nix/openssl-matrix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
;
Expand Down
2 changes: 1 addition & 1 deletion tools/nix/pkcs11.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}:
Expand Down
2 changes: 1 addition & 1 deletion tools/nix/sharedLibDeps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down