beamPackages.elixir: avoid throwing for incompatibility in CI

These asserts should only trigger when a user tries to use that
combination. In CI, they should just not create an attrpath to evaluate.
This commit is contained in:
Wolfgang Walther 2025-07-19 10:21:31 +02:00
parent 9255558c37
commit 093e7390f1
No known key found for this signature in database
GPG Key ID: B39893FA5F65CAE1

View File

@ -1,4 +1,5 @@
{
config,
lib,
stdenv,
fetchFromGitHub,
@ -57,6 +58,8 @@ let
true
else
versionOlder (versions.major (getVersion erlang)) maxShiftMajor;
minAssert = versionAtLeast (getVersion erlang) minimumOTPVersion;
bothAssert = minAssert && maxAssert;
elixirShebang =
if stdenv.hostPlatform.isDarwin then
@ -70,9 +73,11 @@ let
erlc_opts = [ "deterministic" ] ++ optionals debugInfo [ "debug_info" ];
in
assert assertMsg (versionAtLeast (getVersion erlang) minimumOTPVersion) compatibilityMsg;
assert assertMsg maxAssert compatibilityMsg;
if !config.allowAliases && !bothAssert then
# Don't throw without aliases to not break CI.
null
else
assert assertMsg bothAssert compatibilityMsg;
stdenv.mkDerivation {
pname = "${baseName}";