Skip to content

Commit

Permalink
[antlir] fix all buck1 graph eval breakages
Browse files Browse the repository at this point in the history
Summary: I really really really can't wait for this to just die.

Test Plan:
```
❯ buck2 run fbcode//antlir/facebook/buck1:test-buck1-graph --
Buck UI: https://www.internalfb.com/buck2/a9cabd31-07d5-42fe-bc03-ee45773f6c06
Network: Up: 0B  Down: 0B
Jobs completed: 50. Time elapsed: 0.5s.
BUILD SUCCEEDED
==================================================== test session starts ====================================================
platform linux -- Python 3.8.6, pytest-7.2.2, pluggy-0.13.1
rootdir: /data/users/vmagro/fbsource
collected 127 items

../buck-out/v2/gen/fbcode/f026cfe4a5dd1d55/antlir/facebook/buck1/__test-buck1-graph__/test-buck1-graph#link-tree/antlir/facebook/buck1/test_buck1_graph.py

============================================== 127 passed in 121.92s (0:02:01) ==============================================
```

Reviewed By: justintrudell

Differential Revision: D50568023

fbshipit-source-id: 2d57ea23de373a237acc93c3dac934ae2691aca5
  • Loading branch information
vmagro authored and facebook-github-bot committed Oct 24, 2023
1 parent d9b2175 commit fd476d7
Show file tree
Hide file tree
Showing 20 changed files with 29 additions and 473 deletions.
3 changes: 3 additions & 0 deletions antlir/bzl/antlir2_shim.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ antlir2_setting = native.enum(
) if is_buck2() else _antlir2_setting_buck1

def _should_shadow(antlir2: str | bool | None) -> bool:
if not is_buck2():
return False

