[build-tools] Normalize extracted project permissions - #4287
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4287 +/- ##
==========================================
+ Coverage 64.70% 64.70% +0.01%
==========================================
Files 1048 1048
Lines 48474 48477 +3
Branches 10218 10218
==========================================
+ Hits 31359 31362 +3
Misses 16999 16999
Partials 116 116 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Validated end-to-end on staging with a project archive that records the source asset used during Android prebuild as mode
|
843b77d to
bda3531
Compare
Co-authored-by: abbanmustafa <19319135+abbanmustafa@users.noreply.github.com>
Co-authored-by: abbanmustafa <19319135+abbanmustafa@users.noreply.github.com>
bda3531 to
1bb7a74
Compare
sjchmiela
left a comment
There was a problem hiding this comment.
shall we add some log so it's clear to users we're doing that?
Co-authored-by: abbanmustafa <19319135+abbanmustafa@users.noreply.github.com>
|
Added in 794b7ef: the worker now logs |
|
✅ Thank you for adding the changelog entry! |
Why
A seven-day EAS Build scan found 2,934 Android prebuild failures across 783 accounts and 816 apps with:
The cluster accelerated from 87 events in the preceding week to 2,354 and then 2,934. The project archive can contain source entries that are readable by the producing environment but retain permissions that make them unreadable after extraction by the Unix EAS worker user.
Sanitized Datadog evidence
What changed
After extracting a project archive, normalize its owner permissions with
chmod -R u+rwX. This makes source files readable/writable by the worker and directories traversable, while preserving executable semantics: uppercaseXonly adds execute permission to directories and files that were executable already.This applies at the worker/build-tools boundary, so it also covers archives produced outside the standard EAS CLI packaging path.
Reproduction
3fa68caffails inPREBUILDwith the exactwithAndroidDangerousBaseMod: EACCES: permission deniedsignature after an intentionally malformed archive records one source file as mode000.EACCESafter the current GNU tar extraction command; the added normalization makes the same file readable.tar portable: true. Ordinary Windows packaging normalized all three to readable0644, so generic Windows EAS CLI packaging is not claimed as the root cause.Validation
d00c8de7errored inPREBUILDwith the expectedEACCES.3d8eebfffinished and produced an APK. The worker used the same effective patch at commit843b77d; this PR was subsequently rebased without changing the patch.@expo/build-toolsunit suite: 109 suites, 1,093 tests@expo/build-toolstypecheckAuthor
@AbbanMustafa