Skip to content

Load CcToolchainConfigInfo from rules_cc in cc_toolchain_config.bzl - #2484

Open
TrapsterDK wants to merge 1 commit into
tweag:masterfrom
TrapsterDK:cc-toolchain-config-info
Open

TrapsterDK wants to merge 1 commit into
tweag:masterfrom
TrapsterDK:cc-toolchain-config-info

Conversation

@TrapsterDK

Copy link
Copy Markdown
Contributor

Fixes #2483.

cc_toolchain_config.bzl used the native CcToolchainConfigInfo global in provides. Bazel 9 removed it, so the global is None and loading the file fails with at index 0 of provides, got element of type NoneType, want Provider. This change loads the provider from @rules_cc//cc/toolchains:cc_toolchain_config_info.bzl, which exists in the pinned rules_cc 0.0.15 and in later versions.

tests/cc_toolchain_config adds a build_test that instantiates the rule, so the file gets loaded on every platform, not only Windows.

I checked the same change under Bazel 9.3.1 with rules_cc 0.2.27 in a downstream repo: the build test fails to load without the change and passes with it.

Assisted by Claude.

Bazel 9 removed the native CcToolchainConfigInfo global, so loading
cc_toolchain_config.bzl failed with "at index 0 of provides, got element
of type NoneType, want Provider".

Fixes tweag#2483

Assisted by Claude.
@TrapsterDK
TrapsterDK requested a review from avdv as a code owner November 7, 2026 01:14
TrapsterDK added a commit to devhusdk/rules_dx that referenced this pull request Nov 7, 2026
…loses #8969) (#8976)

The Windows GHC repo loaded @rules_cc//cc:cc_toolchain.bzl, which does not
exist in rules_cc 0.2.27, and rules_haskell's cc_toolchain_config used the
native CcToolchainConfigInfo global, which is None under Bazel 9. Load
cc_toolchain from cc/toolchains, patch rules_haskell to load the provider
from rules_cc (tweag/rules_haskell#2484), and add a Linux build test that
uses the same loads.


Claude-Session: https://claude.ai/code/session_01Xut2hzpb4qWNZKpDCrwUz7

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

cc_toolchain_config.bzl fails to load under Bazel 9: CcToolchainConfigInfo is None

1 participant