Skip to content

[eas cli] Tar creation on windows: force the owner write bit on for directories#3489

Open
sswrk wants to merge 2 commits intomainfrom
szymonswierk/tarball-creation-windows-force-write-bit-on-for-directories
Open

[eas cli] Tar creation on windows: force the owner write bit on for directories#3489
sswrk wants to merge 2 commits intomainfrom
szymonswierk/tarball-creation-windows-force-write-bit-on-for-directories

Conversation

@sswrk
Copy link
Contributor

@sswrk sswrk commented Mar 10, 2026

Why

When a directory is set as read-only in NTFS, this works different than read-only directory in POSIX – read-only directory in Windows doesn't stop you from creating files inside it. In POSIX, read-only directory means that you can't create files in that directory. Now, when we're creating a tar in Windows, Node.js sees the mode of read-only directories as 0o555. When extracting this tar on a worker, we're seeing an error because it's forbidden to create files in such directory.

Alternative to #3234
Fixes #3319

How

Conditionally add the onWriteEntry hook on tar creation when the OS is Windows. The hook forces the owner write bit on for directories.

Test Plan

I tested the fix in Windows 11. First, I attempted to run a build with nested read-only directories in my project. This has failed on extracting the tar in the worker. Then I tried with the changes from this PR applied, the build has succeeded.

@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 53.38%. Comparing base (f3fd05d) to head (aa912d3).

Files with missing lines Patch % Lines
packages/eas-cli/src/build/utils/repository.ts 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3489      +/-   ##
==========================================
- Coverage   53.39%   53.38%   -0.00%     
==========================================
  Files         813      813              
  Lines       34438    34442       +4     
  Branches     7151     7153       +2     
==========================================
  Hits        18384    18384              
- Misses      15972    15976       +4     
  Partials       82       82              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link

✅ Thank you for adding the changelog entry!

@sswrk sswrk marked this pull request as ready for review March 10, 2026 11:13
@github-actions
Copy link

Subscribed to pull request

File Patterns Mentions
**/* @douglowder
packages/eas-cli/src/build/** @sjchmiela

Generated by CodeMention

@sswrk sswrk requested review from douglowder and kitten March 10, 2026 11:13
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.

Expo EAS build "tar: ... " Cannot open: Permission denied

2 participants