about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorRobert Hensing <roberth@users.noreply.github.com>2024-05-21 00:13:09 +0200
committerGitHub <noreply@github.com>2024-05-21 00:13:09 +0200
commit28df2298ffed6781de881a2ce8cf862245f94e9b (patch)
treeecde69ddaec1ba586e2931e3ee5c6670e6319d80 /pkgs/build-support
parent165f2b48dab777a5b5bac539ddf78b04430f4c90 (diff)
parentbf4d46e338590ffb19bae620e7a7eff64b0baf89 (diff)
Merge pull request #311069 from nbraud/fix-307770
testers.hasPkgConfigModules: fix bug in `versionCheck` handling
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/testers/hasPkgConfigModules/tester.nix4
-rw-r--r--pkgs/build-support/testers/hasPkgConfigModules/tests.nix7
2 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/build-support/testers/hasPkgConfigModules/tester.nix b/pkgs/build-support/testers/hasPkgConfigModules/tester.nix
index b8ae884ba7b0f..e9f246deaaf20 100644
--- a/pkgs/build-support/testers/hasPkgConfigModules/tester.nix
+++ b/pkgs/build-support/testers/hasPkgConfigModules/tester.nix
@@ -45,7 +45,7 @@ runCommand testName {
         if [[ "$moduleVersion" == "$version" ]]; then
           echo "✅ pkg-config module $moduleName exists and has version $moduleVersion"
         else
-          echo "❌ pkg-config module $moduleName exists and has version $moduleVersion when $version was expected"
+          echo "${if versionCheck then "❌" else "ℹ️"} pkg-config module $moduleName exists at version $moduleVersion != $version (drv version)"
           ((versionMismatch+=1))
         fi
         printf '%s\t%s\n' "$moduleName" "$version" >> "$out"
@@ -55,7 +55,7 @@ runCommand testName {
       fi
     done
 
-    if [[ $notFound -eq 0 ]] && ([[ $versionMismatch -eq 0 ]] || [[ "$versionCheck" == false ]]); then
+    if [[ $notFound -eq 0 ]] && ([[ $versionMismatch -eq 0 ]] || [[ -z "$versionCheck" ]]); then
       exit 0
     fi
     if [[ $notFound -ne 0 ]]; then
diff --git a/pkgs/build-support/testers/hasPkgConfigModules/tests.nix b/pkgs/build-support/testers/hasPkgConfigModules/tests.nix
index bf992d040b4b3..adad935079849 100644
--- a/pkgs/build-support/testers/hasPkgConfigModules/tests.nix
+++ b/pkgs/build-support/testers/hasPkgConfigModules/tests.nix
@@ -11,10 +11,15 @@ lib.recurseIntoAttrs {
 
   miniz-versions-mismatch = testers.testBuildFailure (testers.hasPkgConfigModules {
     package = miniz;
-    version = "1.2.3";
+    version = "1.2.3";  # Deliberately-incorrect version number
     versionCheck = true;
   });
 
+  miniz-no-versionCheck = testers.hasPkgConfigModules {
+    package = miniz;
+    version = "1.2.3";  # Deliberately-incorrect version number
+  };
+
   zlib-has-zlib = testers.hasPkgConfigModules {
     package = zlib;
     moduleNames = [ "zlib" ];