Bzlmod: Built-in modules
Currently, repos like `@bazel_tools` are treated with special status in Bzlmod because they're shipped with Bazel and always visible to every other repo. This makes it harder for us to make sure repo references within `@bazel_tools` work correctly, since it doesn't go through repo mapping like everything else (example: `@rules_cc` needs to be written as `@rules_cc.0.0.1`)
This CL converts such repos into special built-in modules, which are always visible to other modules (i.e. treated as implicit dependencies of every other module), and are loaded specially (i.e. as if there is always an implicit non-registry override on them).
Additionally, we change the default value of --xcode_version_config to be an alias in @bazel_tools. This means that we won't need to deal with weird repo names like https://github.com/bazelbuild/bazel/blob/921d79e9d419508f60cc8a96181f38176ff6be03/.bazelrc#L34
Fixes https://github.com/bazelbuild/bazel/issues/14279.
PiperOrigin-RevId: 447963753
diff --git a/src/create_embedded_tools.py b/src/create_embedded_tools.py
index 9574e6e..b4bb92b 100644
--- a/src/create_embedded_tools.py
+++ b/src/create_embedded_tools.py
@@ -28,6 +28,7 @@
from src.create_embedded_tools_lib import is_executable
output_paths = [
+ ('*MODULE.tools', lambda x: 'MODULE.bazel'),
('*tools/jdk/BUILD.tools', lambda x: 'tools/jdk/BUILD'),
('*tools/build_defs/repo/BUILD.repo',
lambda x: 'tools/build_defs/repo/BUILD'),