diff --git a/util/import/BUILD.bazel b/util/import/BUILD.bazel index 54a060bac1..7cb0395cde 100644 --- a/util/import/BUILD.bazel +++ b/util/import/BUILD.bazel @@ -47,11 +47,19 @@ alias( name = "import", actual = select({ ":use_fake_import_macro": ":fake_import_macro_impl", - "//conditions:default": ":import_macro", + "//conditions:default": ":import_macro_label", }), visibility = ["//visibility:public"], ) +# This is there to cut the loading-time dependency on the import macro dependencies +# (so users who don't use the macro don't need to add those deps to their WORKSPACE +# file). Bazel in the loading phase doesn't "see" through `label_flag`. +label_flag( + name = "import_macro_label", + build_setting_default = "import_macro", +) + config_setting( name = "use_fake_import_macro", flag_values = {