Skip to content

Commit

Permalink
elixir: use env shebang only on Darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
w committed Jan 10, 2025
1 parent 8f15376 commit 55442f6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pkgs/development/interpreters/elixir/generic-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ let
true
else
versionOlder (versions.major (getVersion erlang)) maxShiftMajor;

elixirShebang =
if stdenv.hostPlatform.isDarwin then
# Darwin disallows shebang scripts from using other scripts as their
# command. Use env as an intermediary instead of calling elixir directly
# (another shebang script).
# See https://github.com/NixOS/nixpkgs/pull/9671
"${coreutils}/bin/env $out/bin/elixir"
else
"$out/bin/elixir";
in
assert assertMsg (versionAtLeast (getVersion erlang) minimumOTPVersion) compatibilityMsg;
assert assertMsg maxAssert compatibilityMsg;
Expand Down Expand Up @@ -104,7 +114,7 @@ stdenv.mkDerivation ({
done
substituteInPlace $out/bin/mix \
--replace "/usr/bin/env elixir" "${coreutils}/bin/env $out/bin/elixir"
--replace "/usr/bin/env elixir" "${elixirShebang}"
'';

pos = builtins.unsafeGetAttrPos "sha256" args;
Expand Down

0 comments on commit 55442f6

Please sign in to comment.