Skip to content

[eas-cli] clean up error handling in local builds - #4105

Open
douglowder wants to merge 3 commits into
mainfrom
doug/eng-25508-local-build-fix
Open

[eas-cli] clean up error handling in local builds#4105
douglowder wants to merge 3 commits into
mainfrom
doug/eng-25508-local-build-fix

Conversation

@douglowder

Copy link
Copy Markdown
Contributor

Why

Because all parameters were being passed to a local build as arguments, any error would cause all the parameters to be written to stderr as a large base64 string. This led to usability (error message awkward to read) and security (leaked credentials) issues.

How

  • Pass the build input parameters in the environment instead of arguments
  • After extract them in the build function, remove them from the environment so they are not inherited by spawned subprocesses
  • If an error occurs, surface an allowed list of known values in the input, to help with debugging

Test Plan

  • Tested locally in an EAS project
  • New unit tests added

douglowder and others added 2 commits July 28, 2026 12:47
eas build --local base64-encoded the job (which contains build
credentials) and passed it as a command-line argument to
eas-cli-local-build-plugin. On failure, @expo/spawn-async includes the
command line in its error message, leaking the credentials to stderr;
they were also visible in the process list.

Pass the payload via the EAS_LOCAL_BUILD_PLUGIN_INPUT environment
variable instead. The plugin reads it and deletes it from the
environment immediately so build subprocesses do not inherit it, and the
debug command dump redacts it. Only affects eas build --local; cloud and
git-based (INTERNAL) builds do not use this path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
On a failed eas build --local, surface an allowlisted summary (platform,
build profile, workflow, versions, package manager, project root, git
commit + dirty flag, fingerprint, tracking/project IDs) to help debug the
failure. Only known-safe fields are logged — never the raw job/metadata,
which carries build credentials.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jul 28, 2026

Copy link
Copy Markdown

ENG-25508

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions

Copy link
Copy Markdown

✅ Thank you for adding the changelog entry!

@douglowder
douglowder marked this pull request as ready for review July 28, 2026 21:38
@github-actions

Copy link
Copy Markdown

Subscribed to pull request

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

Generated by CodeMention

Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead.

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.22%. Comparing base (76d8ea2) to head (08ebf17).

Files with missing lines Patch % Lines
packages/eas-cli/src/build/local.ts 90.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4105      +/-   ##
==========================================
+ Coverage   62.15%   62.22%   +0.07%     
==========================================
  Files         993      993              
  Lines       44658    44674      +16     
  Branches     9403     9406       +3     
==========================================
+ Hits        27754    27793      +39     
+ Misses      15455    15432      -23     
  Partials     1449     1449              

☔ View full report in Codecov by Harness.
📢 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.

@wschurman
wschurman removed their request for review July 28, 2026 22:11

Copy link
Copy Markdown
Member

deferring to other reviewers more familiar with builds on this

Copy link
Copy Markdown
Contributor Author

Adding @szdziedzic since he also has worked on the local build plugin (even before it moved here)

@douglowder
douglowder requested a review from szdziedzic July 28, 2026 22:41
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.

2 participants