Skip to content

Commit

Permalink
[metalos][oss] assorted small fixes
Browse files Browse the repository at this point in the history
Summary:
* pick up metalos deps in antlir opensource generator
* fix rust macro
* use `antlir//` cell in a variety of antlir macros
* allow uids/gids to float due to lack of internal maps
* make some antlir apis (and resources for those) more publicly visible

Test Plan:
```
❯ arc skycastle run //tools/skycastle/workflows2/metalos/oss/metalos-oss-tests.sky:test_target_graph
```
https://www.internalfb.com/sandcastle/workflow/1058345912435543558

Reviewed By: pallotron

Differential Revision: D59685920

fbshipit-source-id: 9380ff90dfc05303422997b518ca1ac4b193c5fe
  • Loading branch information
vmagro authored and facebook-github-bot committed Jul 15, 2024
1 parent 72e3f0a commit b35f465
Show file tree
Hide file tree
Showing 13 changed files with 7,648 additions and 558 deletions.
4 changes: 2 additions & 2 deletions antlir/antlir2/package_managers/dnf/rules/repo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ repo_attrs = {
"dnf_conf": attrs.dict(attrs.string(), attrs.string(), default = {}),
"gpg_keys": attrs.list(attrs.source(doc = "GPG keys that packages are signed with"), default = []),
"logical_id": attrs.option(attrs.string(), doc = "repo name as in dnf.conf", default = None),
"makecache": attrs.default_only(attrs.exec_dep(default = "//antlir/antlir2/package_managers/dnf/rules/makecache:makecache")),
"makerepo": attrs.default_only(attrs.exec_dep(default = "//antlir/antlir2/package_managers/dnf/rules/makerepo:makerepo")),
"makecache": attrs.default_only(attrs.exec_dep(default = "antlir//antlir/antlir2/package_managers/dnf/rules/makecache:makecache")),
"makerepo": attrs.default_only(attrs.exec_dep(default = "antlir//antlir/antlir2/package_managers/dnf/rules/makerepo:makerepo")),
"module_md": attrs.option(attrs.source(), default = None),
"rpms": attrs.list(
attrs.dep(providers = [RpmInfo]),
Expand Down
4 changes: 2 additions & 2 deletions antlir/antlir2/testing/image_rpms_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _rpm_names_test_impl(ctx: AnalysisContext) -> list[Provider]:
_rpm_names_test = rule(
impl = _rpm_names_test_impl,
attrs = {
"image_rpms_test": attrs.default_only(attrs.exec_dep(default = "//antlir/antlir2/testing/image_rpms_test:image-rpms-test")),
"image_rpms_test": attrs.default_only(attrs.exec_dep(default = "antlir//antlir/antlir2/testing/image_rpms_test:image-rpms-test")),
"labels": attrs.list(attrs.string(), default = []),
"layer": attrs.dep(providers = [LayerInfo]),
"not_installed": attrs.bool(default = False),
Expand Down Expand Up @@ -85,7 +85,7 @@ _rpm_integrity_test = rule(
attrs = {
"ignored_files": attrs.list(attrs.string(doc = "path that is allowed to fail integrity test"), default = []),
"ignored_rpms": attrs.list(attrs.string(doc = "name of rpm that is ignored for integrity checks"), default = []),
"image_rpms_test": attrs.default_only(attrs.exec_dep(default = "//antlir/antlir2/testing/image_rpms_test:image-rpms-test")),
"image_rpms_test": attrs.default_only(attrs.exec_dep(default = "antlir//antlir/antlir2/testing/image_rpms_test:image-rpms-test")),
},
)

Expand Down
2 changes: 1 addition & 1 deletion antlir/antlir2/testing/image_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def _implicit_image_test(
parent_layer = layer,
features = [
systemd.install_unit(
"//antlir/antlir2/testing/image_test:antlir2_image_test.service",
"antlir//antlir/antlir2/testing/image_test:antlir2_image_test.service",
force = True,
),
],
Expand Down
2 changes: 1 addition & 1 deletion antlir/bzl/debuginfo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def _split(
**(default_os_kwarg | flavor_kwarg)
)
cfg_kwargs = {
"flavor": "//antlir/antlir2/flavor:none",
"flavor": "antlir//antlir/antlir2/flavor:none",
} if not default_os else {"default_os": default_os}
antlir2_image.layer(
name = debuginfo_name,
Expand Down
2 changes: 1 addition & 1 deletion antlir/bzl/linux/boot/ble_build.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def ble_build(
],
options = args,
),
template = "//antlir/bzl/linux/boot:loader",
template = "antlir//antlir/bzl/linux/boot:loader",
)

features.extend([
Expand Down
2 changes: 1 addition & 1 deletion antlir/bzl/linux/boot/systemd/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def _systemd_build(
kernels = kernels,
label = label,
args = args,
parent_layer = "//antlir/bzl/linux/boot/systemd:base",
parent_layer = "antlir//antlir/bzl/linux/boot/systemd:base",
efi_size_mb = efi_size_mb,
)

Expand Down
4 changes: 1 addition & 3 deletions antlir/bzl/linux/config/glibc/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ oncall("antlir")
template(
name = "nsswitch",
srcs = ["nsswitch.jinja2"],
visibility = [
"//metalos/...",
],
visibility = ["PUBLIC"],
)
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 @@ -15,7 +15,7 @@ def _render(name, instance):
return shape.render_template(
name = name,
instance = instance,
template = "//antlir/bzl/linux/config/glibc:nsswitch",
template = "antlir//antlir/bzl/linux/config/glibc:nsswitch",
)

def _install(instance = None, **kwargs):
Expand Down
8 changes: 1 addition & 7 deletions antlir/bzl/linux/config/network/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ oncall("antlir")
template(
name = "resolv",
srcs = ["resolv.jinja2"],
visibility = [
"//antlir/linux/vm/...",
"//ee_provisioning/images/...",
"//images/...",
"//metalos/...",
"//tupperware/image/vmtest/impl/...",
],
visibility = ["PUBLIC"],
)

shape.impl(
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 @@ -15,7 +15,7 @@ def _render(name, instance):
return shape.render_template(
name = name,
instance = instance,
template = "//antlir/bzl/linux/config/network:resolv",
template = "antlir//antlir/bzl/linux/config/network:resolv",
)

def _install(instance = None, **kwargs):
Expand Down
16 changes: 3 additions & 13 deletions antlir/bzl/linux/systemd/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,20 @@ template(
srcs = [
"mount.jinja2",
],
visibility = [
"//antlir/vm/...",
"//metalos/...",
"//ti/platform/edgeos/...",
],
visibility = ["PUBLIC"],
deps = [":unit"],
)

template(
name = "timer_unit",
srcs = ["timer_unit.jinja2"],
visibility = [
"//metalos/...",
"//netos/...",
],
visibility = ["PUBLIC"],
deps = [":unit"],
)

template(
name = "service_unit",
srcs = ["service_unit.jinja2"],
visibility = [
"//metalos/...",
"//netos/...",
],
visibility = ["PUBLIC"],
deps = [":unit"],
)
6 changes: 1 addition & 5 deletions antlir/vm/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ export_file(
name = "mount-generator",
src = "mount-generator",
visibility = [
"//antlir/linux/vm/...",
"//images/...",
"//metalos/...",
"//provisioning/images/grasstile/...",
"//ti/platform/edgeos/...",
"PUBLIC",
],
)
Loading

0 comments on commit b35f465

Please sign in to comment.