if antlir2 == None and is_buck2():
package_mode = antlir2_migration.get_mode()
return package_mode == antlir2_migration.mode_t("shadow")
Expand Down
2 changes: 1 addition & 1 deletion antlir/bzl/debuginfo.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/antlir2/bzl/feature:defs.bzl", antlir2_feature = "feature")
load("//antlir/antlir2/bzl/feature:defs.bzl?v2_only", antlir2_feature = "feature")
load("//antlir/antlir2/bzl/image:defs.bzl", antlir2_image = "image")
load("//antlir/bzl:flavor_helpers.bzl", "flavor_helpers")
load("//antlir/bzl/image/feature:defs.bzl", antlir1_feature = "feature")
Expand Down
5 changes: 3 additions & 2 deletions antlir/bzl/genrule/extractor/extract.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ exported by a parent layer which also includes an extract.extract feature.
load("@bazel_skylib//lib:paths.bzl", "paths")
load("//antlir/antlir2/bzl/feature:defs.bzl?v2_only", antlir2_feature = "feature")
load("//antlir/bzl:antlir2_shim.bzl", "antlir2_shim")
load("//antlir/bzl:build_defs.bzl", "is_buck2")
load("//antlir/bzl:constants.bzl", "REPO_CFG")
load("//antlir/bzl:image.bzl", "image")
load("//antlir/bzl:sha256.bzl", "sha256_b64")
Expand Down Expand Up @@ -92,12 +93,12 @@ def _extract(
if antlir2_shim.upgrade_or_shadow_feature(
name = name,
antlir2 = antlir2,
fn = antlir2_feature.new,
fn = antlir2_shim.getattr_buck2(antlir2_feature, "new"),
features = [
antlir2_feature.extract_from_layer(
binaries = binaries,
layer = source + ".antlir2",
),
) if is_buck2() else None,
],
visibility = [],
fake_buck1 = struct(
Expand Down
2 changes: 1 addition & 1 deletion antlir/bzl/image/package/new.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def package_new(
if antlir2_shim.upgrade_or_shadow_package(
antlir2 = antlir2,
name = name,
fn = antlir2_package.backward_compatible_new,
fn = antlir2_shim.getattr_buck2(antlir2_package, "backward_compatible_new"),
layer = layer + ".antlir2",
format = format,
visibility = visibility,
Expand Down
2 changes: 1 addition & 1 deletion antlir/bzl/image_genrule_layer.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Optional arguments:
antlir2_feature.genrule(
cmd = cmd,
user = user,
),
) if is_buck2() else None,
],
implicit_antlir2 = True,
fake_buck1 = struct(
Expand Down
2 changes: 1 addition & 1 deletion antlir/bzl/linux/busybox.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

load("@bazel_skylib//lib:new_sets.bzl", "sets")
load("@bazel_skylib//lib:paths.bzl", "paths")
load("//antlir/antlir2/bzl/feature:defs.bzl", antlir2_feature = "feature")
load("//antlir/antlir2/bzl/feature:defs.bzl?v2_only", antlir2_feature = "feature")
load("//antlir/bzl/image/feature:defs.bzl", antlir1_feature = "feature")

DEFAULT_APPLETS = sets.make([
Expand Down
2 changes: 1 addition & 1 deletion antlir/bzl/linux/config/glibc/nsswitch.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/antlir2/bzl/feature:defs.bzl", antlir2_feature = "feature")
load("//antlir/antlir2/bzl/feature:defs.bzl?v2_only", antlir2_feature = "feature")
load("//antlir/bzl:sha256.bzl", "sha256_b64")
load("//antlir/bzl:shape.bzl", "shape")
load("//antlir/bzl/image/feature:defs.bzl", antlir1_feature = "feature")
Expand Down
2 changes: 1 addition & 1 deletion antlir/bzl/linux/config/network/resolv.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/antlir2/bzl/feature:defs.bzl", antlir2_feature = "feature")
load("//antlir/antlir2/bzl/feature:defs.bzl?v2_only", antlir2_feature = "feature")
load("//antlir/bzl:sha256.bzl", "sha256_b64")
load("//antlir/bzl:shape.bzl", "shape")
load("//antlir/bzl/image/feature:defs.bzl", antlir1_feature = "feature")
Expand Down
2 changes: 1 addition & 1 deletion antlir/bzl/linux/filesystem.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/antlir2/bzl/feature:defs.bzl", antlir2_feature = "feature")
load("//antlir/antlir2/bzl/feature:defs.bzl?v2_only", antlir2_feature = "feature")
load("//antlir/bzl/image/feature:defs.bzl", antlir1_feature = "feature")

def _install(use_antlir2 = False):
Expand Down
2 changes: 1 addition & 1 deletion antlir/bzl/linux/release.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# LICENSE file in the root directory of this source tree.

load("@bazel_skylib//lib:types.bzl", "types")
load("//antlir/antlir2/bzl/feature:defs.bzl", antlir2_feature = "feature")
load("//antlir/antlir2/bzl/feature:defs.bzl?v2_only", antlir2_feature = "feature")
load("//antlir/bzl:build_defs.bzl", "buck_genrule")
load("//antlir/bzl:target_helpers.bzl", "antlir_dep", "normalize_target")
load("//antlir/bzl/image/feature:defs.bzl", antlir1_feature = "feature")
Expand Down
2 changes: 1 addition & 1 deletion antlir/bzl/linux/time.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# LICENSE file in the root directory of this source tree.

load("@bazel_skylib//lib:paths.bzl", "paths")
load("//antlir/antlir2/bzl/feature:defs.bzl", antlir2_feature = "feature")
load("//antlir/antlir2/bzl/feature:defs.bzl?v2_only", antlir2_feature = "feature")
load("//antlir/bzl/image/feature:defs.bzl", "feature")

def _timezone(zone, timezone_dir = "/usr/share/zoneinfo", use_antlir2 = False):
Expand Down
2 changes: 1 addition & 1 deletion antlir/linux/vm/console/defs.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/antlir2/bzl/feature:defs.bzl", antlir2_feature = "feature")
load("//antlir/antlir2/bzl/feature:defs.bzl?v2_only", antlir2_feature = "feature")
load("//antlir/bzl/image/feature:defs.bzl", antlir1_feature = "feature")

def _autologin(use_antlir2 = False):
Expand Down
2 changes: 1 addition & 1 deletion antlir/linux/vm/generator/defs.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/antlir2/bzl/feature:defs.bzl", antlir2_feature = "feature")
load("//antlir/antlir2/bzl/feature:defs.bzl?v2_only", antlir2_feature = "feature")
load("//antlir/bzl/image/feature:defs.bzl", antlir1_feature = "feature")

def _mounts(use_antlir2 = False):
Expand Down
2 changes: 1 addition & 1 deletion antlir/linux/vm/network/defs.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/antlir2/bzl/feature:defs.bzl", antlir2_feature = "feature")
load("//antlir/antlir2/bzl/feature:defs.bzl?v2_only", antlir2_feature = "feature")
load("//antlir/bzl:systemd.bzl", "systemd")
load("//antlir/bzl/image/feature:defs.bzl", antlir1_feature = "feature")

Expand Down
2 changes: 1 addition & 1 deletion antlir/linux/vm/ssh/defs.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/antlir2/bzl/feature:defs.bzl", antlir2_feature = "feature")
load("//antlir/antlir2/bzl/feature:defs.bzl?v2_only", antlir2_feature = "feature")
load("//antlir/bzl:systemd.bzl", "systemd")
load("//antlir/bzl/image/feature:defs.bzl", antlir1_feature = "feature")

Expand Down
58 changes: 0 additions & 58 deletions antlir/rpm/dnf2buck/demo/aarch64/BUCK

This file was deleted.

10 changes: 5 additions & 5 deletions antlir/vm/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//antlir/bzl:build_defs.bzl", "export_file", "python_binary", "python_library")
load("//antlir/bzl:build_defs.bzl", "export_file", "is_buck2", "python_binary", "python_library")
load("//antlir/bzl:kernel_shim.bzl", "kernels")
load("//antlir/vm/bzl:defs.bzl", "vm")

Expand Down Expand Up @@ -151,7 +151,7 @@ vm.run(
)],
kernel = kernels.default,
),
)
) if is_buck2() else None

vm.run(
name = "default-5.19",
Expand All @@ -163,7 +163,7 @@ vm.run(
)],
kernel = kernels.get("5.19"),
),
)
) if is_buck2() else None

