toolchain: defer driver materialization for runtime-only builds#57
Merged
Conversation
Problem Solved ChiliRT wheel builds need the XLS runtime files from a registered workspace toolchain without paying the cost of materializing `xlsynth-driver`. Before this change, loading a registered toolchain could still require driver configuration or stage placeholder driver artifacts, which made runtime-only consumers depend on a tool they do not use. Implementation Split the module-extension surface into runtime and toolchain repositories. The runtime repository materializes tools, DSLX stdlib, `libxls`, and runtime metadata without resolving any driver input. The toolchain repository remains loadable metadata until a driver-backed action is built. Real driver actions now materialize `xlsynth-driver` lazily from a declared Bazel action input when the consumer supplied a local or installed driver path. `auto` driver inputs are validated before use and fall back to download-backed materialization when the declared installed driver is not usable. `local_paths` driver materialization requires the configured `local_driver_path` and rejects declared inputs that do not resolve to that file, so placeholder driver files cannot masquerade as real drivers. The registered runtime-only smoke coverage now runs directly from presubmit and checks both halves of the contract: runtime-only builds do not materialize the driver, while explicit missing-driver builds fail with an actionable configuration error. Validation - python3 artifact_resolution_test.py - env BAZELISK_HOME=/tmp/rue-bazelisk-cache python3 run_presubmit.py -k registered - env BAZELISK_HOME=/tmp/rue-bazelisk-cache bazel test //:artifact_resolution_test //:external_bundle_exports_test --test_output=errors - python3 -m py_compile materialize_xls_bundle.py artifact_resolution_test.py registered_toolchain_smoke.py run_presubmit.py pr:runtime-only-xls-toolchain
6090ac5 to
ffadd6b
Compare
meheff
approved these changes
Apr 15, 2026
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
Some builds need the XLS runtime files from a registered workspace
toolchain without paying the cost of materializing
xlsynth-driver. Beforethis change, loading a registered toolchain could still require driver
configuration or stage placeholder driver artifacts, which made runtime-only
consumers depend on a tool they do not use.
Implementation
Split the module-extension surface into runtime and toolchain repositories.
The runtime repository materializes tools, DSLX stdlib,
libxls, and runtimemetadata without resolving any driver input. The toolchain repository remains
loadable metadata until a driver-backed action is built.
Real driver actions now materialize
xlsynth-driverlazily from a declaredBazel action input when the consumer supplied a local or installed driver path.
autodriver inputs are validated before use and fall back to download-backedmaterialization when the declared installed driver is not usable.
local_pathsdriver materialization requires the configured
local_driver_pathand rejectsdeclared inputs that do not resolve to that file, so placeholder driver files
cannot masquerade as real drivers.
The registered runtime-only smoke coverage now runs directly from presubmit and
checks both halves of the contract: runtime-only builds do not materialize the
driver, while explicit missing-driver builds fail with an actionable
configuration error.
Stack: