From 78b27a21cb4bcc768b60d9b9233adcf36a3b7a6f Mon Sep 17 00:00:00 2001 From: Vinnie Magro Date: Wed, 30 Oct 2024 10:59:51 -0700 Subject: [PATCH] [antlir2][package] inherit systemd configuration Summary: Packages should inherit the systemd setting from however they are being brought into the build, just like how the OS is inherited. Reviewed By: naveedgol Differential Revision: D65155951 fbshipit-source-id: ed0956c2dcdcf12d080447b4d50c3b08b939fddf --- antlir/antlir2/bzl/package/cfg.bzl | 1 - antlir/antlir2/cfg/systemd/defs.bzl | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/antlir/antlir2/bzl/package/cfg.bzl b/antlir/antlir2/bzl/package/cfg.bzl index 417892ff57..ad6b6766fa 100644 --- a/antlir/antlir2/bzl/package/cfg.bzl +++ b/antlir/antlir2/bzl/package/cfg.bzl @@ -45,7 +45,6 @@ def _package_cfg_impl(platform: PlatformInfo, refs: struct, attrs: struct) -> Pl constraints = constraints, refs = refs, attrs = attrs, - overwrite = True, ) if is_facebook: diff --git a/antlir/antlir2/cfg/systemd/defs.bzl b/antlir/antlir2/cfg/systemd/defs.bzl index 3f63515a5b..5f410c8ea9 100644 --- a/antlir/antlir2/cfg/systemd/defs.bzl +++ b/antlir/antlir2/cfg/systemd/defs.bzl @@ -3,7 +3,12 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -def _transition(*, constraints, refs: struct, attrs: struct, overwrite: bool): +def _transition( + *, + constraints, + refs: struct, + attrs: struct, + overwrite: bool = False): setting = refs.systemd_setting[ConstraintSettingInfo] if attrs.systemd and ( (setting.label not in constraints) or