Skip to content

Commit

Permalink
Update CI to VS2022
Browse files Browse the repository at this point in the history
This PR updates the CI pipelines to use VS2022 instead of VS2019
as that is the latest supported VS toolchain on edk2.

Continuous-integration-options: PatchCheck.ignore-multi-package

Signed-off-by: Oliver Smith-Denny <[email protected]>
  • Loading branch information
os-d committed Dec 3, 2024
1 parent 9112fb0 commit a2ef798
Show file tree
Hide file tree
Showing 18 changed files with 92 additions and 72 deletions.
6 changes: 3 additions & 3 deletions .azurepipelines/Windows-VS2019.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## @file
# Azure Pipeline build file for a build using Windows and VS2019
# Azure Pipeline build file for a build using Windows and VS2022
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
Expand All @@ -18,8 +18,8 @@ variables:
jobs:
- template: templates/pr-gate-build-job.yml
parameters:
tool_chain_tag: 'VS2019'
vm_image: 'windows-2019'
tool_chain_tag: 'VS2022'
vm_image: 'windows-2022'
arch_list: "IA32,X64"
usePythonVersion: ${{ variables.default_python_version }}
extra_install_step:
Expand Down
2 changes: 1 addition & 1 deletion .azurepipelines/templates/pr-gate-build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
clean: all

pool:
vmImage: 'windows-2019'
vmImage: 'windows-2022'

steps:
- checkout: self
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: windows-2019
runs-on: windows-2022
permissions:
actions: read
contents: read
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
- name: Setup
if: steps.get_ci_file_operations.outputs.setup_supported == 'true'
run: stuart_setup -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2019
run: stuart_setup -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2022

- name: Upload Setup Log As An Artifact
uses: actions/upload-artifact@v4
Expand All @@ -163,7 +163,7 @@ jobs:

- name: CI Setup
if: steps.get_ci_file_operations.outputs.ci_setup_supported == 'true'
run: stuart_ci_setup -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2019
run: stuart_ci_setup -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2022

- name: Upload CI Setup Log As An Artifact
uses: actions/upload-artifact@v4
Expand All @@ -176,7 +176,7 @@ jobs:
if-no-files-found: ignore

- name: Update
run: stuart_update -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2019
run: stuart_update -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2022

- name: Upload Update Log As An Artifact
uses: actions/upload-artifact@v4
Expand All @@ -189,7 +189,7 @@ jobs:
if-no-files-found: ignore

- name: Build Tools From Source
run: python BaseTools/Edk2ToolsBuild.py -t VS2019
run: python BaseTools/Edk2ToolsBuild.py -t VS2022

- name: Find CodeQL Plugin Directory
id: find_dir
Expand Down Expand Up @@ -246,7 +246,7 @@ jobs:

- name: Download CodeQL CLI
if: steps.codeqlcli_cache.outputs.cache-hit != 'true'
run: stuart_update -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2019 --codeql
run: stuart_update -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2022 --codeql

- name: Remove CI Plugins Irrelevant to CodeQL
shell: python
Expand All @@ -269,7 +269,7 @@ jobs:
- name: CI Build
env:
STUART_CODEQL_PATH: ${{ steps.cache_key_gen.outputs.codeql_cli_ext_dep_dir }}
run: stuart_ci_build -c .pytool/CISettings.py -t DEBUG -p ${{ matrix.Package }} -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2019 --codeql
run: stuart_ci_build -c .pytool/CISettings.py -t DEBUG -p ${{ matrix.Package }} -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2022 --codeql

- name: Build Cleanup
id: build_cleanup
Expand Down
4 changes: 2 additions & 2 deletions .pytool/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on the TianoCore wiki.

## Basic Status

