From 909f97aa958b6df4ed14d746a076290c047e6c0f Mon Sep 17 00:00:00 2001 From: FireFragment <55660550+FireFragment@users.noreply.github.com> Date: Tue, 28 May 2024 19:57:18 +0200 Subject: [PATCH] Disable openssl test on too old nixpkgs There on nixpkgs 22 and lower, there is too old Rust to build OpenSSL --- test/fast/openssl/default.nix | 35 ++++++++++++++++++++++++++++++----- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/test/fast/openssl/default.nix b/test/fast/openssl/default.nix index 3c2293d..87acbf4 100644 --- a/test/fast/openssl/default.nix +++ b/test/fast/openssl/default.nix @@ -1,8 +1,33 @@ # OpenSSL needs `pkg-config` and `openssl` buildInputs. This tests whether we correctly supply them automatically. -{ naersk, ... }: +{ naersk, pkgs, ... }: -naersk.buildPackage { - src = ./fixtures; - doCheck = true; -} +let + # Whether the nixpkgs is version 23 or newer, because in older nixpkgs, rustc is too old to build openssl. + buildIt = with pkgs.lib; + (strings.toInt ((builtins.elemAt (splitString "." trivial.version) 0)) >= 23); +in + +if buildIt then + naersk.buildPackage { + src = ./fixtures; + doCheck = true; + } +else + builtins.trace '' + Not building OpenSSL test, because Rust from nixpkgs under major version 23 cannot build OpenSSL + Current nixpkgs version: ${pkgs.lib.trivial.version} + '' + + pkgs.stdenv.mkDerivation { + name = "not-building-openssl-test"; + + dontUnpack = true; + + buildPhase = '' + echo Not building OpenSSL test, because Rust from nixpkgs under major version 23 cannot build OpenSSL + echo Current nixpkgs version: ${pkgs.lib.trivial.version} + ''; + + installPhase = "mkdir $out"; + }