@@ -42,22 +42,39 @@ COMPAT_VERSION_SHA1=$(grep 'rev =' "$NIXPKGS_COMPAT_PIN_FILE" | awk -F'"' '{ pri
4242COMPAT_UPSTREAM_SHA1=$( git ls-remote " $NIXPKGS_REPO .git" nixpkgs-26.05-darwin | awk ' {print $1}' )
4343update_pkgs_file " $NIXPKGS_COMPAT_PIN_FILE " " $COMPAT_VERSION_SHA1 " " $COMPAT_UPSTREAM_SHA1 "
4444
45+ # === Update openssl-matrix.nix ===
46+ # When bumping the pin, we want to update the openssl-matrix.nix file to keep the list in sync nixpkgs
47+ # i.e. add newly added release lines, remove newly dropped release lines), and make sure the "openssl"
48+ # attribute still refers to the same release line as the bundled version in deps/openssl/.
49+
50+ OPENSSL_MAJOR=$( awk -F= ' /^MAJOR=[0-9]+$/ { print $2; exit }' " $BASE_DIR /deps/openssl/openssl/VERSION.dat" )
51+ OPENSSL_MINOR=$( awk -F= ' /^MINOR=[0-9]+$/ { print $2; exit }' " $BASE_DIR /deps/openssl/openssl/VERSION.dat" )
52+
4553nix-instantiate -I " nixpkgs=$NIXPKGS_PIN_FILE " --eval --strict --json -E "
4654 let
4755 pkgs = import <nixpkgs> {};
4856 opensslAttrs = builtins.filter
4957 (n: builtins.match \" openssl_[0-9]+(_[0-9]+)?\" n != null)
5058 (builtins.attrNames pkgs);
5159 extraMatrixAttrs = [ \" boringssl\" ];
60+ default = builtins.head (builtins.filter (n:
61+ let
62+ inherit (pkgs.lib) versions;
63+ t = builtins.tryEval pkgs.\$ {n};
64+ v = if t.success then builtins.tryEval t.value.version else t;
65+ majorVersion = pkgs.lib.optionalString v.success (versions.major v.value);
66+ minorVersion = pkgs.lib.optionalString v.success (versions.minor v.value);
67+ in
68+ majorVersion == ''$OPENSSL_MAJOR '' && minorVersion == ''$OPENSSL_MINOR '') opensslAttrs);
5269 attrs = builtins.filter
5370 (n:
5471 let t = builtins.tryEval pkgs.\$ {n}; in
55- t.success && (builtins.tryEval t.value.version).success
72+ n != default && t.success && (builtins.tryEval t.value.version).success
5673 )
5774 (opensslAttrs ++ extraMatrixAttrs);
5875 in
5976 {
60- inherit attrs;
77+ inherit attrs default ;
6178 permittedInsecurePackages = builtins.map (attr: pkgs.\$ {attr}.name) (
6279 builtins.filter (attr: (pkgs.\$ {attr}.meta.insecure)) attrs
6380 );
@@ -69,6 +86,10 @@ nix-instantiate -I "nixpkgs=$NIXPKGS_PIN_FILE" --eval --strict --json -E "
6986}:
7087
7188{
89+ # "default" OpenSSL release line, should be kept in sync with the bundled version:
90+ openssl = pkgs.\(.default);
91+
92+ # Other OpenSSL variants we want to test for:
7293 inherit (pkgs)
7394 \(.attrs | sort | join("\n "))
7495 ;
0 commit comments