Skip to content

toolchain: defer driver materialization for runtime-only builds#56

Closed
dank-openai wants to merge 1 commit into
mainfrom
dank-spr/chilirt-runtime-only-xls-toolchain
Closed

toolchain: defer driver materialization for runtime-only builds#56
dank-openai wants to merge 1 commit into
mainfrom
dank-spr/chilirt-runtime-only-xls-toolchain

Conversation

@dank-openai

@dank-openai dank-openai commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator

Problem Solved

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

Stack:

⚠️ Part of a stack created by spr-multicommit. Do not merge manually using the UI - doing so may have unexpected results.

@dank-openai dank-openai requested a review from meheff April 10, 2026 19:09
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:chilirt-runtime-only-xls-toolchain
@dank-openai dank-openai force-pushed the dank-spr/chilirt-runtime-only-xls-toolchain branch from 7b802d5 to 54fa80c Compare April 10, 2026 19:09
@dank-openai dank-openai deleted the dank-spr/chilirt-runtime-only-xls-toolchain branch April 10, 2026 19:15
@dank-openai

dank-openai commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #57

@dank-openai dank-openai removed the request for review from meheff April 10, 2026 19:24
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