rules_xlsynth: split XLS runtime and toolchain bundle surfaces#54
Merged
Conversation
meheff
approved these changes
Mar 27, 2026
Replace the failing bare xlsynth-driver version smoke in GitHub Actions with a direct materialize_xls_bundle.py --surface toolchain proof. This keeps the planned selector split of crate 0.36.0 and DSO 0.40.0, and makes CI exercise the same toolchain/materialization path the branch is intended to support.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem Solved
rules_xlsynthcurrently exposes one mixed repo perxls.toolchain(...)declaration. That makes the runtime surface ambiguous, forces runtime-only consumers to inherit driver/toolchain behavior, and leaves no clean way to export the full nativelibxlsruntime closure oncexlsynthstarts publishing it.This change makes the runtime and toolchain surfaces explicit. The runtime repo becomes the place that downstream consumers depend on for
libxls, stdlib, artifact config, and runtime companions, while the toolchain repo layers the driver and tool registration on top.Mental model
Each
xls.toolchain(name = "...")declaration now materializes two repos:@<name>_runtime@<name>_toolchainThe runtime repo owns the closed native/runtime payload. The toolchain repo consumes that runtime surface and adds
xlsynth-driverplus toolchain registration. Download-backed bundles also learn how to fetch and unpack the optional runtime-closure tarball when the selectedxlsynthrelease provides one.Non-goals
This PR does not publish new
xlsynthrelease assets by itself. It only teaches the rule surface how to consume those assets when they exist.This PR does not preserve the old mixed-surface repo shape as a long-lived compatibility contract.
Tradeoffs
The repo graph becomes more explicit: callers now choose runtime vs toolchain repos directly instead of getting both behaviors from one generated repo. That is a better end state, but it means examples, docs, self-tests, and downstream wiring all need to adopt the split naming.
Download/install resolution also becomes more capable and slightly more complex because runtime-closure assets are optional and version-dependent.
Architecture
extensions.bzlnow fans onexls.toolchain(...)declaration into separate runtime and toolchain repo generators.xls_toolchain.bzlintroduces a runtime-surface provider so runtime consumers can depend on the non-driver payload directly while toolchain consumers still build a composed bundle.materialize_xls_bundle.pysplits runtime-only staging from driver-capable staging, anddownload_release.pylearns how to fetch and unpack the runtime-closure sidecar assets.Examples, README, DESIGN notes, self-tests, and sample BUILD files all move to the explicit
@..._runtimeand@..._toolchainvocabulary.Observability
The generated repo names now make the contract visible in BUILD and MODULE files.
external_bundle_exports_testcontinues to act as the proof that the exported runtime surface contains runtime files but no driver.The workspace-toolchain smoke example still builds against the split surface so downstream breakage is visible through the public examples.
Tests
Validated with
python3 -m unittest artifact_resolution_test download_release_test env_helpers_test,bazel test //:external_bundle_exports_test, andbazel build //examples/workspace_toolchain_smoke:smoke_pipeline.