Skip to content

Describe toolchain provider and macro contracts - #940

Draft
tamird wants to merge 9 commits into
bazelbuild:mainfrom
tamird:type-contracts
Draft

tamird wants to merge 9 commits into
bazelbuild:mainfrom
tamird:type-contracts

Conversation

@tamird

@tamird tamird commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Declare C++ toolchain and macro inputs beside their implementations.
Derive the directory tool’s forwarded keywords from cc_tool, so changing
the wrapped macro updates both signatures. Use source comments for Bazel 7.
Export companion interfaces for generic binders, shared provider types
and recursive variable descriptors.

Separate percent escaping for known strings from the compatibility
helper that accepts None. Preserve its existing callers.

Check the implementations and their BUILD callers with the
sty action.
Bazel selects Skylib 1.9.0. Declare the Skylib APIs used here:
bzl_library in BUILD files, directory and build-setting provider
fields in toolchain rules, and path helpers in the compiler and linker.
Check those contracts against the installed sources until
Skylib #641 ships.

Track the private Bazel Features lookup in #960 and the omitted
Objective-C sources in #967.

Prepared with Codex for @tamird.

@tamird
tamird marked this pull request as draft October 16, 2026 15:20
@tamird tamird changed the title Type toolchain configuration providers Describe toolchain provider and macro contracts Oct 18, 2026
@tamird
tamird force-pushed the type-contracts branch 6 times, most recently from d3af802 to 309b721 Compare October 23, 2026 16:50
@tamird
tamird force-pushed the type-contracts branch 3 times, most recently from 7055eae to f351ef1 Compare October 29, 2026 17:19
@tamird
tamird force-pushed the type-contracts branch 3 times, most recently from 396d146 to fdc98f9 Compare November 3, 2026 18:20
Give toolchain configuration, provider collectors and rule helpers typed
inputs and results. Keep simple signatures in their implementations;
represent provider fields and generic functions in companion interfaces.
Export the interfaces for dependent repositories. Run sty on the
implementations and report findings across the remaining Starlark files.
Move four companion declarations into the implementations they describe.
Keep the same strict sources and let the shared action select the
complete advisory inventory.
Declare each macro's inputs at its definition. Derive the directory
tool's forwarded keywords from cc_tool so both macros share one
contract. Check the repository rule at its implementation.

Remove four companion interfaces and their registrations. Document
which generic binders and cross-module types the others require.
Link the three wrapper signatures to the Bazel proposal for deriving
keyword arguments from a wrapped rule.
Identify the native types each exceptional comment needs. Document
the language boundary beside its use.
Follow the repository’s release-tag convention for external actions.
Use the same checkout and checker revisions as the previous workflow.
Set one severity for the eleven strict diagnostics. Let the pinned
checker define the group so an upgrade can extend it without edits to
the project configuration.
Since 60dc620, the root module replaces Skylib with a fork to get
type information. Bazel also uses that fork for ordinary builds.

Declare the build macro, path helpers and two providers against Skylib
1.9.0. Check their signatures against the installed sources. Report
incomplete types in three files from the release while checking their
contracts and callers as errors.
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