Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare *.beam to be writeable before strip #825

Merged
merged 3 commits into from
Nov 7, 2020

Conversation

jechol
Copy link
Contributor

@jechol jechol commented Oct 18, 2020

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
Copy link
Member

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
Copy link
Collaborator

ferd commented Oct 19, 2020

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
Copy link
Member

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

@jechol
Copy link
Contributor Author

jechol commented Oct 20, 2020

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
Copy link
Member

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
Copy link
Collaborator

ferd commented Oct 20, 2020

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

@jechol
Copy link
Contributor Author

jechol commented Oct 20, 2020

@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
Copy link
Contributor Author

jechol commented Oct 21, 2020

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

@jechol
Copy link
Contributor Author

jechol commented Nov 5, 2020

@tsloughter Can you review this again?

src/rlx_assemble.erl Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants