fix: only substitute ERTS for escript builds in rebar3Relx (#266215)

* fix: only substitute ERTS for escript builds in rebar3Relx

Previously beamPackages.rebar3Relx substituted references to erlang
for all builds, which only works for escript builds.

Fixes #261354

* doc: add comment mentioning fixed issue
This commit is contained in:
outfoxxed 2023-11-09 08:39:30 -08:00 committed by GitHub
parent a1e93cb97d
commit 9b1c922663
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -84,7 +84,8 @@ let
runHook postInstall
'';
postInstall = ''
# Release will generate a binary which will cause a read null byte failure, see #261354
postInstall = lib.optionalString (releaseType == "escript") ''
for dir in $out/rel/*/erts-*; do
echo "ERTS found in $dir - removing references to erlang to reduce closure size"
for f in $dir/bin/{erl,start}; do