| Package | Windows VS2019 (IA32/X64)| Ubuntu GCC (IA32/X64/ARM/AARCH64) | Known Issues |
| Package | Windows VS2022 (IA32/X64)| Ubuntu GCC (IA32/X64/ARM/AARCH64) | Known Issues |
| :---- | :----- | :---- | :--- |
| ArmPkg | | :heavy_check_mark: |
| ArmPlatformPkg | | :heavy_check_mark: |
Expand Down Expand Up @@ -48,7 +48,7 @@ located [here](https://github.com/tianocore/edk2-pytool-library) and
[here](https://github.com/tianocore/edk2-pytool-extensions)).

The primary execution flows can be found in the
`.azurepipelines/Windows-VS2019.yml` and `.azurepipelines/Ubuntu-GCC5.yml`
`.azurepipelines/Windows-VS2022.yml` and `.azurepipelines/Ubuntu-GCC5.yml`
files. These YAML files are consumed by the Azure Dev Ops Build Pipeline and
dictate what server resources should be used, how they should be configured, and
what processes should be run on them. An overview of this schema can be found
Expand Down
6 changes: 5 additions & 1 deletion BaseTools/Conf/build_rule.template
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
"$(DLINK)" $(DLINK_FLAGS) -o ${dst} $(DLINK_SPATH) -filelist $(STATIC_LIBRARY_FILES_LIST) $(DLINK2_FLAGS)


[Static-Library-File.SEC.AARCH64, Static-Library-File.PEI_CORE.AARCH64, Static-Library-File.PEIM.AARCH64,Static-Library-File.SEC.ARM, Static-Library-File.PEI_CORE.ARM, Static-Library-File.PEIM.ARM]
[Static-Library-File.SEC, Static-Library-File.PEI_CORE, Static-Library-File.PEIM]
<InputFile>
*.lib

Expand All @@ -311,6 +311,10 @@
<OutputFile>
$(DEBUG_DIR)(+)$(MODULE_NAME).dll

<Command.MSFT>
"$(DLINK)" /OUT:${dst} $(DLINK_FLAGS) $(DLINK2_FLAGS) $(DLINK_XIPFLAGS) $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST)
"$(DLINK)" /OUT:${dst} $(DLINK_FLAGS) $(DLINK_XIPFLAGS) $(DLINK_SPATH) @$(STATIC_LIBRARY_FILES_LIST)

<Command.GCC>
"$(DLINK)" -o ${dst} $(DLINK_FLAGS) $(DLINK_XIPFLAGS) -Wl,--start-group,@$(STATIC_LIBRARY_FILES_LIST),--end-group $(CC_FLAGS) $(CC_XIPFLAGS) $(DLINK2_FLAGS)
"$(OBJCOPY)" $(OBJCOPY_FLAGS) ${dst}
Expand Down
13 changes: 12 additions & 1 deletion BaseTools/Conf/tools_def.template
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,6 @@ NOOPT_VS2019_AARCH64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF
*_VS2022_*_APP_FLAGS = /nologo /E /TC
*_VS2022_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h
*_VS2022_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE /FI$(MODULE_NAME)StrDefs.h
# *_VS2022_*_DLINK2_FLAGS = /WHOLEARCHIVE # MU_CHANGE
*_VS2022_*_ASM16_PATH = DEF(VS2022_BIN_IA32)\ml.exe
*_VS2022_*_DEPS_FLAGS = DEF(MSFT_DEPS_FLAGS)
##################
Expand Down Expand Up @@ -795,6 +794,9 @@ NOOPT_VS2022_IA32_NASM_FLAGS = -O0 -f win32 -g
RELEASE_VS2022_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.rdata=.data
NOOPT_VS2022_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG

# BaseTools cannot handle XIP modules with different section and file alignment
*_VS2022_IA32_DLINK_XIPFLAGS = /ALIGN:32

##################
# X64 definitions
##################
Expand Down Expand Up @@ -825,6 +827,9 @@ NOOPT_VS2022_X64_NASM_FLAGS = -O0 -f win64 -g
RELEASE_VS2022_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4281 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.rdata=.data /ALIGN:4096 /DLL
NOOPT_VS2022_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4281 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG /ALIGN:4096 /DLL

# BaseTools cannot handle XIP modules with different section and file alignment
*_VS2022_X64_DLINK_XIPFLAGS = /ALIGN:32

#################
# ARM definitions
#################
Expand Down Expand Up @@ -852,6 +857,9 @@ NOOPT_VS2022_ARM_ASM_FLAGS = /nologo
RELEASE_VS2022_ARM_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:ARM /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /MERGE:.rdata=.data
NOOPT_VS2022_ARM_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:ARM /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG

# BaseTools cannot handle XIP modules with different section and file alignment
*_VS2022_ARM_DLINK_XIPFLAGS = /ALIGN:32

#####################
# AARCH64 definitions
#####################
Expand Down Expand Up @@ -879,6 +887,9 @@ NOOPT_VS2022_AARCH64_ASM_FLAGS = /nologo
RELEASE_VS2022_AARCH64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /IGNORE:4254 /OPT:REF /OPT:ICF=10 /MAP /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:ARM64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /DRIVER /MERGE:.rdata=.data
NOOPT_VS2022_AARCH64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:ARM64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /DRIVER /DEBUG

# BaseTools cannot handle XIP modules with different section and file alignment
*_VS2022_AARCH64_DLINK_XIPFLAGS = /ALIGN:32

####################################################################################
# GCC Common
####################################################################################
Expand Down
2 changes: 1 addition & 1 deletion BaseTools/Edk2ToolsBuild.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @file Edk2ToolsBuild.py
# Invocable class that builds the basetool c files.
#
# Supports VS2017, VS2019, and GCC5
# Supports VS2019, VS2022, and GCC5
##
# Copyright (c) Microsoft Corporation
#
Expand Down
2 changes: 1 addition & 1 deletion BaseTools/toolsetup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ endlocal

:Usage
@echo.
echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | ForceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]] [VS2019] [VS2017] [VS2015]"
echo Usage: "%0 [-h | -help | --help | /h | /help | /?] [ Rebuild | ForceRebuild ] [Reconfig] [base_tools_path [edk_tools_path]] [VS2022] [VS2019] [VS2017] [VS2015]"
@echo.
@echo base_tools_path BaseTools project path, BASE_TOOLS_PATH will be set to this path.
@echo edk_tools_path EDK_TOOLS_PATH will be set to this path.
Expand Down
4 changes: 4 additions & 0 deletions CryptoPkg/CryptoPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,9 @@
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf
<BuildOptions>
MSFT:*_*_IA32_DLINK_FLAGS = /ALIGN:64
MSFT:*_*_IA32_DLINK_XIPFLAGS = /ALIGN:64
MSFT:*_*_X64_DLINK_FLAGS = /ALIGN:256
MSFT:*_*_X64_DLINK_XIPFLAGS = /ALIGN:256
}

