Skip to content

Always copy files as writable #15386

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

Merged
merged 1 commit into from
Oct 28, 2021
Merged

Always copy files as writable #15386

merged 1 commit into from
Oct 28, 2021

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Oct 28, 2021

Use chmod to ensure that any copied files are writable. I tried using
copyfile which avoids copying permissions altogether by we have some
files (e.g. sdl2-config) which are executable so we need to preserve
at least some permissions.

This can be importantant in install_system_headers which copies files
from the emscripten directory (which may be read only) in the cache
directory. In this case we don't want the resulting files in the cache
to also be read only.

Fixes: #15374

Use `chmod` to ensure that any copied files are writable. I tried using
`copyfile` which avoids copying permissions altogether by we have some
files (e.g. `sdl2-config`) which are executable so we need to preserve
at least some permissions.

This can be importantant in `install_system_headers` which copies files
from the emscripten directory (which may be read only) in the cache
directory. In this case we don't want the resulting files in the cache
to also be read only.

Fixes: #15374
@sbc100
Copy link
Collaborator Author

sbc100 commented Oct 28, 2021

Split out from the larger attempt: #15384

@sbc100 sbc100 requested a review from kripken October 28, 2021 18:40
@sbc100 sbc100 enabled auto-merge (squash) October 28, 2021 19:59
@sbc100 sbc100 merged commit 102274e into main Oct 28, 2021
@sbc100 sbc100 deleted the copy_writable branch October 28, 2021 20:08
sbc100 added a commit to sbc100/emscripten that referenced this pull request May 23, 2025
The resulting header tree need to be at least user-writable so that
we can incrementally copy files into it, adding new files and also
updating previously copied ones.

Sadly, python's shutil doesn't seem to have any options for disabling
the copying of mode bits.

This was originally fixed in emscripten-core#15386 but then regressed in emscripten-core#23417.

Fixes: emscripten-core#24404
sbc100 added a commit to sbc100/emscripten that referenced this pull request May 23, 2025
The resulting header tree need to be at least user-writable so that
we can incrementally copy files into it, adding new files and also
updating previously copied ones.

Sadly, python's shutil doesn't seem to have any options for disabling
the copying of mode bits.

This was originally fixed in emscripten-core#15386 but then regressed in emscripten-core#23417.

Fixes: emscripten-core#24404
sbc100 added a commit to sbc100/emscripten that referenced this pull request May 23, 2025
The resulting header tree need to be at least user-writable so that
we can incrementally copy files into it, adding new files and also
updating previously copied ones.

Sadly, python's shutil doesn't seem to have any options for disabling
the copying of mode bits.

This was originally fixed in emscripten-core#15386 but then regressed in emscripten-core#23417.

Fixes: emscripten-core#24404
sbc100 added a commit that referenced this pull request May 23, 2025
The resulting header tree need to be at least user-writable so that we
can incrementally copy files into it, adding new files and also updating
previously copied ones.

Sadly, python's shutil doesn't seem to have any options for disabling
the copying of mode bits.

This was originally fixed in #15386 but then regressed in #23417.

Fixes: #24404
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.

Caching from a read-only base folder is impossible due to safe_copy copying the permissions bits
2 participants