erlware / relx

Sane, simple release creation for Erlang
http://erlware.github.io/relx
Apache License 2.0
697 stars 232 forks source link

Prepare *.beam to be writeable before strip #825

Closed jechol closed 3 years ago

jechol commented 4 years ago

Nix Erlang distribution where all installed erlang files are readonly, just copying to release folder causes permission error when trying to strip.

This PR ensures all *.beam files inside release are writeable before trying to to strip.

tsloughter commented 3 years ago

I don't like the extra iteration of all files but I guess there is no way around it. Unless there is a way to set the mode when copying...

ferd commented 3 years ago

Wouldn't we in theory need to revert the status back after that back to what it was? Does keeping the write mode change anything once in a tarball or something?

tsloughter commented 3 years ago

Not sure what you mean. should be no reason to revert the mode back to read-only.

jechol commented 3 years ago

Wouldn't we in theory need to revert the status back after that back to what it was? Does keeping the write mode change anything once in a tarball or something?

I think it would be okay as long as extracted .beam have read permission. This PR only ensures that .beam are writeable to strip, and doesn't change read permission.

tsloughter commented 3 years ago

Doesn't it? 0600 is read/write, right? But they have to be readable anyway, why else have them in a release, so not an issue.

ferd commented 3 years ago

Yeah my concern was more about leaving them writeable when they weren't.

jechol commented 3 years ago

@ferd

I assume this issue only happens for Nix. Nix changes file mode for installed package files to read-only. For other environments, packages file mode is untouched(read-write) so that copied beam files are also read-write.

jechol commented 3 years ago

PR is changed to revert file mode after strip. Please review again.

jechol commented 3 years ago

@tsloughter Can you review this again?