From bd06437b4d20ae8765a306042a279538a29cff2c Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Mon, 21 Jul 2025 17:47:15 +0200 Subject: [PATCH] hare: fix eval without enableCrossCompilation In a `a -> b` construct, when the first condition `a` doesn't apply, the overall result will be `true` - but this immediately fired the `throw` in these cases. Thus `enableCrossCompilation = false` resulted in immediate eval errors. This also fixes eval for CI on darwin, where the assert should not trigger, but instead let `meta.badPlatforms` be evaluated. This then throws an "unsupported system" error, which can be caught properly by CI. --- pkgs/by-name/ha/hare/package.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/by-name/ha/hare/package.nix b/pkgs/by-name/ha/hare/package.nix index 30472742a2a0..b79cd7b8e298 100644 --- a/pkgs/by-name/ha/hare/package.nix +++ b/pkgs/by-name/ha/hare/package.nix @@ -23,8 +23,7 @@ assert inherit (lib) intersectLists platforms concatStringsSep; workingPlatforms = intersectLists platforms.linux (with platforms; x86_64 ++ aarch64 ++ riscv64); in - (enableCrossCompilation -> !(isLinux && is64bit)) - -> builtins.throw '' + lib.assertMsg (enableCrossCompilation -> isLinux && is64bit) '' The cross-compilation toolchains may only be enabled on the following platforms: ${concatStringsSep "\n" workingPlatforms} '';