Skip to content

Fix Rust and C++ release verification regressions#4118

Merged
codeshaunted merged 8 commits into
canaryfrom
fix/rust-cpp-release-verification
Jul 22, 2026
Merged

Fix Rust and C++ release verification regressions#4118
codeshaunted merged 8 commits into
canaryfrom
fix/rust-cpp-release-verification

Conversation

@codeshaunted

@codeshaunted codeshaunted commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • make the canonical C++ variant template compile under MSVC by isolating the nested pack expansion
  • build only the runtime_smoke CMake target so verification does not compile unused full protobuf targets
  • derive Rust verifier runners from the toolchain platform contract, matching the glibc used by shipped CLI artifacts
  • run generated Rust sync calls outside the Tokio runtime while still exercising the async entry point

Fixes the Rust and C++ failures in https://github.com/BoundaryML/baml/actions/runs/29884885305.

Testing

  • actionlint .github/workflows/verify-rust-sdk.reusable.yaml .github/workflows/verify-cpp-sdk.reusable.yaml
  • RUSTC_WRAPPER= cargo test -p baml_release platforms --locked (9 passed)
  • canonical/deduplicated baml::variant C++17 compile smoke
  • configured protobuf 31.1 and built the exact runtime_smoke CMake target
  • pre-commit hooks, including Cargo fmt, Clang format, Clippy, and YAML validation

Summary by CodeRabbit

  • Tests
    • Improved C++ SDK verification by enforcing a 10-minute timeout and explicitly building the runtime_smoke target for Unix/musl/Windows, running the Release binary on Windows.
    • Improved Rust SDK verification by generating the platform matrix dynamically.
    • Enhanced the C++ runtime smoke harness with stronger failure reporting and clearer progress output.
    • Stabilized the Rust consumer smoke entry point by switching to a synchronous main.
  • Refactor
    • Refined internal C++ variant type canonicalization (no behavior change).
  • Chores
    • Updated protobuf FetchContent to align MSVC runtime behavior with downstream consumers.

@vercel

vercel Bot commented Jul 22, 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 22, 2026 6:02am
promptfiddle Ready Ready Preview, Comment Jul 22, 2026 6:02am
promptfiddle2 Ready Ready Preview, Comment Jul 22, 2026 6:02am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 04b870d0-c3d1-4d68-9565-bf90957157ca

📥 Commits

Reviewing files that changed from the base of the PR and between 32cf365 and 828157d.

📒 Files selected for processing (3)
  • .github/workflows/verify-cpp-sdk.reusable.yaml
  • baml_language/sdks/cpp/bridge_cpp/include/baml/detail/loader.h
  • baml_language/sdks/cpp/bridge_cpp/tests/runtime_smoke.cc

📝 Walkthrough

Walkthrough

C++ SDK smoke builds explicitly select runtime_smoke across platforms, use updated runtime loading and failure reporting, and align protobuf linkage. Rust verification derives its matrix from release metadata, adds an MSRV entry, and uses a manually constructed Tokio runtime.

Changes

SDK verification

Layer / File(s) Summary
C++ runtime verification
.github/workflows/verify-cpp-sdk.reusable.yaml, baml_language/sdks/cpp/bridge_cpp/tests/run.sh, baml_language/sdks/cpp/bridge_cpp/tests/runtime_smoke.cc
C++ verification explicitly builds runtime_smoke on supported environments, enforces a 10-minute timeout, and reports smoke-test progress while replacing assertions with runtime checks.
C++ runtime compatibility
baml_language/sdks/cpp/bridge_cpp/include/baml/detail/loader.h, baml_language/sdks/cpp/bridge_cpp/cmake/fetch_protobuf.cmake, baml_language/sdks/cpp/bridge_cpp/include/baml/variant.h
The loader uses platform-specific symbol resolution, protobuf uses the dynamic MSVC runtime, and canonical variant type aliases are reused during type construction.
Dynamic Rust verification matrix
.github/workflows/verify-rust-sdk.reusable.yaml
A platform-matrix job derives eligible Linux and macOS targets from release/platforms.json, adds the Rust 1.91.1 MSRV entry, and supplies the matrix to verify.
Synchronous Rust consumer runtime
baml_language/sdks/rust/verify/consumer_main.rs
The consumer changes to synchronous main and executes rt_int_async with a current-thread Tokio runtime and block_on.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant platform_matrix
  participant platforms_json
  participant verify
  participant consumer_main
  platform_matrix->>platforms_json: Read release platform metadata
  platforms_json-->>platform_matrix: Return eligible verification entries
  platform_matrix->>verify: Supply JSON matrix
  verify->>consumer_main: Run Rust consumer checks
  consumer_main->>consumer_main: block_on rt_int_async
