beamPackages.mixReleaseSetupHook: restore postFixup behavior and maintain perms

By moving to preFixup we exposed a bug where permissions, critically execute bit, were not maintained. This caused our logic to do the initial stripping of erlang store paths. Restore the original behavior by running these as postFixup, and also fix the bug by maintaining perms if we do indeed strip here.
This commit is contained in:
Adam C. Stephens
2026-09-29 11:28:19 -04:00
parent b99e257dd8
commit 7ef2bbcf98

View File

@@ -54,6 +54,7 @@ mixReleaseRemoveErlangReferences() {
# use bbe to substitute strings in binary files, because using substituteInPlace
# on binaries will raise errors
bbe -e "s|${erlang}/lib/erlang|$out|" -o "$file".tmp "$file"
chmod --reference="$file" "$file".tmp
rm -f "$file"
mv "$file".tmp "$file"
done
@@ -75,11 +76,11 @@ mixReleaseStripDebugHook() {
}
if [ -z "${dontMixReleaseFixup-}" ]; then
preFixupHooks+=(mixReleaseFixupHook)
postFixupHooks+=(mixReleaseFixupHook)
fi
if [ -n "${removeCookie-1}" ]; then
preFixupHooks+=(mixReleaseRemoveCookieHook)
postFixupHooks+=(mixReleaseRemoveCookieHook)
fi
if [ -n "${stripDebug-}" ]; then