From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mx.groups.io with SMTP id smtpd.web08.655.1666030020985710693 for ; Mon, 17 Oct 2022 11:07:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=I4wIYQSL; spf=pass (domain: gmail.com, ip: 209.85.216.46, mailfrom: joey.vagedes@gmail.com) Received: by mail-pj1-f46.google.com with SMTP id 70so11676184pjo.4 for ; Mon, 17 Oct 2022 11:07:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SlL78hq8yEZRMNXJm0iTO/QODWMwhLb1P0Po3mmFBnk=; b=I4wIYQSLDa5k9MjWIOADTxciYuHknom9lFDHYW39fG26GgEKxSwA7Gxf2syJhCdSSC xTLf++fWjbUo5adVG7MWC8ll6orKK0Z2kbSuJTrpThdfBVUFIMxNgvMoYilFAKRIcdK6 wlHGDcTiG/43NEBa0MbSd4rCVCn8NjujfR8e9rNGn+7Ei/A3T5+BgNvwnksYRew3+3qT Vk56kO5Cp1XFeOWzZEXIOEaulmSP7w9ldvS7gu3OHCpVTGkkYZpz/Av7XvVolHpy0ILB 8eV9So1t4bkIUIfwni7zOTue1hOLC2VMV/dnFPr7cySSOF/JB64mbGWu/lCp5cp0PnRe ejJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SlL78hq8yEZRMNXJm0iTO/QODWMwhLb1P0Po3mmFBnk=; b=DZ8IvUG6eDaKpbSBJ/61YgzWNES5nLGmENriJ54xIXfucst4ZAmAPOCyPhHJv4paIA X8GSoq5QFw2w2K8a3n24K82b4aNvWgreByn4ot0iNRqpbjmhWdjUaAdXFJ9W6+Dy9w+0 Yq+q+uU87GbuCRgsZYaYhlUEVffYU2WgI9aFYvCyIGaCoBr9lT4lZQV9yrZbSBM8EXk2 nS1GRri1/Ng2aSBsNhHVtms/XNA2N1bNrU6F7LjlAPFrnq0y2+TKpOfbFdFRb+gMDB8J 90Goi098Aj+YO6UUmelx3aGI8GVq9yino/prJICDzZVkxRBrAW0bbMu7zgJtBh40nf/s 60Ew== X-Gm-Message-State: ACrzQf1bBoQ+Ps405OIZSHlMMCgn/uC4IOW9PJYaxnwsiyisWVHSvzTy N+84rVci4EFqe2GesHu9eF+Praeu0kOhMg== X-Google-Smtp-Source: AMsMyM7FCUTDobtvDkaeMG/t2THZOi2nAB+zC6sT+lwzteLn/YHvvJdgqSZpy4Wph6FOnitnZ7djvw== X-Received: by 2002:a17:90b:4c02:b0:20a:7d26:149 with SMTP id na2-20020a17090b4c0200b0020a7d260149mr35512057pjb.134.1666030020041; Mon, 17 Oct 2022 11:07:00 -0700 (PDT) Return-Path: Received: from localhost.localdomain (c-24-22-143-11.hsd1.wa.comcast.net. [24.22.143.11]) by smtp.gmail.com with ESMTPSA id e17-20020a17090301d100b001782398648dsm7011233plh.8.2022.10.17.11.06.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 11:06:59 -0700 (PDT) From: Joey Vagedes To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Gerd Hoffmann , Jiewen Yao , Jordan Justen Subject: [PATCH v1 1/3] ArmVirtPkg/PlatformCI: Dyn BaseTools Selection Date: Mon, 17 Oct 2022 11:06:33 -0700 Message-Id: <20221017180635.488-2-joey.vagedes@gmail.com> X-Mailer: git-send-email 2.38.0.windows.1 In-Reply-To: <20221017180635.488-1-joey.vagedes@gmail.com> References: <20221017180635.488-1-joey.vagedes@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable When using pytools to build ArmVirtPkg, add the ability to dynamically=0D determine which BaseTools to build with. The Pypi BaseTools will be used=0D if present, otherwise defaulting to the in-tree Basetools.=0D =0D Reference: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4085=0D =0D CC: Ard Biesheuvel =0D CC: Leif Lindholm =0D CC: Sami Mujawar =0D CC: Gerd Hoffmann =0D Cc: Jiewen Yao =0D Cc: Jordan Justen =0D =0D Signed-off-by: Joey Vagedes =0D ---=0D ArmVirtPkg/PlatformCI/PlatformBuild.py | 33 ++++++++++++++++++--=0D 1 file changed, 31 insertions(+), 2 deletions(-)=0D =0D diff --git a/ArmVirtPkg/PlatformCI/PlatformBuild.py b/ArmVirtPkg/PlatformCI= /PlatformBuild.py=0D index dff653e919..7ceca8145c 100644=0D --- a/ArmVirtPkg/PlatformCI/PlatformBuild.py=0D +++ b/ArmVirtPkg/PlatformCI/PlatformBuild.py=0D @@ -7,6 +7,7 @@=0D import os=0D import logging=0D import io=0D +import importlib=0D =0D from edk2toolext.environment import shell_environment=0D from edk2toolext.environment.uefi_build import UefiBuilder=0D @@ -40,6 +41,9 @@ class CommonPlatform():=0D =0D class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEvalS= ettingsManager):=0D =0D + def __init__(self):=0D + self.UseBuiltInBaseTools =3D None=0D +=0D def GetPackagesSupported(self):=0D ''' return iterable of edk2 packages supported by this build.=0D These should be edk2 workspace relative paths '''=0D @@ -105,7 +109,18 @@ class SettingsManager(UpdateSettingsManager, SetupSett= ingsManager, PrEvalSetting=0D scopes =3D CommonPlatform.Scopes=0D ActualToolChainTag =3D shell_environment.GetBuildVars().GetValue("= TOOL_CHAIN_TAG", "")=0D =0D - if GetHostInfo().os.upper() =3D=3D "LINUX" and ActualToolChainTag.= upper().startswith("GCC"):=0D + is_linux =3D GetHostInfo().os.upper() =3D=3D "LINUX"=0D +=0D + if self.UseBuiltInBaseTools is None:=0D + if importlib.util.find_spec('edk2basetools') is not None:=0D + self.UseBuiltInBaseTools =3D True=0D + else:=0D + self.UseBuiltInBaseTools =3D False=0D +=0D + if self.UseBuiltInBaseTools is True:=0D + scopes +=3D ('pipbuild-unix',) if is_linux else ('pipbuild-win= ',)=0D +=0D + if is_linux and ActualToolChainTag.upper().startswith("GCC"):=0D if "AARCH64" in self.ActualArchitectures:=0D scopes +=3D ("gcc_aarch64_linux",)=0D if "ARM" in self.ActualArchitectures:=0D @@ -149,6 +164,7 @@ class SettingsManager(UpdateSettingsManager, SetupSetti= ngsManager, PrEvalSetting=0D =0D class PlatformBuilder(UefiBuilder, BuildSettingsManager):=0D def __init__(self):=0D + self.UseBuiltInBaseTools =3D None=0D UefiBuilder.__init__(self)=0D =0D def AddCommandLineOptions(self, parserObj):=0D @@ -179,7 +195,20 @@ class PlatformBuilder(UefiBuilder, BuildSettingsManage= r):=0D ActualToolChainTag =3D shell_environment.GetBuildVars().GetValue("= TOOL_CHAIN_TAG", "")=0D Arch =3D shell_environment.GetBuildVars().GetValue("TARGET_ARCH", = "")=0D =0D - if GetHostInfo().os.upper() =3D=3D "LINUX" and ActualToolChainTag.= upper().startswith("GCC"):=0D + is_linux =3D GetHostInfo().os.upper() =3D=3D "LINUX"=0D +=0D + if self.UseBuiltInBaseTools is None:=0D + if importlib.util.find_spec('edk2basetools') is not None:=0D + self.UseBuiltInBaseTools =3D True=0D + logging.warning("Using Pip Tools based BaseTools")=0D + else:=0D + self.UseBuiltInBaseTools =3D False=0D + logging.warning("Falling back to using in-tree BaseTools")= =0D +=0D + if self.UseBuiltInBaseTools is True:=0D + scopes +=3D ('pipbuild-unix',) if is_linux else ('pipbuild-win= ',)=0D +=0D + if is_linux and ActualToolChainTag.upper().startswith("GCC"):=0D if "AARCH64" =3D=3D Arch:=0D scopes +=3D ("gcc_aarch64_linux",)=0D elif "ARM" =3D=3D Arch:=0D -- =0D 2.38.0.windows.1=0D =0D