diff --git a/.buckconfig.d/common.buckconfig b/.buckconfig.d/common.buckconfig new file mode 100644 index 000000000..076a7ca03 --- /dev/null +++ b/.buckconfig.d/common.buckconfig @@ -0,0 +1,20 @@ +[cells] +prelude = prelude +none = none + +[cell_aliases] +config = prelude +ovr_config = prelude +bazel_skylib = gh_facebook_buck2_shims_meta +buck = gh_facebook_buck2_shims_meta +fbcode = gh_facebook_buck2_shims_meta +fbcode_macros = gh_facebook_buck2_shims_meta +fbsource = gh_facebook_buck2_shims_meta +shim = gh_facebook_buck2_shims_meta +toolchains = gh_facebook_buck2_shims_meta + +[external_cells] +prelude = bundled + +[parser] +target_platform_detector_spec = target:root//...->prelude//platforms:default target:shim//...->prelude//platforms:default diff --git a/shim/.buckconfig b/shim/.buckconfig index de18401cc..d6f453f72 100644 --- a/shim/.buckconfig +++ b/shim/.buckconfig @@ -6,22 +6,33 @@ # of this source tree. [cells] -shim = . +gh_facebook_buck2_shims_meta = . + +[cell_aliases] +root = gh_facebook_buck2_shims_meta + +# This is a duplicate of .buckconfig.d/common.buckconfig, but due to the way +# we vendor the shim directory, common.buckconfig won't show up in the +# vendored .buckconfig.d directory. +# When the shim cell is no longer vendored in individual projects, this +# duplication cam be removed. +[cells] prelude = prelude -toolchains = . none = none [cell_aliases] config = prelude ovr_config = prelude -fbcode = shim -fbsource = shim -fbcode_macros = shim -bazel_skylib = shim -buck = shim +bazel_skylib = gh_facebook_buck2_shims_meta +buck = gh_facebook_buck2_shims_meta +fbcode = gh_facebook_buck2_shims_meta +fbcode_macros = gh_facebook_buck2_shims_meta +fbsource = gh_facebook_buck2_shims_meta +shim = gh_facebook_buck2_shims_meta +toolchains = gh_facebook_buck2_shims_meta [external_cells] prelude = bundled [parser] -target_platform_detector_spec = target:shim//...->prelude//platforms:default +target_platform_detector_spec = target:root//...->prelude//platforms:default target:shim//...->prelude//platforms:default diff --git a/shim/build_defs/lib/oss.bzl b/shim/build_defs/lib/oss.bzl index f05190ce2..9e386e2ab 100644 --- a/shim/build_defs/lib/oss.bzl +++ b/shim/build_defs/lib/oss.bzl @@ -40,11 +40,11 @@ def _strip_third_party_rust_version(target: str) -> str: # Cell the BUCK file being processed belongs to ACTIVE_CELL = native.get_cell_name() -# The root cell of this project, generally "root" and does not need to be set. +# The root cell of this project, extracted from the "root" alias. # Targets that explicitly reference this cell will not be rewritten, and # targets that do not end up referencing a cell will be replaced with targets # that reference this cell -ROOT_CELL = read_config("oss", "root_cell", "root") +ROOT_CELL = read_config("cell_aliases", "root", "root") # The cell this file and the rest of the shim directory belong to, generally # "shim" and does not need to be set. diff --git a/shim/shims.bzl b/shim/shims.bzl index 791fbecd6..6a73cfe2a 100644 --- a/shim/shims.bzl +++ b/shim/shims.bzl @@ -53,8 +53,8 @@ CPP_UNITTEST_DEPS = [ "shim//third-party/googletest:cpp_unittest_main", ] CPP_FOLLY_UNITTEST_DEPS = [ - "folly//folly/test/common:test_main_lib", - "folly//folly/ext/buck2:test_ext", + "gh_facebook_folly//folly/test/common:test_main_lib", + "gh_facebook_folly//folly/ext/buck2:test_ext", ] def _get_headers_from_sources(srcs):