@@ -17,7 +17,8 @@ def rules_foreign_cc_dependencies(
1717 register_preinstalled_tools = True ,
1818 register_built_tools = True ,
1919 register_toolchains = True ,
20- register_built_pkgconfig_toolchain = True ):
20+ register_built_pkgconfig_toolchain = True ,
21+ register_repos = True ):
2122 """Call this function from the WORKSPACE file to initialize rules_foreign_cc \
2223 dependencies and let neccesary code generation happen \
2324 (Code generation is needed to support different variants of the C++ Starlark API.).
@@ -59,6 +60,10 @@ def rules_foreign_cc_dependencies(
5960 startup --windows_enable_symlinks -> This is required to enable symlinking to avoid long runfile paths
6061 build --action_env=MSYS=winsymlinks:nativestrict -> This is required to enable symlinking to avoid long runfile paths
6162 startup --output_user_root=C:/b -> This is required to keep paths as short as possible
63+
64+ register_repos: If true, use repository rules to register the required
65+ dependencies. (If you are using bzlmod, you probably do not want to set
66+ this since it will create shadow copies of these repos)
6267 """
6368
6469 register_framework_toolchains (register_toolchains = register_toolchains )
@@ -83,6 +88,9 @@ def rules_foreign_cc_dependencies(
8388 if register_preinstalled_tools :
8489 preinstalled_toolchains ()
8590
91+ if not register_repos :
92+ return
93+
8694 maybe (
8795 http_archive ,
8896 name = "bazel_features" ,
0 commit comments