From 0a5bb8bed1f5ca6e1e7db1b7bcd3f7582be5dba0 Mon Sep 17 00:00:00 2001 From: kuqin12 <42554914+kuqin12@users.noreply.github.com> Date: Thu, 1 Jun 2023 21:38:42 -0700 Subject: [PATCH] Onboarding ARM64 builds on selfhosted Azure pipeline agents (#404) Please ensure you have read the [contribution docs](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md) prior to submitting the pull request. In particular, [pull request guidelines](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md#pull-request-best-practices). This change added a few new matrix entries to support building mu_tiano_platforms on native ARM64 systems. The PR will cover both https://github.com/microsoft/mu_basecore/issues/369 and https://github.com/microsoft/mu_basecore/issues/305. The PR should also be incorporated with mu_devops change. For each item, place an "x" in between `[` and `]` if true. Example: `[x]`. _(you can also check items in the GitHub UI)_ - [x] Impacts functionality? - **Functionality** - Does the change ultimately impact how firmware functions? - Examples: Add a new library, publish a new PPI, update an algorithm, ... - [ ] Impacts security? - **Security** - Does the change have a direct security impact on an application, flow, or firmware? - Examples: Crypto algorithm change, buffer overflow fix, parameter validation improvement, ... - [ ] Breaking change? - **Breaking change** - Will anyone consuming this change experience a break in build or boot behavior? - Examples: Add a new library class, move a module to a different repo, call a function in a new library class in a pre-existing module, ... - [ ] Includes tests? - **Tests** - Does the change include any explicit test code? - Examples: Unit tests, integration tests, robot tests, ... - [ ] Includes documentation? - **Documentation** - Does the change contain explicit documentation additions outside direct code modifications (and comments)? - Examples: Update readme file, add feature readme file, link to documentation on an a separate Web page, ... This was tested on selfhost-agents and existing agents. Pipeline changes, N/A for integration. --- .azurepipelines/Matrix-Build-Job-Clang.yml | 82 ---------------- .azurepipelines/Matrix-Build-Job.yml | 107 --------------------- .azurepipelines/Ubuntu-CLANGPDB.yml | 38 -------- .azurepipelines/Ubuntu-GCC5.yml | 91 ++++++++++++++---- .azurepipelines/Windows-CLANGPDB.yml | 39 -------- .azurepipelines/Windows-VS.yml | 86 ++++++++++++++--- 6 files changed, 145 insertions(+), 298 deletions(-) delete mode 100644 .azurepipelines/Matrix-Build-Job-Clang.yml delete mode 100644 .azurepipelines/Matrix-Build-Job.yml delete mode 100644 .azurepipelines/Ubuntu-CLANGPDB.yml delete mode 100644 .azurepipelines/Windows-CLANGPDB.yml diff --git a/.azurepipelines/Matrix-Build-Job-Clang.yml b/.azurepipelines/Matrix-Build-Job-Clang.yml deleted file mode 100644 index f04dc113900..00000000000 --- a/.azurepipelines/Matrix-Build-Job-Clang.yml +++ /dev/null @@ -1,82 +0,0 @@ -## @file -# Template file for generating a CLANGPDB build job matrix for the packages currently supported for -# build in Mu Basecore. -# -# Copyright (c) Microsoft Corporation. -# Copyright (c) 2020 - 2021, ARM Limited. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent -## - -parameters: -- name: arch_list - displayName: Architectures (e.g. IA32, X64) - type: string - default: '' -- name: extra_build_args - displayName: Extra Build Command Arguments - type: string - default: '' -- name: extra_install_step - displayName: Extra Install Steps - type: stepList - default: - - script: echo No extra steps provided -- name: tool_chain_tag - displayName: Tool Chain (e.g. VS2022) - type: string - default: '' -- name: vm_image - displayName: Virtual Machine Image (e.g. windows-latest) - type: string - default: 'windows-latest' - -jobs: - -- job: Build - timeoutInMinutes: 120 - # Use matrix to speed up the build process - strategy: - matrix: - TARGET_MDE_CPU: - Build.Pkgs: 'MdePkg,UefiCpuPkg' - Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' - TARGET_MDEMODULE_DEBUG: - Build.Pkgs: 'MdeModulePkg' - Build.Targets: 'DEBUG,NOOPT' - TARGET_MDEMODULE_RELEASE: - Build.Pkgs: 'MdeModulePkg' - Build.Targets: 'RELEASE,NO-TARGET' - TARGET_NETWORK: - Build.Pkgs: 'NetworkPkg' - Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' - TARGET_OTHER: - Build.Pkgs: 'PcAtChipsetPkg,ShellPkg,StandaloneMmPkg,BaseTools' - Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' - TARGET_TEST_POLICY: - Build.Pkgs: 'UnitTestFrameworkPkg,PolicyServicePkg' - Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' - TARGET_CRYPTO: - Build.Pkgs: 'CryptoPkg' - Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' - - workspace: - clean: all - - pool: - vmImage: ${{ parameters.vm_image }} - - steps: - - template: Steps/PrGate.yml@mu_devops - parameters: - artifacts_identifier: '$(Build.Pkgs) $(Build.Targets)' - build_archs: ${{ parameters.arch_list }} - build_pkgs: $(Build.Pkgs) - build_targets: $(Build.Targets) - do_ci_build: true - do_ci_setup: false - do_non_ci_build: false - do_non_ci_setup: true - do_pr_eval: true - extra_build_args: ${{ parameters.extra_build_args }} - extra_install_step: ${{ parameters.extra_install_step }} - tool_chain_tag: ${{ parameters.tool_chain_tag }} diff --git a/.azurepipelines/Matrix-Build-Job.yml b/.azurepipelines/Matrix-Build-Job.yml deleted file mode 100644 index ece4233094b..00000000000 --- a/.azurepipelines/Matrix-Build-Job.yml +++ /dev/null @@ -1,107 +0,0 @@ -## @file -# Template file for generating a build job matrix for the packages currently supported for -# build in Mu Basecore. -# -# Copyright (c) Microsoft Corporation. -# Copyright (c) 2020 - 2021, ARM Limited. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent -## - -parameters: -- name: arch_list - displayName: Architectures (e.g. IA32, X64) - type: string - default: '' -- name: extra_build_args - displayName: Extra Build Command Arguments - type: string - default: '' -- name: extra_install_step - displayName: Extra Install Steps - type: stepList - default: - - script: echo No extra steps provided -- name: tool_chain_tag - displayName: Tool Chain (e.g. VS2022) - type: string - default: '' -- name: vm_image - displayName: Virtual Machine Image (e.g. windows-latest) - type: string - default: 'windows-latest' -- name: container_image - displayName: Container Image - type: string - default: '' - -jobs: - -- job: Build - timeoutInMinutes: 120 - # Use matrix to speed up the build process - strategy: - matrix: - TARGET_MDE_CPU: - Build.Pkgs: 'MdePkg,UefiCpuPkg' - Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' - TARGET_MDEMODULE_DEBUG: - Build.Pkgs: 'MdeModulePkg' - Build.Targets: 'DEBUG,NOOPT' - TARGET_MDEMODULE_RELEASE: - Build.Pkgs: 'MdeModulePkg' - Build.Targets: 'RELEASE,NO-TARGET' - TARGET_NETWORK: - Build.Pkgs: 'NetworkPkg' - Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' - TARGET_OTHER: - Build.Pkgs: 'PcAtChipsetPkg,ShellPkg,StandaloneMmPkg,BaseTools' - Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' - TARGET_TEST_POLICY: - Build.Pkgs: 'UnitTestFrameworkPkg,PolicyServicePkg' - Build.Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' - TARGET_CRYPTO_DEBUG: - Build.Pkgs: 'CryptoPkg' - Build.Targets: 'DEBUG,NOOPT' - TARGET_CRYPTO_RELEASE: - Build.Pkgs: 'CryptoPkg' - Build.Targets: 'RELEASE,NO-TARGET' - - workspace: - clean: all - - ${{ if ne(parameters.container_image, '') }}: - container: ${{ parameters.container_image }} - - pool: - vmImage: ${{ parameters.vm_image }} - - steps: - - ${{ if and(ne(parameters.container_image, ''), not(contains(parameters.vm_image, 'windows'))) }}: - - script: echo "##vso[task.prependpath]/home/vsts_azpcontainer/.local/bin" - displayName: Add User Local Bin to Path - - template: Steps/PrGate.yml@mu_devops - parameters: - artifacts_identifier: '$(Build.Pkgs) $(Build.Targets)' - build_archs: ${{ parameters.arch_list }} - build_pkgs: $(Build.Pkgs) - build_targets: $(Build.Targets) - do_ci_build: true - do_ci_setup: false - do_non_ci_build: false - do_non_ci_setup: true - do_pr_eval: true - extra_build_args: ${{ parameters.extra_build_args }} - extra_install_step: ${{ parameters.extra_install_step }} - tool_chain_tag: ${{ parameters.tool_chain_tag }} - install_tools: ${{ eq(parameters.container_image, '') }} - -- job: PublishCoverage - dependsOn: Build - workspace: - clean: all - - pool: - vmImage: 'windows-latest' - - steps: - - template: Steps/PublishCodeCoverage.yml@mu_devops diff --git a/.azurepipelines/Ubuntu-CLANGPDB.yml b/.azurepipelines/Ubuntu-CLANGPDB.yml deleted file mode 100644 index 27518a34f27..00000000000 --- a/.azurepipelines/Ubuntu-CLANGPDB.yml +++ /dev/null @@ -1,38 +0,0 @@ -## @file -# Azure Pipeline build file for a build using Ubuntu and CLANGPDB. -# -# IMPORTANT: This file requires the local repo to contain a .azurepipelines/Matrix-Build-Job-Clang.yml file that -# performs the actual build steps for the configurations and packages supported by the repo. -# -# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there -# instead of the file in this repo. -# -# - Mu DevOps Repo: https://github.com/microsoft/mu_devops -# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml -# -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: BSD-2-Clause-Patent -## - -resources: - repositories: - - repository: mu_devops - type: github - endpoint: microsoft - name: microsoft/mu_devops - ref: refs/tags/v3.0.0 - -variables: -- group: architectures-x86-64 -- group: tool-chain-clangpdb -- group: tool-chain-clangpdb-ubuntu-vm-image - -jobs: -- template: Matrix-Build-Job-Clang.yml - parameters: - arch_list: $(arch_list) - extra_steps: - - script: sudo apt-get install mingw-w64 - displayName: Install Windows Resource Compiler for Linux - tool_chain_tag: $(tool_chain_tag) - vm_image: $(vm_image) diff --git a/.azurepipelines/Ubuntu-GCC5.yml b/.azurepipelines/Ubuntu-GCC5.yml index b83172330e5..ddceb8ae0d5 100644 --- a/.azurepipelines/Ubuntu-GCC5.yml +++ b/.azurepipelines/Ubuntu-GCC5.yml @@ -14,26 +14,81 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent ## -resources: - repositories: - - repository: mu_devops - type: github - endpoint: microsoft - name: microsoft/mu_devops - ref: refs/tags/v3.0.0 - containers: - - container: linux-gcc - image: ghcr.io/microsoft/mu_devops/ubuntu-22-build:4a1f8d3 - variables: - group: architectures-arm-64-x86-64 - group: tool-chain-ubuntu-gcc -jobs: -- template: Matrix-Build-Job.yml +extends: + template: MuDevOpsWrapper.yml parameters: - arch_list: $(arch_list) - extra_build_args: CODE_COVERAGE=TRUE - tool_chain_tag: 'GCC5' - vm_image: $(vm_image) - container_image: linux-gcc + do_ci_build: true + do_ci_setup: false + do_non_ci_build: false + do_non_ci_setup: true + do_pr_eval: true + container_build: true + os_type: Linux + build_matrix: + TARGET_MDE_CPU: + Pkgs: 'MdePkg,UefiCpuPkg' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: $(arch_list) + TARGET_MDEMODULE_DEBUG: + Pkgs: 'MdeModulePkg' + Targets: 'DEBUG,NOOPT' + ArchList: $(arch_list) + TARGET_MDEMODULE_RELEASE: + Pkgs: 'MdeModulePkg' + Targets: 'RELEASE,NO-TARGET' + ArchList: $(arch_list) + TARGET_NETWORK: + Pkgs: 'NetworkPkg' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: $(arch_list) + TARGET_OTHER: + Pkgs: 'PcAtChipsetPkg,ShellPkg,StandaloneMmPkg,BaseTools' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: $(arch_list) + TARGET_TEST_POLICY: + Pkgs: 'UnitTestFrameworkPkg,PolicyServicePkg' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: $(arch_list) + TARGET_CRYPTO: + Pkgs: 'CryptoPkg' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: $(arch_list) + TARGET_MDE_CPU_ARM: + Pkgs: 'MdePkg,UefiCpuPkg' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: $(arch_list) + SelfHostAgent: true + TARGET_MDEMODULE_DEBUG_ARM: + Pkgs: 'MdeModulePkg' + Targets: 'DEBUG,NOOPT' + ArchList: $(arch_list) + SelfHostAgent: true + TARGET_MDEMODULE_RELEASE_ARM: + Pkgs: 'MdeModulePkg' + Targets: 'RELEASE,NO-TARGET' + ArchList: $(arch_list) + SelfHostAgent: true + TARGET_NETWORK_ARM: + Pkgs: 'NetworkPkg' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: $(arch_list) + SelfHostAgent: true + TARGET_OTHER_ARM: + Pkgs: 'PcAtChipsetPkg,ShellPkg,StandaloneMmPkg,BaseTools' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: $(arch_list) + SelfHostAgent: true + TARGET_TEST_POLICY_ARM: + Pkgs: 'UnitTestFrameworkPkg,PolicyServicePkg' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: $(arch_list) + SelfHostAgent: true + TARGET_CRYPTO_ARM: + Pkgs: 'CryptoPkg' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: $(arch_list) + SelfHostAgent: true diff --git a/.azurepipelines/Windows-CLANGPDB.yml b/.azurepipelines/Windows-CLANGPDB.yml deleted file mode 100644 index 26a507cf299..00000000000 --- a/.azurepipelines/Windows-CLANGPDB.yml +++ /dev/null @@ -1,39 +0,0 @@ -## @file -# Azure Pipeline build file for a build using Windows and CLANGPDB. -# -# IMPORTANT: This file requires the local repo to contain a .azurepipelines/Matrix-Build-Job-Clang.yml file that -# performs the actual build steps for the configurations and packages supported by the repo. -# -# NOTE: This file is automatically synchronized from Mu DevOps. Update the original file there -# instead of the file in this repo. -# -# - Mu DevOps Repo: https://github.com/microsoft/mu_devops -# - File Sync Settings: https://github.com/microsoft/mu_devops/blob/main/.sync/Files.yml -# -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: BSD-2-Clause-Patent -## - -resources: - repositories: - - repository: mu_devops - type: github - endpoint: microsoft - name: microsoft/mu_devops - ref: refs/tags/v3.0.0 - -variables: -- group: architectures-x86-64 -- group: tool-chain-clangpdb -- group: tool-chain-clangpdb-windows-vm-image - -jobs: -- template: Matrix-Build-Job-Clang.yml - parameters: - arch_list: $(arch_list) - extra_install_step: - - powershell: choco install llvm - displayName: Install LLVM and CLANG - condition: and(gt(variables.pkg_count, 0), succeeded()) - tool_chain_tag: $(tool_chain_tag) - vm_image: $(vm_image) diff --git a/.azurepipelines/Windows-VS.yml b/.azurepipelines/Windows-VS.yml index e28e4fa1c2a..07d0ceab192 100644 --- a/.azurepipelines/Windows-VS.yml +++ b/.azurepipelines/Windows-VS.yml @@ -14,22 +14,80 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent ## -resources: - repositories: - - repository: mu_devops - type: github - endpoint: microsoft - name: microsoft/mu_devops - ref: refs/tags/v3.0.0 - variables: - group: architectures-x86-64 - group: tool-chain-windows-visual-studio-latest -jobs: -- template: Matrix-Build-Job.yml +extends: + template: MuDevOpsWrapper.yml parameters: - arch_list: $(arch_list) - extra_build_args: CODE_COVERAGE=TRUE - tool_chain_tag: $(tool_chain_tag) - vm_image: $(vm_image) + do_ci_build: true + do_ci_setup: false + do_non_ci_build: false + do_non_ci_setup: true + do_pr_eval: true + os_type: Windows_NT + build_matrix: + TARGET_MDE_CPU: + Pkgs: 'MdePkg,UefiCpuPkg' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: $(arch_list) + TARGET_MDEMODULE_DEBUG: + Pkgs: 'MdeModulePkg' + Targets: 'DEBUG,NOOPT' + ArchList: $(arch_list) + TARGET_MDEMODULE_RELEASE: + Pkgs: 'MdeModulePkg' + Targets: 'RELEASE,NO-TARGET' + ArchList: $(arch_list) + TARGET_NETWORK: + Pkgs: 'NetworkPkg' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: $(arch_list) + TARGET_OTHER: + Pkgs: 'PcAtChipsetPkg,ShellPkg,StandaloneMmPkg,BaseTools' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: $(arch_list) + TARGET_TEST_POLICY: + Pkgs: 'UnitTestFrameworkPkg,PolicyServicePkg' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: $(arch_list) + TARGET_CRYPTO: + Pkgs: 'CryptoPkg' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: $(arch_list) + TARGET_MDE_CPU_ARM: + Pkgs: 'MdePkg,UefiCpuPkg' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: $(arch_list) + SelfHostAgent: true + TARGET_MDEMODULE_DEBUG_ARM: + Pkgs: 'MdeModulePkg' + Targets: 'DEBUG,NOOPT' + ArchList: $(arch_list) + SelfHostAgent: true + TARGET_MDEMODULE_RELEASE_ARM: + Pkgs: 'MdeModulePkg' + Targets: 'RELEASE,NO-TARGET' + ArchList: $(arch_list) + SelfHostAgent: true + TARGET_NETWORK_ARM: + Pkgs: 'NetworkPkg' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: $(arch_list) + SelfHostAgent: true + TARGET_OTHER_ARM: + Pkgs: 'PcAtChipsetPkg,ShellPkg,StandaloneMmPkg,BaseTools' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: $(arch_list) + SelfHostAgent: true + TARGET_TEST_POLICY_ARM: + Pkgs: 'UnitTestFrameworkPkg,PolicyServicePkg' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: $(arch_list) + SelfHostAgent: true + TARGET_CRYPTO_ARM: + Pkgs: 'CryptoPkg' + Targets: 'DEBUG,RELEASE,NO-TARGET,NOOPT' + ArchList: $(arch_list) + SelfHostAgent: true