From e76228a673cbc30c3182a32dda9a2f62cdce6285 Mon Sep 17 00:00:00 2001 From: Vinnie Magro Date: Thu, 2 Nov 2023 12:31:08 -0700 Subject: [PATCH] [metalos] move basesystem images into metalos/basesystem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Less pointless indirection! Test Plan: ``` ❯ buck2 test fbcode//metalos/basesystem:test-rpm-names fbcode//metalos/basesystem:test-rpm-names-c8 Buck UI: https://www.internalfb.com/buck2/b97406a4-0da2-4de1-89f4-37dd58ba05ba Buck UI: https://www.internalfb.com/buck2/b97406a4-0da2-4de1-89f4-37dd58ba05ba Test UI: https://www.internalfb.com/intern/testinfra/testrun/11258999076602892 Network: Up: 11MiB Down: 580MiB (reSessionID-7d6428cf-fa4a-4722-aebf-6e36faf38553) Jobs completed: 79365. Time elapsed: 3:38.5s. Cache hits: 0%. Commands: 503 (cached: 0, remote: 13, local: 490). Fallback: 5/503 Tests finished: Pass 2. Fail 0. Fatal 0. Skip 0. Build failure 0 ``` waitforsandcastle Reviewed By: pallotron Differential Revision: D50667436 fbshipit-source-id: 67043593604a753453d588264470a1c617e8943b --- antlir/antlir2/antlir1_compat/antlir1_compat.bzl | 4 ++-- antlir/antlir2/testing/image_rpms_test.bzl | 16 +++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/antlir/antlir2/antlir1_compat/antlir1_compat.bzl b/antlir/antlir2/antlir1_compat/antlir1_compat.bzl index 3d624bddedd..1e74703daf8 100644 --- a/antlir/antlir2/antlir1_compat/antlir1_compat.bzl +++ b/antlir/antlir2/antlir1_compat/antlir1_compat.bzl @@ -24,8 +24,8 @@ load("//antlir/bzl/image/feature:defs.bzl", "feature") _ALLOWED_LABELS = ( "fbcode//antlir/antlir2/antlir1_compat/tests:antlir1-layer", "fbcode//metalos/os/vm:rootfs.antlir1", - "fbcode//os_foundation/metalos/impl/centos8:basesystem.rc.antlir1", - "fbcode//os_foundation/metalos/impl/centos9:basesystem.rc.antlir1", + "fbcode//metalos/basesystem:c9.antlir1", + "fbcode//metalos/basesystem:c8.antlir1", ) _ALLOWED_PACKAGES = ( diff --git a/antlir/antlir2/testing/image_rpms_test.bzl b/antlir/antlir2/testing/image_rpms_test.bzl index 38906999189..8e11ab0efe6 100644 --- a/antlir/antlir2/testing/image_rpms_test.bzl +++ b/antlir/antlir2/testing/image_rpms_test.bzl @@ -4,6 +4,7 @@ # LICENSE file in the root directory of this source tree. 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/antlir2/os:package.bzl", "get_default_os_for_package", "should_all_images_in_package_use_default_os") load("//antlir/antlir2/testing:image_test.bzl", "image_sh_test") @@ -23,9 +24,11 @@ def _rpm_names_test_impl(ctx: AnalysisContext) -> list[Provider]: _rpm_names_test = rule( impl = _rpm_names_test_impl, attrs = { + "antlir_internal_build_appliance": attrs.default_only(attrs.bool(default = False), doc = "read by cfg.bzl"), "image_rpms_test": attrs.default_only(attrs.exec_dep(default = "//antlir/antlir2/testing/image_rpms_test:image-rpms-test")), "src": attrs.source(), - }, + } | cfg_attrs(), + cfg = layer_cfg, ) def image_test_rpm_names( @@ -34,10 +37,6 @@ def image_test_rpm_names( layer: str, default_os: str | None = None, **kwargs): - _rpm_names_test( - name = name + "--script", - src = src, - ) cfg_kwargs = {"flavor": layer + "[flavor]"} if default_os or should_all_images_in_package_use_default_os(): default_os = default_os or get_default_os_for_package() @@ -61,6 +60,13 @@ def image_test_rpm_names( ) cfg_kwargs.pop("flavor", None) + + _rpm_names_test( + name = name + "--script", + src = src, + **cfg_kwargs + ) + image_sh_test( name = name, test = ":{}--script".format(name),