vm.run(
name = "default-initrd-debug",
Expand All @@ -179,7 +179,7 @@ vm.run(
disk = vm.types.disk.root(),
kernel = kernels.default,
),
)
) if is_buck2() else None

vm.run(
name = "multinics",
Expand All @@ -188,4 +188,4 @@ vm.run(
kernel = kernels.default,
nics = 4,
),
)
) if is_buck2() else None
6 changes: 3 additions & 3 deletions antlir/vm/bzl/initrd.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
# LICENSE file in the root directory of this source tree.

load("@bazel_skylib//lib:paths.bzl", "paths")
load("//antlir/antlir2/bzl/feature:defs.bzl", "feature")
load("//antlir/antlir2/bzl/image:defs.bzl", "image")
load("//antlir/antlir2/bzl/package:defs.bzl", "package")
load("//antlir/antlir2/bzl/feature:defs.bzl?v2_only", "feature")
load("//antlir/antlir2/bzl/image:defs.bzl?v2_only", "image")
load("//antlir/antlir2/bzl/package:defs.bzl?v2_only", "package")
load("//antlir/bzl:build_defs.bzl", "get_visibility")
load("//antlir/bzl:systemd.bzl", "systemd")
load("//antlir/bzl:types.bzl", "types")
Expand Down
4 changes: 2 additions & 2 deletions antlir/vm/initrd/BUCK
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//antlir/bzl:build_defs.bzl", "export_file")
load("//antlir/bzl:build_defs.bzl", "export_file", "is_buck2")
load("//antlir/bzl:kernel_shim.bzl", "kernels")
load("//antlir/vm/bzl:initrd.bzl", "initrd")

Expand All @@ -16,4 +16,4 @@ export_file(
[initrd(
kernel = kernels.get(uname),
visibility = ["PUBLIC"],
) for uname in kernels.all_kernels]
) for uname in kernels.all_kernels] if is_buck2() else None
Loading

0 comments on commit fd476d7

Please sign in to comment.