Skip to content

Commit

Permalink
Cut loading time deps of the import macro (#1177)
Browse files Browse the repository at this point in the history
Co-authored-by: UebelAndre <github@uebelandre.com>
  • Loading branch information
hlopko and UebelAndre committed Mar 8, 2022
1 parent 1b1f21a commit e5fefdc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion util/import/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit e5fefdc

Please sign in to comment.