Skip to content

Commit

Permalink
[metalos] move basesystem images into metalos/basesystem
Browse files Browse the repository at this point in the history
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
  • Loading branch information
vmagro authored and facebook-github-bot committed Nov 2, 2023
1 parent f4c80de commit e76228a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions antlir/antlir2/antlir1_compat/antlir1_compat.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down
16 changes: 11 additions & 5 deletions antlir/antlir2/testing/image_rpms_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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(
Expand All @@ -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()
Expand All @@ -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),
Expand Down

0 comments on commit e76228a

Please sign in to comment.