Skip to content

Fix sysroot installation when emscripten itself is read-only #24405

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
May 23, 2025

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented 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

@sbc100 sbc100 requested a review from kripken May 23, 2025 19:01
@sbc100
Copy link
Collaborator Author

sbc100 commented May 23, 2025

It seems like constructing a test for this would be tricky... do you think we can land this without a test? I verified it works locally with a read-only root-owned copy of emscripten.

@sbc100
Copy link
Collaborator Author

sbc100 commented May 23, 2025

I guess we need to add tests since this already regressed once.

Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A test sounds good.

@Technius
Copy link

I confirmed on my machine that this patch fixes the original issue I encountered.

@sbc100 sbc100 force-pushed the fix_readonly_install branch from 678fcfe to 2f87928 Compare May 23, 2025 21:29
@sbc100
Copy link
Collaborator Author

sbc100 commented May 23, 2025

I found a way to test this. Confirmed that the test fails without this change.

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 sbc100 force-pushed the fix_readonly_install branch from 2f87928 to f4d358d Compare May 23, 2025 21:57
@sbc100 sbc100 merged commit 6f615f5 into emscripten-core:main May 23, 2025
22 of 30 checks passed
@sbc100 sbc100 deleted the fix_readonly_install branch May 23, 2025 22:40
@Technius
Copy link

@sbc100 Thank you for the prompt fix!

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.

When EM_CACHE is overridden, Permission Denied crash occurs when installing system headers
3 participants