#
Expand All @@ -471,7 +473,9 @@
OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf
<BuildOptions>
MSFT:*_*_IA32_DLINK_FLAGS = /ALIGN:4096
MSFT:*_*_IA32_DLINK_XIPFLAGS = /ALIGN:4096
MSFT:*_*_X64_DLINK_FLAGS = /ALIGN:4096
MSFT:*_*_X64_DLINK_XIPFLAGS = /ALIGN:4096
}
!endif

Expand Down
6 changes: 3 additions & 3 deletions EmulatorPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Platform: EMULATORPKG
# OS: Windows
# Toolchain: VS2019
# Toolchain: VS2022
#
# Copyright (c) Microsoft Corporation.
# Copyright (c) 2020, Intel Corporation. All rights reserved.
Expand All @@ -23,7 +23,7 @@ jobs:
- job: Platform_CI
variables:
package: 'EmulatorPkg'
vm_image: 'windows-2019'
vm_image: 'windows-2022'
should_run: true
run_flags: "MAKE_STARTUP_NSH=TRUE"

Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
steps:
- template: ../../../.azurepipelines/templates/platform-build-run-steps.yml
parameters:
tool_chain_tag: VS2019
tool_chain_tag: VS2022
build_pkg: $(package)
build_target: $(Build.Target)
build_arch: $(Build.Arch)
Expand Down
6 changes: 3 additions & 3 deletions EmulatorPkg/PlatformCI/PlatformBuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ def GetLoggingLevel(self, loggerType):
def SetPlatformEnv(self):
logging.debug("PlatformBuilder SetPlatformEnv")
self.env.SetValue("PRODUCT_NAME", "EmulatorPkg", "Platform Hardcoded")
self.env.SetValue("TOOL_CHAIN_TAG", "VS2019", "Default Toolchain")
self.env.SetValue("TOOL_CHAIN_TAG", "VS2022", "Default Toolchain")

