Skip to content

fix(build): --baseline builds only the baseline target - #51473

Open
amstel8 wants to merge 1 commit into
anomalyco:devfrom
amstel8:baseline-target-filter
Open

amstel8 wants to merge 1 commit into
anomalyco:devfrom
amstel8:baseline-target-filter

Conversation

@amstel8

@amstel8 amstel8 commented Sep 26, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #51472

Type of change

  • Bug fix

What does this PR do?

Both build scripts have a --baseline flag that is supposed to narrow --single down to the baseline target, but the filter for the regular target of the current platform ignored the flag and kept returning true. So --single --baseline built two binaries.

The fix makes the non-baseline branch of the filter return !baselineFlag, so the flag actually selects one target.

This bites on non-AVX Intel Macs: the regular bun-darwin-x64 binary traps with SIGILL there, so building it is wasted time. I hit it while trying to produce a working localcode for a Xeon X5690.

How did you verify your code works?

On that X5690, before the change --single --baseline printed building opencode-darwin-x64 and then building opencode-darwin-x64-baseline. After it prints only building opencode-darwin-x64-baseline, dist/ holds just that directory, and the resulting binary runs on the machine (--version → 1.18.32, the build script's own smoke test passes).

Also confirmed --single without --baseline still picks the regular target, and bun typecheck is clean in packages/opencode and packages/cli.

Screenshots / recordings

n/a, build script only.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Without this change, --baseline still built both the regular and baseline
x64 targets on macOS. On non-AVX Intel Macs (Westmere, X5690), the regular
bun-darwin-x64 target uses AVX2 and crashes with SIGILL. Now --single
--baseline produces only the baseline binary as intended.
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

This branch has not been deployed

No deployments
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.

--single --baseline builds both regular and baseline x64 targets on macOS

1 participant