Unverified Commit 093e7390 authored by Wolfgang Walther's avatar Wolfgang Walther
Browse files

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.
parent 9255558c
Loading
Loading
Loading
Loading
+80 −75
Original line number Diff line number Diff line
{
  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}";