diff --git a/antlir/antlir2/antlir2_packager/BUCK b/antlir/antlir2/antlir2_packager/BUCK index ce3937ab8d..f3f755ef4c 100644 --- a/antlir/antlir2/antlir2_packager/BUCK +++ b/antlir/antlir2/antlir2_packager/BUCK @@ -1,5 +1,6 @@ load("//antlir/antlir2/bzl/feature:defs.bzl", "feature") -load("//antlir/bzl:build_defs.bzl", "internal_external", "rust_binary") +load("//antlir/bzl:build_defs.bzl", "rust_binary") +load("//antlir/bzl:internal_external.bzl", "internal_external") oncall("antlir") diff --git a/antlir/antlir2/antlir2_packager/btrfs_packager/BUCK b/antlir/antlir2/antlir2_packager/btrfs_packager/BUCK index 411068dbbf..b66340d5a2 100644 --- a/antlir/antlir2/antlir2_packager/btrfs_packager/BUCK +++ b/antlir/antlir2/antlir2_packager/btrfs_packager/BUCK @@ -1,4 +1,5 @@ -load("//antlir/bzl:build_defs.bzl", "internal_external", "rust_binary") +load("//antlir/bzl:build_defs.bzl", "rust_binary") +load("//antlir/bzl:internal_external.bzl", "internal_external") oncall("antlir") diff --git a/antlir/antlir2/antlir2_working_volume/BUCK b/antlir/antlir2/antlir2_working_volume/BUCK index 2c94c1d9d8..29542d8972 100644 --- a/antlir/antlir2/antlir2_working_volume/BUCK +++ b/antlir/antlir2/antlir2_working_volume/BUCK @@ -1,6 +1,7 @@ # @oss-disable load("@prelude//utils:buckconfig.bzl", "read_bool") -load("//antlir/bzl:build_defs.bzl", "is_facebook", "rust_library") +load("//antlir/bzl:build_defs.bzl", "rust_library") +load("//antlir/bzl:internal_external.bzl", "is_facebook") oncall("antlir") diff --git a/antlir/antlir2/appliance_vm/BUCK b/antlir/antlir2/appliance_vm/BUCK index b2613317a1..b158255bb2 100644 --- a/antlir/antlir2/appliance_vm/BUCK +++ b/antlir/antlir2/appliance_vm/BUCK @@ -1,4 +1,5 @@ -load("//antlir/bzl:build_defs.bzl", "alias", "buck_genrule", "internal_external") +load("//antlir/bzl:build_defs.bzl", "alias", "buck_genrule") +load("//antlir/bzl:internal_external.bzl", "internal_external") oncall("antlir") diff --git a/antlir/antlir2/bzl/configured_alias.bzl b/antlir/antlir2/bzl/configured_alias.bzl index 176e7e5a0f..4d68d2de4f 100644 --- a/antlir/antlir2/bzl/configured_alias.bzl +++ b/antlir/antlir2/bzl/configured_alias.bzl @@ -11,7 +11,8 @@ load("//antlir/antlir2/bzl/image:cfg.bzl", "cfg_attrs") # @oss-disable load("//antlir/antlir2/cfg/systemd:defs.bzl", "systemd_cfg") load("//antlir/antlir2/os:cfg.bzl", "os_transition", "os_transition_refs") -load("//antlir/bzl:build_defs.bzl", "get_visibility", "is_facebook") +load("//antlir/bzl:build_defs.bzl", "get_visibility") +load("//antlir/bzl:internal_external.bzl", "is_facebook") load("//antlir/bzl:oss_shim.bzl", fb_transition = "ret_none") # @oss-enable def _transition_impl(platform: PlatformInfo, refs: struct, attrs: struct) -> PlatformInfo: diff --git a/antlir/antlir2/bzl/image/cfg.bzl b/antlir/antlir2/bzl/image/cfg.bzl index 991e835ff3..3595a5b6be 100644 --- a/antlir/antlir2/bzl/image/cfg.bzl +++ b/antlir/antlir2/bzl/image/cfg.bzl @@ -17,7 +17,7 @@ load("//antlir/bzl:oss_shim.bzl", fb_cfg_attrs = "empty_dict", fb_refs = "empty_ load("//antlir/antlir2/cfg/systemd:defs.bzl", "systemd_cfg") load("//antlir/antlir2/os:cfg.bzl", "os_transition", "os_transition_refs") load("//antlir/antlir2/os:oses.bzl", "OSES") -load("//antlir/bzl:build_defs.bzl", "is_facebook") +load("//antlir/bzl:internal_external.bzl", "is_facebook") def cfg_attrs(): return { diff --git a/antlir/antlir2/bzl/image/layer.bzl b/antlir/antlir2/bzl/image/layer.bzl index 947ebac66b..e376aa1a47 100644 --- a/antlir/antlir2/bzl/image/layer.bzl +++ b/antlir/antlir2/bzl/image/layer.bzl @@ -26,8 +26,8 @@ load( load("//antlir/antlir2/os:package.bzl", "get_default_os_for_package", "should_all_images_in_package_use_default_os") # @oss-disable load("//antlir/antlir2/package_managers/dnf/rules:repo.bzl", "RepoInfo", "RepoSetInfo") -load("//antlir/bzl:build_defs.bzl", "is_facebook") load("//antlir/bzl:constants.bzl", "REPO_CFG") +load("//antlir/bzl:internal_external.bzl", "is_facebook") load("//antlir/bzl:types.bzl", "types") load("//antlir/bzl/build_defs.bzl", "config", "get_visibility") load(":cfg.bzl", "attrs_selected_by_cfg", "cfg_attrs", "layer_cfg") diff --git a/antlir/antlir2/bzl/image/prebuilt.bzl b/antlir/antlir2/bzl/image/prebuilt.bzl index 06ff45dce4..ebc2a14395 100644 --- a/antlir/antlir2/bzl/image/prebuilt.bzl +++ b/antlir/antlir2/bzl/image/prebuilt.bzl @@ -11,7 +11,7 @@ load("//antlir/antlir2/antlir2_rootless:package.bzl", "get_antlir2_rootless") load("//antlir/antlir2/bzl:build_phase.bzl", "BuildPhase") load("//antlir/antlir2/bzl:platform.bzl", "rule_with_default_target_platform") load("//antlir/antlir2/bzl:types.bzl", "BuildApplianceInfo", "FlavorInfo", "LayerContents", "LayerInfo") -load("//antlir/bzl:build_defs.bzl", "internal_external") +load("//antlir/bzl:internal_external.bzl", "internal_external") load(":facts.bzl", "facts") PrebuiltImageInfo = provider(fields = [ diff --git a/antlir/antlir2/bzl/package/cfg.bzl b/antlir/antlir2/bzl/package/cfg.bzl index ad6b6766fa..0e5dac55ee 100644 --- a/antlir/antlir2/bzl/package/cfg.bzl +++ b/antlir/antlir2/bzl/package/cfg.bzl @@ -11,7 +11,7 @@ load("//antlir/bzl:oss_shim.bzl", fb_cfg_attrs = "empty_dict", fb_refs = "empty_ # @oss-disable load("//antlir/antlir2/cfg/systemd:defs.bzl", "systemd_cfg") load("//antlir/antlir2/os:cfg.bzl", "os_transition", "os_transition_refs") -load("//antlir/bzl:build_defs.bzl", "is_facebook") +load("//antlir/bzl:internal_external.bzl", "is_facebook") def cfg_attrs(): return _cfg_attrs() | rootless_cfg.attrs diff --git a/antlir/antlir2/bzl/package/defs.bzl b/antlir/antlir2/bzl/package/defs.bzl index 148805acb7..36f66e7719 100644 --- a/antlir/antlir2/bzl/package/defs.bzl +++ b/antlir/antlir2/bzl/package/defs.bzl @@ -7,7 +7,7 @@ load("//antlir/antlir2/bzl:platform.bzl", "arch_select", "os_select") load("//antlir/antlir2/bzl:types.bzl", "BuildApplianceInfo", "LayerInfo") load("//antlir/antlir2/bzl/image:cfg.bzl", "attrs_selected_by_cfg") load("//antlir/buck2/bzl:ensure_single_output.bzl", "ensure_single_output") -load("//antlir/bzl:build_defs.bzl", "internal_external") +load("//antlir/bzl:internal_external.bzl", "internal_external") load(":btrfs.bzl", "btrfs") load(":cfg.bzl", "layer_attrs", "package_cfg") load(":gpt.bzl", "GptPartitionSource", "gpt") diff --git a/antlir/antlir2/features/dot_meta/tests/BUCK b/antlir/antlir2/features/dot_meta/tests/BUCK index 7dc539dc59..bbaf0a0e60 100755 --- a/antlir/antlir2/features/dot_meta/tests/BUCK +++ b/antlir/antlir2/features/dot_meta/tests/BUCK @@ -2,7 +2,8 @@ load("//antlir/antlir2/bzl/image:defs.bzl", "image") load("//antlir/antlir2/bzl/package:defs.bzl", "package") load("//antlir/antlir2/features/dot_meta:dot_meta.bzl", "dot_meta") load("//antlir/antlir2/testing:image_diff_test.bzl", "image_diff_test") -load("//antlir/bzl:build_defs.bzl", "buck_sh_test", "internal_external") +load("//antlir/bzl:build_defs.bzl", "buck_sh_test") +load("//antlir/bzl:internal_external.bzl", "internal_external") # Normally, the `dot_meta` feature is included only when packaging up a final # layer, but we want to make it easier to test with image_diff_test, so these diff --git a/antlir/antlir2/features/extract/extract.bzl b/antlir/antlir2/features/extract/extract.bzl index ff77826e21..b988bdf143 100644 --- a/antlir/antlir2/features/extract/extract.bzl +++ b/antlir/antlir2/features/extract/extract.bzl @@ -29,7 +29,7 @@ load("//antlir/antlir2/features:defs.bzl", "FeaturePluginInfo") load("//antlir/antlir2/features:dependency_layer_info.bzl", "layer_dep_analyze") load("//antlir/antlir2/features:feature_info.bzl", "FeatureAnalysis", "ParseTimeFeature") load("//antlir/buck2/bzl:ensure_single_output.bzl", "ensure_single_output") -load("//antlir/bzl:build_defs.bzl", "internal_external") +load("//antlir/bzl:internal_external.bzl", "internal_external") def extract_from_layer( layer: str | Select, diff --git a/antlir/antlir2/features/extract/tests/BUCK b/antlir/antlir2/features/extract/tests/BUCK index 0e9a9ab297..9ae60d5e0a 100644 --- a/antlir/antlir2/features/extract/tests/BUCK +++ b/antlir/antlir2/features/extract/tests/BUCK @@ -1,7 +1,8 @@ load("//antlir/antlir2/bzl/feature:defs.bzl", "feature") load("//antlir/antlir2/bzl/image:defs.bzl", "image") load("//antlir/antlir2/testing:image_test.bzl", "image_sh_test") -load("//antlir/bzl:build_defs.bzl", "internal_external", "rust_binary") +load("//antlir/bzl:build_defs.bzl", "rust_binary") +load("//antlir/bzl:internal_external.bzl", "internal_external") oncall("antlir") diff --git a/antlir/antlir2/features/genrule/tests/BUCK b/antlir/antlir2/features/genrule/tests/BUCK index d75235c3a3..da836aaf47 100644 --- a/antlir/antlir2/features/genrule/tests/BUCK +++ b/antlir/antlir2/features/genrule/tests/BUCK @@ -1,7 +1,8 @@ load("//antlir/antlir2/bzl/feature:defs.bzl", "feature") load("//antlir/antlir2/bzl/image:defs.bzl", "image") load("//antlir/antlir2/testing:image_diff_test.bzl", "image_diff_test") -load("//antlir/bzl:build_defs.bzl", "is_facebook", "rust_binary") +load("//antlir/bzl:build_defs.bzl", "rust_binary") +load("//antlir/bzl:internal_external.bzl", "is_facebook") oncall("antlir") diff --git a/antlir/antlir2/features/install/install.bzl b/antlir/antlir2/features/install/install.bzl index d64d40b32f..56c51a2316 100644 --- a/antlir/antlir2/features/install/install.bzl +++ b/antlir/antlir2/features/install/install.bzl @@ -15,7 +15,7 @@ load( "ParseTimeFeature", ) load("//antlir/buck2/bzl:ensure_single_output.bzl", "ensure_single_output") -load("//antlir/bzl:build_defs.bzl", "internal_external") +load("//antlir/bzl:internal_external.bzl", "internal_external") load("//antlir/bzl:stat.bzl", "stat") default_permissions = record( diff --git a/antlir/antlir2/features/rpm/tests/BUCK b/antlir/antlir2/features/rpm/tests/BUCK index 67851db733..a521f11c89 100644 --- a/antlir/antlir2/features/rpm/tests/BUCK +++ b/antlir/antlir2/features/rpm/tests/BUCK @@ -1,7 +1,8 @@ load("//antlir/antlir2/bzl/feature:defs.bzl", "feature") load("//antlir/antlir2/package_managers/dnf/rules:repo.bzl", "repo_set") load("//antlir/antlir2/testing:image_test.bzl", "image_python_test", "image_sh_test") -load("//antlir/bzl:build_defs.bzl", "alias", "buck_genrule", "internal_external", "python_binary") +load("//antlir/bzl:build_defs.bzl", "alias", "buck_genrule", "python_binary") +load("//antlir/bzl:internal_external.bzl", "internal_external") load(":defs.bzl", "expected_t", "test_rpms") oncall("antlir") diff --git a/antlir/antlir2/flavor/BUCK b/antlir/antlir2/flavor/BUCK index 853e18c597..130eacd6ff 100644 --- a/antlir/antlir2/flavor/BUCK +++ b/antlir/antlir2/flavor/BUCK @@ -1,6 +1,6 @@ load("//antlir/antlir2/bzl/flavor:defs.bzl", "flavor") load("//antlir/antlir2/package_managers/dnf/rules:repo.bzl", "repo_set") -load("//antlir/bzl:build_defs.bzl", "internal_external") +load("//antlir/bzl:internal_external.bzl", "internal_external") oncall("antlir") diff --git a/antlir/antlir2/libcap/BUCK b/antlir/antlir2/libcap/BUCK index 0de6e28363..bd9847fa79 100644 --- a/antlir/antlir2/libcap/BUCK +++ b/antlir/antlir2/libcap/BUCK @@ -1,5 +1,6 @@ # @oss-disable -load("//antlir/bzl:build_defs.bzl", "alias", "internal_external", "rust_bindgen_library", "rust_library") +load("//antlir/bzl:build_defs.bzl", "alias", "rust_bindgen_library", "rust_library") +load("//antlir/bzl:internal_external.bzl", "internal_external") oncall("antlir") diff --git a/antlir/antlir2/os/cfg.bzl b/antlir/antlir2/os/cfg.bzl index bf33539d8d..67889ee2ce 100644 --- a/antlir/antlir2/os/cfg.bzl +++ b/antlir/antlir2/os/cfg.bzl @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -load("//antlir/bzl:build_defs.bzl", "internal_external", "is_facebook") +load("//antlir/bzl:internal_external.bzl", "internal_external", "is_facebook") load(":defs.bzl", "OsVersionInfo") load(":oses.bzl", "OSES") diff --git a/antlir/antlir2/os/oses.bzl b/antlir/antlir2/os/oses.bzl index 2d800de77a..8f432d9e9b 100644 --- a/antlir/antlir2/os/oses.bzl +++ b/antlir/antlir2/os/oses.bzl @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -load("//antlir/bzl:build_defs.bzl", "internal_external", "is_facebook") +load("//antlir/bzl:internal_external.bzl", "internal_external", "is_facebook") arch_t = enum("x86_64", "aarch64") diff --git a/antlir/antlir2/package_managers/dnf/build_appliance/BUCK b/antlir/antlir2/package_managers/dnf/build_appliance/BUCK index 18a80c19d4..5afb21e09f 100644 --- a/antlir/antlir2/package_managers/dnf/build_appliance/BUCK +++ b/antlir/antlir2/package_managers/dnf/build_appliance/BUCK @@ -1,7 +1,7 @@ load("//antlir/antlir2/bzl:json_file.bzl", "json_file") load("//antlir/antlir2/bzl/feature:defs.bzl", "feature") load("//antlir/antlir2/package_managers/dnf/rules:repo.bzl", "repo_set") -load("//antlir/bzl:build_defs.bzl", "internal_external") +load("//antlir/bzl:internal_external.bzl", "internal_external") oncall("antlir") diff --git a/antlir/antlir2/package_managers/dnf/rules/makecache/BUCK b/antlir/antlir2/package_managers/dnf/rules/makecache/BUCK index c72c5c123f..aee11a8c00 100644 --- a/antlir/antlir2/package_managers/dnf/rules/makecache/BUCK +++ b/antlir/antlir2/package_managers/dnf/rules/makecache/BUCK @@ -3,7 +3,8 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -load("//antlir/bzl:build_defs.bzl", "buck_sh_binary", "export_file", "internal_external") +load("//antlir/bzl:build_defs.bzl", "buck_sh_binary", "export_file") +load("//antlir/bzl:internal_external.bzl", "internal_external") oncall("antlir") diff --git a/antlir/antlir2/package_managers/dnf/rules/makerepo/BUCK b/antlir/antlir2/package_managers/dnf/rules/makerepo/BUCK index ea81d935d4..7568283e3b 100644 --- a/antlir/antlir2/package_managers/dnf/rules/makerepo/BUCK +++ b/antlir/antlir2/package_managers/dnf/rules/makerepo/BUCK @@ -1,4 +1,5 @@ -load("//antlir/bzl:build_defs.bzl", "buck_sh_binary", "is_facebook", "rust_binary") +load("//antlir/bzl:build_defs.bzl", "buck_sh_binary", "rust_binary") +load("//antlir/bzl:internal_external.bzl", "is_facebook") oncall("antlir") diff --git a/antlir/antlir2/package_managers/dnf/rules/repo.bzl b/antlir/antlir2/package_managers/dnf/rules/repo.bzl index c4d8478136..02433bbf89 100644 --- a/antlir/antlir2/package_managers/dnf/rules/repo.bzl +++ b/antlir/antlir2/package_managers/dnf/rules/repo.bzl @@ -4,7 +4,7 @@ # LICENSE file in the root directory of this source tree. load("//antlir/antlir2/bzl:platform.bzl", "rule_with_default_target_platform") -load("//antlir/bzl:build_defs.bzl", "is_facebook") +load("//antlir/bzl:internal_external.bzl", "is_facebook") load(":rpm.bzl", "RpmInfo", "nevra_to_string", "package_href") RepoInfo = provider(fields = [ diff --git a/antlir/antlir2/test_images/cfg/os/BUCK b/antlir/antlir2/test_images/cfg/os/BUCK index 1354039cd5..087a6ddc08 100644 --- a/antlir/antlir2/test_images/cfg/os/BUCK +++ b/antlir/antlir2/test_images/cfg/os/BUCK @@ -5,7 +5,7 @@ load("//antlir/antlir2/bzl/package:defs.bzl", "package") load("//antlir/antlir2/package_managers/dnf/rules:repo.bzl", "repo") load("//antlir/antlir2/package_managers/dnf/rules:rpm.bzl", "rpm") load("//antlir/antlir2/testing:image_test.bzl", "image_rust_test") -load("//antlir/bzl:build_defs.bzl", "internal_external") +load("//antlir/bzl:internal_external.bzl", "internal_external") load(":defs.bzl", "write_os") oncall("antlir") diff --git a/antlir/antlir2/test_images/remote_execution/BUCK b/antlir/antlir2/test_images/remote_execution/BUCK index 6f71962d6e..dae529a639 100644 --- a/antlir/antlir2/test_images/remote_execution/BUCK +++ b/antlir/antlir2/test_images/remote_execution/BUCK @@ -2,7 +2,7 @@ load("//antlir/antlir2/bzl/feature:defs.bzl", "feature") load("//antlir/antlir2/bzl/image:defs.bzl", "image") load("//antlir/antlir2/genrule_in_image:genrule_in_image.bzl", "genrule_in_image") load("//antlir/antlir2/testing:image_rpms_test.bzl", "image_test_rpm_names") -load("//antlir/bzl:build_defs.bzl", "internal_external") +load("//antlir/bzl:internal_external.bzl", "internal_external") oncall("antlir") diff --git a/antlir/antlir2/testing/image_test.bzl b/antlir/antlir2/testing/image_test.bzl index dc39c71e2c..6a8a503b5d 100644 --- a/antlir/antlir2/testing/image_test.bzl +++ b/antlir/antlir2/testing/image_test.bzl @@ -15,9 +15,11 @@ load("//antlir/antlir2/bzl:types.bzl", "LayerInfo") load("//antlir/antlir2/bzl/feature:defs.bzl", "feature") load("//antlir/antlir2/bzl/image:cfg.bzl", "cfg_attrs", "layer_cfg") load("//antlir/antlir2/bzl/image:defs.bzl", "image") -load("//antlir/bzl:build_defs.bzl", "add_test_framework_label", "buck_sh_test", "cpp_unittest", "internal_external", "is_facebook", "python_unittest", "rust_unittest") +load("//antlir/bzl:build_defs.bzl", "add_test_framework_label", "buck_sh_test", "cpp_unittest", "python_unittest", "rust_unittest") load("//antlir/bzl:oss_shim.bzl", "special_tags") # @oss-enable +load("//antlir/bzl:internal_external.bzl", "internal_external", "is_facebook") + HIDE_TEST_LABELS = [special_tags.disabled, special_tags.test_is_invisible_to_testpilot] def _default_list(maybe_value: list[str] | None, default: list[str]) -> list[str]: diff --git a/antlir/antlir2/testing/tests/test.bzl b/antlir/antlir2/testing/tests/test.bzl index d6c91f12a3..90e41dad3b 100644 --- a/antlir/antlir2/testing/tests/test.bzl +++ b/antlir/antlir2/testing/tests/test.bzl @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -load("//antlir/bzl:build_defs.bzl", "internal_external") +load("//antlir/bzl:internal_external.bzl", "internal_external") def _product(*iterables): # product('ABCD', 'xy') → Ax Ay Bx By Cx Cy Dx Dy diff --git a/antlir/bzl/build_defs.bzl b/antlir/bzl/build_defs.bzl index 3b6ece3e4a..ac3717ef48 100644 --- a/antlir/bzl/build_defs.bzl +++ b/antlir/bzl/build_defs.bzl @@ -10,6 +10,7 @@ load("@prelude//utils:selects.bzl", "selects") # FB-internal contributors will be less likely to accidentally break # open-source by starting to use un-shimmed features. load(":build_defs_impl.bzl", "shim") +load(":internal_external.bzl", "is_facebook") def _third_party_libraries(names, platform = None): return [ @@ -56,7 +57,7 @@ def _rust_common(rule, **kwargs): if rule != shim.rust_unittest and rule != shim.rust_python_extension and rule != shim.rust_bindgen_library: kwargs["unittests"] = False - if shim.is_facebook: + if is_facebook: deps = selects.apply(kwargs.pop("deps", []), lambda deps: [_ensure_dep_is_public(dep) for dep in deps]) kwargs["deps"] = selects.apply(deps, lambda deps: deps + list(kwargs.pop("fb_deps", []))) if kwargs.get("unittests", False): @@ -132,12 +133,6 @@ echo = rule( attrs = {"content": attrs.string()}, ) -def internal_external(*, fb, oss): - if is_facebook: - return fb - else: - return oss - cpp_binary = shim.cpp_binary cpp_library = shim.cpp_library cpp_unittest = shim.cpp_unittest @@ -155,7 +150,6 @@ export_file = shim.export_file get_visibility = shim.get_visibility http_file = shim.http_file http_archive = shim.http_archive -is_facebook = shim.is_facebook do_not_use_repo_cfg = shim.do_not_use_repo_cfg target_utils = shim.target_utils alias = shim.alias diff --git a/antlir/bzl/build_defs_impl.bzl b/antlir/bzl/build_defs_impl.bzl index 944d808386..dff731965a 100644 --- a/antlir/bzl/build_defs_impl.bzl +++ b/antlir/bzl/build_defs_impl.bzl @@ -276,7 +276,6 @@ shim = struct( cpp_binary = _cpp_binary, cpp_library = _cpp_library, cpp_unittest = _cpp_unittest, - is_facebook = False, cxx_genrule = _cxx_genrule, export_file = _export_file, http_file = _http_file, diff --git a/antlir/bzl/internal_external.bzl b/antlir/bzl/internal_external.bzl new file mode 100644 index 0000000000..bc72b1e43b --- /dev/null +++ b/antlir/bzl/internal_external.bzl @@ -0,0 +1,13 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +# @oss-disable +is_facebook = False # @oss-enable + +def internal_external(*, fb, oss): + if is_facebook: + return fb + else: + return oss diff --git a/antlir/bzl/third_party.bzl b/antlir/bzl/third_party.bzl index 906bf95a96..f1c5e0338c 100644 --- a/antlir/bzl/third_party.bzl +++ b/antlir/bzl/third_party.bzl @@ -7,7 +7,8 @@ load("@prelude//:paths.bzl", "paths") load("//antlir/antlir2/bzl:selects.bzl", "selects") load("//antlir/antlir2/bzl/feature:defs.bzl", "feature") load("//antlir/antlir2/bzl/image:defs.bzl", "image") -load(":build_defs.bzl", "buck_genrule", "internal_external", third_party_shim = "third_party") +load("//antlir/bzl:internal_external.bzl", "internal_external") +load(":build_defs.bzl", "buck_genrule", third_party_shim = "third_party") load(":third_party.shape.bzl", "dep_t", "script_t") PREFIX = "/third-party-build" diff --git a/antlir/uidmaps/BUCK b/antlir/uidmaps/BUCK index d7a1bf39fd..c3af64f8ee 100644 --- a/antlir/uidmaps/BUCK +++ b/antlir/uidmaps/BUCK @@ -1,5 +1,6 @@ load("@prelude//:paths.bzl", "paths") -load("//antlir/bzl:build_defs.bzl", "alias", "export_file", "internal_external") +load("//antlir/bzl:build_defs.bzl", "alias", "export_file") +load("//antlir/bzl:internal_external.bzl", "internal_external") # @oss-disable oncall("antlir") diff --git a/antlir/vm/runtime/BUCK b/antlir/vm/runtime/BUCK index f3e988489d..955267c799 100644 --- a/antlir/vm/runtime/BUCK +++ b/antlir/vm/runtime/BUCK @@ -2,7 +2,8 @@ load("@prelude//:paths.bzl", "paths") load("//antlir/antlir2/bzl:hoist.bzl", "hoist") load("//antlir/antlir2/bzl/feature:defs.bzl", "feature") load("//antlir/antlir2/bzl/image:defs.bzl", "image") -load("//antlir/bzl:build_defs.bzl", "alias", "buck_genrule", "internal_external") +load("//antlir/bzl:build_defs.bzl", "alias", "buck_genrule") +load("//antlir/bzl:internal_external.bzl", "internal_external") oncall("antlir")