Closed elbrujohalcon closed 3 years ago
Should we change rlx_tar:maybe_include_erts/4 to just use filename:join([OutputDir, "erts-" ++ ErtsVersion]) if it exists
Isn't that what the code you link to https://github.com/erlware/relx/blob/5a9f6ebbc30244d281d8e99aa3c9295b75efa975/src/rlx_tar.erl#L77-L94 already doing?
No, it's not. It's missing this file replacement… https://github.com/erlware/relx/blob/5a9f6ebbc30244d281d8e99aa3c9295b75efa975/src/rlx_assemble.erl#L655-L657
Because the evaluation goes through the last case there… https://github.com/erlware/relx/blob/5a9f6ebbc30244d281d8e99aa3c9295b75efa975/src/rlx_tar.erl#L92-L93
Yes, I see now, sorry about that, you are right, if it is a string it needs to be still the dir in OutputDir just like if the value were true
.
Using
relx
throughrebar3
…Theory
If you have a path for your
erts
(i.e.{include_erts, "path/to/erts"}
) in your Relx configuration, when building a release (i.e.rebar3 release
), relx will correctly replace theerl
script withdyn_erl
, but… when it needs to put that release in a tar (i.e.rebar3 tar
), it will not. You'll end up with the originalerl
script that’s in yourerts
folder.Evidence
rlx_assemble
to apply that change (i.e. usedyn_erl
here); but…rlx_tar
is effectively overriding that change when callingsystools
here by settingerts
to the original folder.Questions
rlx_tar:maybe_include_erts/4
to just usefilename:join([OutputDir, "erts-" ++ ErtsVersion])
if it exists, based on the fact that it should’ve been already generated byrebar3 release
, even if just as a copy of the original path frominclude_erts
?