From a44b5c9aa1626db8bd3de40cd0a53ee5af734593 Mon Sep 17 00:00:00 2001 From: Dark Knight <> Date: Tue, 6 Aug 2024 05:59:37 -0700 Subject: [PATCH] Revert D60253684 Summary: This diff reverts D60253684 Breaking some continuous builds of bare targets for targets that depend on layers but don't have `uses_sudo` P1515542209 Test Plan: NA Reviewed By: vmagro Differential Revision: D60827664 fbshipit-source-id: 1d197d41fa75e3ab9be5247a081605104befdb03 --- antlir/antlir2/bzl/image/layer.bzl | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/antlir/antlir2/bzl/image/layer.bzl b/antlir/antlir2/bzl/image/layer.bzl index 198eae7f6e1..7c4c47484b1 100644 --- a/antlir/antlir2/bzl/image/layer.bzl +++ b/antlir/antlir2/bzl/image/layer.bzl @@ -7,6 +7,7 @@ load("@prelude//utils:expect.bzl", "expect") load("@prelude//utils:selects.bzl", "selects") load("//antlir/antlir2/antlir2_error_handler:handler.bzl", "antlir2_error_handler") load("//antlir/antlir2/antlir2_overlayfs:overlayfs.bzl", "OverlayFs", "OverlayLayer", "get_antlir2_use_overlayfs") +load("//antlir/antlir2/antlir2_rootless:package.bzl", "get_antlir2_rootless") load("//antlir/antlir2/bzl:build_phase.bzl", "BuildPhase", "verify_build_phases") load("//antlir/antlir2/bzl:platform.bzl", "arch_select") load("//antlir/antlir2/bzl:types.bzl", "BuildApplianceInfo", "FeatureInfo", "FlavorInfo", "LayerContents", "LayerInfo") @@ -695,16 +696,8 @@ def layer( kwargs["default_target_platform"] = config.get_platform_for_current_buildfile().target_platform - # If the user didn't configure the rootless setting, default to True - # NOTE: this only affects builds that `buck2 build` the layer directly, it - # does *NOT* affect builds that use this layer as a dependency (packages, - # container tests, vm tests). - # - # Why does it matter then? - # Automated bisect services will `buck2 build` layer targets directly when - # they are broken, and that does not support `sudo`. if rootless == None: - rootless = True + rootless = get_antlir2_rootless() if get_antlir2_use_overlayfs(): kwargs["working_format"] = "overlayfs"