Skip to content

fix: add linux-x64-baseline and win32-x64-baseline target mappings to build script - #1255

Closed
err0x420 wants to merge 1 commit into
CodebuffAI:mainfrom
err0x420:main
Closed

fix: add linux-x64-baseline and win32-x64-baseline target mappings to build script#1255
err0x420 wants to merge 1 commit into
CodebuffAI:mainfrom
err0x420:main

Conversation

@err0x420

@err0x420 err0x420 commented Sep 3, 2026

Copy link
Copy Markdown

Re-opening PR #814 following the repository history rewrite, as requested by maintainers.

Summary

Adds the missing 'linux-x64-baseline' and 'win32-x64-baseline' target mappings to cli/scripts/build-binary.ts. This allows the build pipeline to properly resolve and output baseline binaries for older x86-64 CPUs on both Linux and Windows.

Details & Verification

  • Target Mappings: Adds both 'linux-x64-baseline' (mapping to 'bun-linux-x64-baseline') and 'win32-x64-baseline' (mapping to 'bun-windows-x64-baseline') under getTargetInfo().
  • Bun Compatibility: Per Bun's Executables Documentation, bun-linux-x64-baseline and bun-windows-x64-baseline are valid compile targets (accepted for backward compatibility and mapped to x64 Nehalem/SSE4.2 baseline targets).
  • Client Fallback: The CLI client runtime (index.js) already expects freebuff-linux-x64-baseline.tar.gz and freebuff-win32-x64-baseline.tar.gz artifacts when fallback triggers or FREEBUFF_BINARY_TARGET is set. Without these mappings in build-binary.ts, getTargetInfo() throws an unsupported target error during the build phase.

Related Context & Issues

Adds missing linux-x64-baseline mapping to enable non-AVX baseline builds.
@codebuff-team

Copy link
Copy Markdown
Contributor

This is a small, targeted change that adds linux-x64-baseline and win32-x64-baseline entries to getTargetInfo() in cli/scripts/build-binary.ts, matching the pattern of existing entries (linux-x64, win32-x64, etc.). The rationale is credible: the runtime fallback logic in index.js already expects a freebuff-linux-x64-baseline.tar.gz artifact, so without this mapping the build script can't produce it, referencing issue #797.

A few things worth checking before porting:

  • The PR title/summary only mention linux-x64-baseline, but the diff also adds win32-x64-baseline. Please update the description to cover both, since a reviewer skimming the summary would miss half the change.
  • No test or build verification is shown - it'd help to confirm these bun targets (bun-linux-x64-baseline, bun-windows-x64-baseline) are valid Bun compile targets and that CI can actually produce these artifacts, since a typo here would fail silently until someone tries to build for baseline CPUs.
  • Given this references two prior PRs (fix: add linux-x64-baseline target to build script #814, linux-x64-baseline target still contains AVX instructions, causing SIGILL on older CPUs (SSE4.1 only) #797), it'd be useful to link what discussion happened there so the maintainer porting this doesn't have to reconstruct context from scratch.

Overall the change itself is small, in-scope, and plausible - worth a maintainer's time to verify against the actual Bun target list and port.

@codebuff-team codebuff-team added bot:triaged Classified by the community triage bot pr:port-candidate Worth porting into the private source tree labels Sep 4, 2026
@err0x420 err0x420 changed the title fix: add linux-x64-baseline target mapping to build script fix: add linux-x64-baseline and win32-x64-baseline target mappings to build script Sep 5, 2026
@err0x420

err0x420 commented Sep 5, 2026

Copy link
Copy Markdown
Author

Hi @codebuff-team!

After confirming the upstream Bun engine constraints, I’m going to close this PR.

Even with baseline targets, Bun-compiled binaries target the Nehalem (SSE4.2) microarchitecture as their absolute baseline. As a result, CPUs limited to SSE4.1, such as the Core 2 Quad Yorkfield, still raise SIGILL at the Bun runtime level.

Therefore, mapping the baseline targets in build-binary.ts would not resolve SSE4.1 compatibility without changes to Bun upstream.

Thanks for taking the time to review this PR and for the helpful feedback!

@err0x420 err0x420 closed this Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:triaged Classified by the community triage bot pr:port-candidate Worth porting into the private source tree

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linux-x64-baseline target still contains AVX instructions, causing SIGILL on older CPUs (SSE4.1 only)

2 participants