Skip to content

Commit

Permalink
[antlir2] Set default_dnf_excluded_rpms in Facebook flavors
Browse files Browse the repository at this point in the history
Summary: This diff sets the default_dnf_excluded_rpms in Facebook flavors. It prohibits installation of `kernel-devel` and `kernel-headers` rpms as well as some other FB specific RPMs.  This can be overwritten using `dnf_excluded_rpms` parameter in the `image.layer` API call.

Test Plan: waitforsandcastle

Reviewed By: vmagro

Differential Revision: D49432775

fbshipit-source-id: 42bdd139de33ecbe44dd6c169d98545c3bb3edb8
  • Loading branch information
Serge Dubrouski authored and facebook-github-bot committed Sep 21, 2023
1 parent 1f845e9 commit 4f3dd08
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions antlir/antlir2/bzl/image/layer.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def _impl_with_features(features: ProviderCollection, *, ctx: AnalysisContext) -
dnf_repodatas = repodata_only_local_repos(ctx, dnf_available_repos)
dnf_versionlock = ctx.attrs.dnf_versionlock or flavor_info.dnf_info.default_versionlock
dnf_excluded_rpms = ctx.attrs.dnf_excluded_rpms if ctx.attrs.dnf_excluded_rpms != None else flavor_info.dnf_info.default_excluded_rpms

if dnf_excluded_rpms:
dnf_excluded_rpms = ctx.actions.write_json("excluded_rpms.json", dnf_excluded_rpms)
else:
Expand Down
3 changes: 3 additions & 0 deletions antlir/bzl/image_layer.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def image_layer(
if is_buck2():
if not antlir2_allow_ignored_flavor_config_override and flavor_config_override:
fail("antlir2 does not support flavor_config_override: {}".format(flavor_config_override))

antlir2_image.layer(
name = name + ".antlir2",
flavor = flavor,
Expand All @@ -154,6 +155,8 @@ def image_layer(
implicit_antlir2 = True,
compatible_with = antlir2_compatible_with,
visibility = get_visibility(image_layer_kwargs.get("visibility")),
# Antlir1 provisioning images explicitly install package-devel stub, we need to allow them here.
dnf_excluded_rpms = ["aziot-identity-service"],
)
else:
antlir2_shim.fake_buck1_layer(name = name)
Expand Down

0 comments on commit 4f3dd08

Please sign in to comment.