Skip to content

Commit

Permalink
[antlir][buck] cleanup cell assumptions
Browse files Browse the repository at this point in the history
Summary:
Don't assume we're always in fbcode.
Antlir cell is always just `antlir`, don't hide it behind a function that can
return different values.

Test Plan: waitforsandcastle

Reviewed By: epilatow

Differential Revision: D59689714

fbshipit-source-id: f1707af1875fd52eab5ac8e777a2d45062f86082
  • Loading branch information
vmagro authored and facebook-github-bot committed Jul 12, 2024
1 parent e0569d6 commit 11d0a5e
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 10 deletions.
1 change: 0 additions & 1 deletion antlir/bzl/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ http_archive = shim.http_archive
is_buck2 = shim.is_buck2
is_facebook = shim.is_facebook
do_not_use_repo_cfg = shim.do_not_use_repo_cfg
repository_name = shim.repository_name
target_utils = shim.target_utils
alias = shim.alias
add_test_framework_label = shim.add_test_framework_label
Expand Down
5 changes: 0 additions & 5 deletions antlir/bzl/build_defs_impl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,6 @@ def _rust_python_extension(name: str, **kwargs):
def _thrift_library(**kwargs):
fail("not implemented")

def _get_antlir_cell_name():
return "antlir"

### BEGIN COPY-PASTA (@fbcode_macros//build_defs/lib:target_utils.bzl)
def _parse_target(target, default_repo = None, default_base_path = None):
if target.count(":") != 1:
Expand Down Expand Up @@ -299,7 +296,6 @@ shim = struct(
#
antlir_buck_env = _antlir_buck_env,
config = struct(
get_antlir_cell_name = _get_antlir_cell_name,
get_platform_for_current_buildfile = lambda: struct(target_platform = None),
),
get_visibility = _get_visibility,
Expand All @@ -326,6 +322,5 @@ shim = struct(
"/mnt/gvfs",
]),
},
repository_name = lambda: "@antlir",
add_test_framework_label = lambda labels, add: labels + [add],
)
3 changes: 1 addition & 2 deletions antlir/bzl/constants.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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", "config", "do_not_use_repo_cfg")
load("//antlir/bzl:build_defs.bzl", "do_not_use_repo_cfg")
load(":constants.shape.bzl", "nevra_t", "repo_config_t")
load(":target_helpers.bzl", "normalize_target")

Expand Down Expand Up @@ -70,7 +70,6 @@ REPO_CFG = repo_config_t(
# elements in this list, because we do not know the version set that the
# including `image.layer` will use. This would be fixable if Buck
# supported providers like Bazel does.
antlir_cell_name = config.get_antlir_cell_name(),
rc_targets = [
(t if t == "all" else normalize_target(t))
for t in _get_str_list_cfg("rc_targets", separator = ",")
Expand Down
1 change: 0 additions & 1 deletion antlir/bzl/constants.shape.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ nevra_t = shape.shape(
repo_config_t = shape.shape(
artifacts_require_repo = bool,
host_mounts_for_repo_artifacts = shape.list(shape.path),
antlir_cell_name = str,
rc_targets = shape.list(str),
flavor_alias = shape.field(str, optional = True),
)
2 changes: 1 addition & 1 deletion antlir/bzl/target_helpers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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(":build_defs.bzl", "repository_name", "target_utils")
load(":build_defs.bzl", "target_utils")

def normalize_target(target):
if target.startswith("//"):
Expand Down

0 comments on commit 11d0a5e

Please sign in to comment.