Loading

Possibly related PRs

  • BoundaryML/baml#4004: Modifies the C++ SDK verification workflow and runtime_smoke build/run steps.
  • BoundaryML/baml#4033: Introduces the Rust bridge verification flow extended by the dynamic matrix changes.
  • BoundaryML/baml#4041: Defines the versioned CFFI function-table ABI used by the updated C++ loader.

Poem

A bunny builds smoke tests bright,
Through Unix, musl, Windows night.
Rust hops through matrices anew,
Tokio runs its task right through.
Hoppy reviews make SDKs glow!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: fixing Rust and C++ release verification regressions.
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.
✨ 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 fix/rust-cpp-release-verification

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Checkov (3.3.8)
.github/workflows/verify-cpp-sdk.reusable.yaml

Traceback (most recent call last):
File "/usr/local/bin/checkov", line 2, in
from checkov.main import Checkov
ModuleNotFoundError: No module named 'checkov'


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.

@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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/verify-rust-sdk.reusable.yaml:
- Around line 53-54: Add a job-level permissions block to platform-matrix
granting only contents: read, ensuring the job can check out the repository
without inheriting broader token permissions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 27ff2dcc-ab5f-4e56-a410-0deb5b2216a4

📥 Commits

Reviewing files that changed from the base of the PR and between 6951c86 and 5cd63b6.

📒 Files selected for processing (5)
  • .github/workflows/verify-cpp-sdk.reusable.yaml
  • .github/workflows/verify-rust-sdk.reusable.yaml
  • baml_language/sdks/cpp/bridge_cpp/include/baml/variant.h
  • baml_language/sdks/cpp/bridge_cpp/tests/run.sh
  • baml_language/sdks/rust/verify/consumer_main.rs

Comment thread .github/workflows/verify-rust-sdk.reusable.yaml
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

Binary size checks passed

7 passed

Artifact Platform File Gzip Gated on Baseline Delta Status
baml-cli Linux 🔒 25.6 MB 10.8 MB file 25.3 MB +275.0 KB (+1.1%) OK
packed-program Linux 🔒 17.2 MB 7.1 MB file 17.0 MB +153.1 KB (+0.9%) OK
baml-cli macOS 🔒 19.8 MB 9.4 MB file 19.6 MB +231.5 KB (+1.2%) OK
packed-program macOS 🔒 13.4 MB 6.2 MB file 13.2 MB +198.3 KB (+1.5%) OK
baml-cli Windows 🔒 21.3 MB 9.7 MB file 21.1 MB +230.9 KB (+1.1%) OK
packed-program Windows 🔒 14.3 MB 6.3 MB file 14.2 MB +150.5 KB (+1.1%) OK
bridge_wasm WASM 16.3 MB 🔒 4.4 MB gzip 4.4 MB +19.2 KB (+0.4%) 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

@codeshaunted
codeshaunted added this pull request to the merge queue Jul 22, 2026
@codeshaunted
codeshaunted removed this pull request from the merge queue due to a manual request Jul 22, 2026
@codeshaunted
codeshaunted added this pull request to the merge queue Jul 22, 2026
Merged via the queue into canary with commit 4aad907 Jul 22, 2026
247 of 248 checks passed
@codeshaunted
codeshaunted deleted the fix/rust-cpp-release-verification branch July 22, 2026 17:35
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