Skip to content

Fix cffi cdylib build for musl - #4040

Merged
2kai2kai2 merged 1 commit into
canaryfrom
kai/cffi-release
Jul 15, 2026
Merged

2kai2kai2 merged 1 commit into
canaryfrom
kai/cffi-release

Conversation

@2kai2kai2

@2kai2kai2 2kai2kai2 commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

We need to add -crt-static so musl targets don't require static linking of libc

@vercel

vercel Bot commented Jul 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
beps Ready Ready Preview, Comment Jul 15, 2026 7:16pm
promptfiddle Ready Ready Preview, Comment Jul 15, 2026 7:16pm
promptfiddle2 Ready Ready Preview, Comment Jul 15, 2026 7:16pm

Request Review

@2kai2kai2
2kai2kai2 enabled auto-merge July 15, 2026 18:55
@coderabbitai

coderabbitai Bot commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates musl bridge_cffi cdylib builds to forward RUSTFLAGS through cross and disable static CRT, producing dynamically linked .so artifacts for future dlopen smoke testing.

Changes

Musl cdylib build

Layer / File(s) Summary
Forward musl build flags
baml_language/Cross.toml
Adds target-specific RUSTFLAGS passthrough configuration for x86_64 and aarch64 musl builds.
Build dynamic musl cdylibs
.github/workflows/build2-bridge-cffi.reusable.yaml
Applies -C target-feature=-crt-static for musl targets while preserving existing flags, and clarifies musl build and validation notes.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Poem

A rabbit hops where musl winds blow,
Flags pass through, and cdylibs grow.
Static roots are set aside,
A dynamic .so takes stride.
For dlopen tests, ears perk bright!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately summarizes the main change: fixing the cffi cdylib build for musl targets.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kai/cffi-release

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@vercel
vercel Bot temporarily deployed to Preview – beps July 15, 2026 18:56 Inactive
@github-actions

Copy link
Copy Markdown

⏭️ Performance benchmarks were skipped

Perf benchmarks (CodSpeed) are opt-in on pull requests — they no longer run on every push. They always run automatically after merge to canary/main.

To run them on this PR, do any of the following, then push a commit (or re-run CI):

  • Add RUN_CODSPEED=1 to the PR description, or
  • Include run-perf or /perf in the PR title or any commit message.

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 15, 2026 19:03 Inactive
@github-actions

Copy link
Copy Markdown

Binary size checks passed

✅ 7 passed

Artifact Platform File Gzip Gated on Baseline Delta Status
✅ baml-cli Linux 🔒 22.8 MB 9.7 MB file 22.8 MB +54.9 KB (+0.2%) OK
✅ packed-program Linux 🔒 16.3 MB 6.8 MB file 16.3 MB +20.5 KB (+0.1%) OK
✅ baml-cli macOS 🔒 17.6 MB 8.5 MB file 17.5 MB +49.7 KB (+0.3%) OK
✅ packed-program macOS 🔒 12.6 MB 6.0 MB file 12.6 MB +16 B (+0.0%) OK
✅ baml-cli Windows 🔒 19.1 MB 8.7 MB file 18.7 MB +412.2 KB (+2.2%) OK
✅ packed-program Windows 🔒 13.5 MB 6.1 MB file 13.5 MB +4.1 KB (+0.0%) OK
✅ bridge_wasm WASM 15.2 MB 🔒 4.3 MB gzip 4.3 MB +3.6 KB (+0.1%) OK

🔒 = the size this artifact is GATED on (ceiling + delta). Binaries gate on file size (installed binary); WASM gates on gzip (download size). The other size is shown for information only.


Generated by cargo size-gate · workflow run

@2kai2kai2
2kai2kai2 added this pull request to the merge queue Jul 15, 2026
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle July 15, 2026 19:16 Inactive
Merged via the queue into canary with commit 91495a4 Jul 15, 2026
52 checks passed
@2kai2kai2
2kai2kai2 deleted the kai/cffi-release branch July 15, 2026 19:32

This branch was previously deployed

3 inactive deployments
Preview – promptfiddle — 008ed745 Deployed Jul 15, 2026 by vercel[bot]
Preview – promptfiddle2 — 008ed745 Deployed Jul 15, 2026 by vercel[bot]
Preview – beps — 008ed745 Deployed Jul 15, 2026 by vercel[bot]
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.

1 participant