Repository navigation
sdk%build: support disabling codec in dash-{params,script}, add Bazel configs for portable-set {debug, release} builds, disable default-features within workspace, avoid duplicate cache credential failure - #93
Conversation
|
No actionable comments were generated in the recent review.
|
|
Warning This pull request may have conflicts, please coordinate with the authors of these pull requests. Potential conflicts |
|
✅ Final review complete — no blockers (commit 342dbbb) · triage: normal |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The reviewed range contains no verified correctness, security, or architecture defects. Feature gating preserves the default Cargo behavior and keeps codec-dependent APIs and dependencies aligned; the Bazel portable profiles, toolchain refactor, build-script flag forwarding, lockfile, and cache-header changes are internally consistent. CI has no failures at the captured head, though several build and lint checks remain queued or in progress.
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — This is a broad, cross-cutting build and Rust feature-configuration change spanning Bazel modules, toolchains, Cargo manifests, and conditional compilation, but it does not modify a critical consensus, funds, cryptographic, networking, or storage surface. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort high); agentphase2-reviewer
…`rules_cc`, cross-compile on a given host platform against all known targets (#116) * [1cd3c52] sdk%chore: bump the nightly toolchain past `cfg_select!` stabilization (Kittywhiskers Van Gogh) * [63a06ea] sdk%build(lint): lint Starlark with one pinned buildifier release (Kittywhiskers Van Gogh) * [e2f5860] sdk%fix(lint): anchor `lint_symlinks` to its path, not to `GIT_DIR` (Kittywhiskers Van Gogh) * [ad7ad38] sdk%refac(bazel): define Rust toolchains per host, target and profile (Kittywhiskers Van Gogh) * [07f8d6b] sdk%refac(test): share one Bazel build helper in the smoke test (Kittywhiskers Van Gogh) * [fd48bd5] sdk%build(bazel): cross-compile to Linux from any host (Kittywhiskers Van Gogh) * [aba101d] sdk%test: cross-build every Bazel platform in the smoke test (Kittywhiskers Van Gogh) * [4507652] sdk%build(bazel): patch `toolchains_llvm` to key Darwin flags by target (Kittywhiskers Van Gogh) * [c43b997] sdk%build(bazel): link macOS against conda-forge's universal compiler-rt (Kittywhiskers Van Gogh) * [dc44565] sdk%build(bazel): archive C build scripts with the pinned LLVM's `ar` (Kittywhiskers Van Gogh) * [b1fdaba] sdk%build(bazel): tell clang which ld64 release lld stands in for (Kittywhiskers Van Gogh) * [9bf052c] sdk%build(bazel): cross-compile to macOS from any host (Kittywhiskers Van Gogh) * [3116e23] sdk%build(bazel): fetch a MinGW-w64 sysroot from MSYS2 packages (Kittywhiskers Van Gogh) * [ac90b68] sdk%build(bazel): patch `toolchains_llvm` to add a MinGW target (Kittywhiskers Van Gogh) * [7ecbf22] sdk%build(bazel): patch `rules_cc` to name MinGW executables and DLLs (Kittywhiskers Van Gogh) * [2bc19e3] sdk%build(bazel): cross-compile to Windows against MSYS2's MinGW-w64 (Kittywhiskers Van Gogh) * [6a2cddc] sdk%ci(bazel): cross-build every other platform from each host (Kittywhiskers Van Gogh) Description: ````` ## Motivation As alluded in prior pull requests, Bazel advances one of Base SDK's key objectives, providing FFIs for low level primitives. [base-sdk#93](#93) addressed part of this objective by bringing support for the `portable` flag so that FFIs could decide whether to benefit from more recent ISA extensions or maintain a broad support pool but being able to exercise build combinations were limited to the host and target platforms overlapping. This pull request introduces deterministic cross-compilation support for both portable and standard build configurations using defined sysroot sources for consistency and patches to work around teething pains. ## Additional Information * Depends on #79 * Depends on #85 * Depends on #93 * PyO3 (intended for Python bindings) enables `cfg_select!` after Rust 1.95 (see [PyO3/pyo3#6070](PyO3/pyo3#6070)) and our `nightly` (used for linting) reports that version but the specific revision we use, `2026-02-01`, did _not_ stabilise the macro, that happened in [rust-lang/rust#149783](rust-lang/rust#149783) so we need to bump to `2026-02-24` in for PyO3 to work unmodified. * `toolchains_llvm` determines `libstdc++`, link and archive flags on the host and target platforms together and links `libtool` on Darwin hosts alone. A Linux host targeting macOS was supplied ELF flags that `ld64.lld` refuses, compiled against the LLVM distribution's own `libc++` headers and had no archiver to run. * This has been resolved with patches that determine those parameters based on the _target_ and links `llvm-libtool-darwin` on every host, another patch was needed to pass the sysroot through `-isysroot` as we fix the macOS SDK. * `cc-rs` archives with `ar` and a Linux host has no `ar` for Mach-O, so the build scripts of `blst` and `secp256k1-sys` are pointed at the pinned LLVM's `llvm-ar` through `crate_universe` annotations. * `toolchains_llvm` has no MinGW target. A patch was required to define `windows-x86_64` as `x86_64-w64-mingw32` with `mingw` as its libc and ABI so `rules_cc` recognises it, skips the ELF link flags `lld` would reject and disables `--start-lib`, to avoid rejection by MinGW `lld`. * An additional patch was needed as `rules_cc` does not declare suffixes for a Unix-style toolchain even when targeting Windows, causing build failure. * GCC's driver adds the `pthread` library needed by MinGW but `clang` does not, so it had to be explicitly pointed to so that the static archive takes precedence. `rustc` already does this ([source](https://github.com/rust-lang/rust/blob/58cf8f9c35b355199727627d07ae34a4e2846d67/compiler/rustc_target/src/spec/base/windows_gnu.rs#L65-L70)) ## How Has This Been Tested? ``` just test lint ./maint/lint/lint_bazel.py graph bazel build //contrib/probes/... bazel build --platforms=//bazel:{linux_arm64,macos_x86_64,windows_x86_64} //contrib/probes/... ``` ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional tests - [x] I have made corresponding changes to the documentation - [x] I did not use agentic assistance (i.e. LLMs, AI) except as [disclosed](#agent-disclosure) and can answer questions, comments and concerns without said assistance. I assume authorship of the code submitted. - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ### Agent disclosure Code generated with Claude Code using Fable 5.1, xhigh effort and Opus 5.5, medium effort. Reviewed with Claude Code using Fable 5.1, xhigh effort and Opus 5.5, medium effort. `````
Additional Information
As mentioned in rust-dashcore#1223, currently
dash-paramspulls incodecdespite it not being integral to the crate's functionality, which saddles downstream consumers with otherwise-unwanted packages into the dependency graph. Continuing base-sdk#83, we can now makecodecoptional as it is now underneathdash-primitives(where otherwisecodecis essential to the crate and cannot be turned off).base-sdk#90 consolidated our Bazel workflows to be per-platform workspace-wide rather than per-platform per-workspace to deal with runner contention, in the process we switched to our own self-hosted caches to work around cache thrashing due to the 10GB limit on caches by GitHub (source).
Part of this effort was relying on the Bazel Remote Asset API. Due to a quirk in how authentication headers are sent, the reverse proxy was unhappy with the duplication and dropped the query entirely, resulting in longer-than-expected runner occupation. This has been stepped around by using
--remote_cache_header.As we plan on offering FFIs, the Bazel build configurations need to be split into standard and portable builds, differentiated by
portablefeature enablement and setting build flags to match. A minor patch to our pinnedrules_rustwas required to ensure it was correctly propagated.With the publication of v0.2.0-beta crates in base-sdk#75, a new project board was created for tracking v0.3.x series crates (source). This required a minor update in our workflow automations.
Breaking Changes
None expected.
How Has This Been Tested?
Checklist
Agent disclosure
Code generated with Claude Code using Opus 5.5, medium effort. Reviewed with Codex using GPT-6.1-Sol, medium effort as adversarial review and Claude Code using Fable 5.1, medium effort.