Open
Conversation
Fixes elixir-desktop/desktop-example-app#31 The strip command modifies files in-place and fails with 'Permission denied' when files (e.g. .so NIF libraries) have read-only permissions. Ensure the file is writable with File.chmod! before running strip, matching the pattern already used in file_replace/3. Co-authored-by: Dominic Letz <dominicletz@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes elixir-desktop/desktop-example-app#31
On macOS, the
stripcommand fails with "Permission denied" when processing.sofiles (e.g. NIF libraries likeasn1rt_nif.so) that have read-only permissions.stripmodifies files in-place and requires write access.Changes
File.chmod!(file, Bitwise.bor(File.lstat!(file).mode, 0o200))before runningstripinstrip_symbols/1file_replace/3in the same modulestrip_symbols/1to avoid duplicating the chmod call across the three strip branchesTesting
The fix follows the existing
file_replace/3pattern which already usesFile.chmod!to ensure files are writable before modification.