# Add support for using the correct Platform Headers, tools, and Libs based on emulator architecture
# requested to be built when building VS2019 or VS2017
if self.env.GetValue("TOOL_CHAIN_TAG") == "VS2019" or self.env.GetValue("TOOL_CHAIN_TAG") == "VS2017":
# requested to be built when building VS2022 or VS2019
if self.env.GetValue("TOOL_CHAIN_TAG") == "VS2022" or self.env.GetValue("TOOL_CHAIN_TAG") == "VS2019":
key = self.env.GetValue("TOOL_CHAIN_TAG") + "_HOST"
if self.env.GetValue("TARGET_ARCH") == "IA32":
shell_environment.ShellEnvironment().set_shell_var(key, "x86")
Expand Down
2 changes: 1 addition & 1 deletion EmulatorPkg/PlatformCI/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ to use the same Pytools based build infrastructure locally.
## Supported Configuration Details

This solution for building and running EmulatorPkg has only been validated with Windows 10
with VS2019 and Ubuntu 18.04 with GCC5 toolchain. Four different firmware builds are
with VS2022 and Ubuntu 18.04 with GCC5 toolchain. Four different firmware builds are
supported and are described below.

| Configuration name | Architectures | DSC File |Additional Flags |
Expand Down
6 changes: 3 additions & 3 deletions OvmfPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Platform: OVMF
# OS: Windows
# Toolchain: VS2019
# Toolchain: VS2022
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
Expand All @@ -22,7 +22,7 @@ jobs:
- job: Platform_CI
variables:
package: 'OvmfPkg'
vm_image: 'windows-2019'
vm_image: 'windows-2022'
should_run: true
run_flags: "MAKE_STARTUP_NSH=TRUE QEMU_HEADLESS=TRUE"

Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
steps:
- template: ../../../.azurepipelines/templates/platform-build-run-steps.yml
parameters:
tool_chain_tag: VS2019
tool_chain_tag: VS2022
build_pkg: $(package)
build_target: $(Build.Target)
build_arch: $(Build.Arch)
Expand Down
2 changes: 1 addition & 1 deletion OvmfPkg/PlatformCI/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ to use the same Pytools based build infrastructure locally.
## Supported Configuration Details

This solution for building and running OvmfPkg has only been validated with Windows 10
with VS2019 and Ubuntu 18.04 with GCC5 toolchain. Four different firmware builds are
with VS2022 and Ubuntu 18.04 with GCC5 toolchain. Four different firmware builds are
supported and are described below.

| Configuration name | Architectures | DSC File |Additional Flags |
Expand Down
2 changes: 1 addition & 1 deletion PrmPkg/Samples/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Note that the build command does provide the option to build a specific module i
faster build time. If you would like to just build a single PRM module that can be done by specifying the path to
the module INF file with the "-m" argument to `build`. For example, this command builds 32-bit and 64-bit binaries
with Visual Studio 2019: \
``build -p PrmPkg/PrmPkg.dsc -m PrmPkg/Samples/PrmSampleContextBufferModule/PrmSampleContextBufferModule.inf -a IA32 -a X64 -t VS2019``
``build -p PrmPkg/PrmPkg.dsc -m PrmPkg/Samples/PrmSampleContextBufferModule/PrmSampleContextBufferModule.inf -a IA32 -a X64 -t VS2022``

## PRM Sample Module User's Guide

Expand Down
Loading

0 comments on commit a2ef798

Please sign in to comment.