bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.27k stars 4.08k forks source link

cc_configure_extension no longer available in @@bazel_tools//tools/cpp:cc_configure.bzl #24426

Open weedless opened 1 day ago

weedless commented 1 day ago

Description of the bug:

The module extension _cc_configureextension has been removed from cc_configure.bzl. Many modules in bazel central registry (re2, abseil-cpp, blake3, ...) are referencing this, making the change non-backwards compatible.

Which category does this issue belong to?

Loading API

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Use bazel revision 8.0.0rc2. Setup a MODULE.bazel with dependencies to re2, abseil-cpp, or blake3. Run "bazel mod graph"

Which operating system are you running Bazel on?

linux

What is the output of bazel info release?

release 8.0.0rc2

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

-

What's the output of git remote get-url origin; git rev-parse HEAD ?

-

If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

1c4e78a9ceab9794140324d64833c628e382a3da

Have you found anything relevant by searching the web?

No

Any other information, logs, or outputs that you want to share?

No response

fmeum commented 1 day ago

@meteorcloudy It looks like these modules mostly rely on it for CI purposes and should have marked it a dev dependency. We could also add a forwarder and live with the extension being evaluated twice.

fmeum commented 1 day ago

@bazel-io flag

meteorcloudy commented 20 hours ago

Yeah, I also realized this and I'm sending an internal fix for abseil-cpp.

I believe those are all needed for selecting toolchain on Windows, like --extra_toolchains=@local_config_cc//:cc-toolchain-arm64_windows. All of them should migrate to use local_config_cc from rules_cc instead.

https://github.com/bazelbuild/bazel/blob/572ff083d105c0fd05a025432318d3c102954cab/MODULE.bazel#L300-L302

And it's actually not easy to make it backwards compatible since there is no way to create an alias of cc_configure_extension from bazel_tools to rules_cc.

fmeum commented 20 hours ago

And it's actually not easy to make it backwards compatible since there is no way to create an alias of cc_configure_extension from bazel_tools to rules_cc.

While we can't create an alias, we could duplicate the extension by reexporting from a .bzl file in bazel_tools. It will be considered a distinct extension and thus duplicate work, but it could ensure backwards compatibility.

meteorcloudy commented 20 hours ago

OK, maybe that's better. I'll send a change internally to speed this up. /cc @Wyverald

meteorcloudy commented 20 hours ago

@bazel-io fork 8.0.0

meteorcloudy commented 20 hours ago

Urh.. @rules_cc//cc:extensions.bzl needs to load bazel_features, this actually breaks cc_configure for WORKSPACE use cases because bazel_features is no where to be found..

https://buildkite.com/bazel/google-bazel-presubmit/builds/86793#_

I guess we have to bite the bullet to fix those modules..