diff --git a/.azurepipelines/Ubuntu-GCC5.yml b/.azurepipelines/Ubuntu-GCC5.yml index b9a3b851cf3c..bd066d484b39 100644 --- a/.azurepipelines/Ubuntu-GCC5.yml +++ b/.azurepipelines/Ubuntu-GCC5.yml @@ -1,14 +1,13 @@ ## @file -# Azure Pipeline build file for a build using ubuntu and GCC5 +# Azure Pipeline build file for a build using macOS and XCODE5 # # Copyright (c) Microsoft Corporation. -# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.
-# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent ## trigger: - master - stable/* + pr: - master - stable/* @@ -19,8 +18,7 @@ variables: jobs: - template: templates/pr-gate-build-job.yml parameters: - tool_chain_tag: 'GCC5' - vm_image: 'ubuntu-22.04' - container: ${{ variables.default_linux_image }} - arch_list: "IA32,X64,ARM,AARCH64,RISCV64,LOONGARCH64" - usePythonVersion: '' # use Python from the container image + tool_chain_tag: 'XCODE5' + vm_image: 'macOS-14' + arch_list: "IA32,X64" + usePythonVersion: '' # use default Python from the vm image diff --git a/.azurepipelines/Ubuntu-PatchCheck.yml b/.azurepipelines/Ubuntu-PatchCheck.yml deleted file mode 100644 index a397cf3f4db5..000000000000 --- a/.azurepipelines/Ubuntu-PatchCheck.yml +++ /dev/null @@ -1,36 +0,0 @@ -## @file -# Azure Pipielines YML file that evalues the patch series in a PR using the -# python script BaseTools/Scripts/PatchCheck.py. -# -# NOTE: This example monitors pull requests against the edk2-ci branch. Most -# environments would replace 'edk2-ci' with 'master'. -# -# Copyright (c) 2019 - 2020, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent -# -# https://github.com/tianocore -# -## - -trigger: none - -pr: -- master -- stable/* - -pool: - vmImage: 'ubuntu-latest' - -steps: -- checkout: self - clean: true - -- task: UsePythonVersion@0 - inputs: - versionSpec: '3.12' - architecture: 'x64' - -- script: | - git fetch origin $(System.PullRequest.TargetBranch):$(System.PullRequest.TargetBranch) - python BaseTools/Scripts/PatchCheck.py $(System.PullRequest.TargetBranch)..$(System.PullRequest.SourceCommitId) - displayName: 'Use PatchCheck.py to verify patch series in pull request' diff --git a/.azurepipelines/Windows-VS2019.yml b/.azurepipelines/Windows-VS2019.yml deleted file mode 100644 index 58bb98d42b28..000000000000 --- a/.azurepipelines/Windows-VS2019.yml +++ /dev/null @@ -1,29 +0,0 @@ -## @file -# Azure Pipeline build file for a build using Windows and VS2019 -# -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: BSD-2-Clause-Patent -## -trigger: -- master -- stable/* - -pr: -- master -- stable/* - -variables: - - template: templates/defaults.yml - -jobs: -- template: templates/pr-gate-build-job.yml - parameters: - tool_chain_tag: 'VS2019' - vm_image: 'windows-2019' - arch_list: "IA32,X64" - usePythonVersion: ${{ variables.default_python_version }} - extra_install_step: - - powershell: choco install opencppcoverage; Write-Host "##vso[task.prependpath]C:\Program Files\OpenCppCoverage" - displayName: Install Code Coverage Tool - condition: and(gt(variables.pkg_count, 0), succeeded()) - diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index e0c5f69f6cdf..000000000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,361 +0,0 @@ -# This workflow runs CodeQL against the repository. -# -# Results are uploaded to GitHub Code Scanning. -# -# Due to a known issue with the CodeQL extractor when building the edk2 -# codebase on Linux systems, only Windows agents are used for build with -# the VS toolchain. -# -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: BSD-2-Clause-Patent - -name: "CodeQL" - -on: - push: - branches: - - master - pull_request: - branches: - - master - paths-ignore: - - '!**.c' - - '!**.h' - -jobs: - analyze: - name: Analyze - runs-on: windows-2019 - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - include: - - Package: "ArmPkg" - ArchList: "IA32,X64" - - Package: "CryptoPkg" - ArchList: "IA32" - - Package: "CryptoPkg" - ArchList: "X64" - - Package: "DynamicTablesPkg" - ArchList: "IA32,X64" - - Package: "FatPkg" - ArchList: "IA32,X64" - - Package: "FmpDevicePkg" - ArchList: "IA32,X64" - - Package: "IntelFsp2Pkg" - ArchList: "IA32,X64" - - Package: "IntelFsp2WrapperPkg" - ArchList: "IA32,X64" - - Package: "MdeModulePkg" - ArchList: "IA32" - - Package: "MdeModulePkg" - ArchList: "X64" - - Package: "MdePkg" - ArchList: "IA32,X64" - - Package: "PcAtChipsetPkg" - ArchList: "IA32,X64" - - Package: "PrmPkg" - ArchList: "IA32,X64" - - Package: "SecurityPkg" - ArchList: "IA32,X64" - - Package: "ShellPkg" - ArchList: "IA32,X64" - - Package: "SourceLevelDebugPkg" - ArchList: "IA32,X64" - - Package: "StandaloneMmPkg" - ArchList: "IA32,X64" - - Package: "UefiCpuPkg" - ArchList: "IA32,X64" - - Package: "UnitTestFrameworkPkg" - ArchList: "IA32,X64" - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - cache: 'pip' - cache-dependency-path: 'pip-requirements.txt' - - - name: Use Git Long Paths on Windows - if: runner.os == 'Windows' - shell: pwsh - run: | - git config --system core.longpaths true - - - name: Install/Upgrade pip Modules - run: pip install -r pip-requirements.txt --upgrade requests sarif-tools - - - name: Determine CI Settings File Supported Operations - id: get_ci_file_operations - shell: python - run: | - import importlib - import os - import sys - from pathlib import Path - from edk2toolext.invocables.edk2_ci_setup import CiSetupSettingsManager - from edk2toolext.invocables.edk2_setup import SetupSettingsManager - - # Find the repo CI Settings file - ci_settings_file = list(Path(os.environ['GITHUB_WORKSPACE']).rglob('.pytool/CISettings.py')) - - # Note: At this point, submodules have not been pulled, only one CI Settings file should exist - if len(ci_settings_file) != 1 or not ci_settings_file[0].is_file(): - print("::error title=Workspace Error!::Failed to find CI Settings file!") - sys.exit(1) - - ci_settings_file = ci_settings_file[0] - - # Try Finding the Settings class in the file - module_name = 'ci_settings' - - spec = importlib.util.spec_from_file_location(module_name, ci_settings_file) - module = importlib.util.module_from_spec(spec) - spec.loader.exec_module(module) - - try: - settings = getattr(module, 'Settings') - except AttributeError: - print("::error title=Workspace Error!::Failed to find Settings class in CI Settings file!") - sys.exit(1) - - # Determine Which Operations Are Supported by the Settings Class - ci_setup_supported = issubclass(settings, CiSetupSettingsManager) - setup_supported = issubclass(settings, SetupSettingsManager) - - with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: - print(f'ci_setup_supported={str(ci_setup_supported).lower()}', file=fh) - print(f'setup_supported={str(setup_supported).lower()}', file=fh) - - - name: Convert Arch to Log Format - id: convert_arch_hyphen - env: - ARCH_LIST: ${{ matrix.ArchList }} - shell: python - run: | - import os - - with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: - print(f'arch_list={os.environ["ARCH_LIST"].replace(",", "-")}', file=fh) - - - 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 - - - name: Upload Setup Log As An Artifact - uses: actions/upload-artifact@v4 - if: (success() || failure()) && steps.get_ci_file_operations.outputs.setup_supported == 'true' - with: - name: ${{ matrix.Package }}-${{ steps.convert_arch_hyphen.outputs.arch_list }}-Setup-Log - path: | - **/SETUPLOG.txt - retention-days: 7 - if-no-files-found: ignore - - - 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 - - - name: Upload CI Setup Log As An Artifact - uses: actions/upload-artifact@v4 - if: (success() || failure()) && steps.get_ci_file_operations.outputs.ci_setup_supported == 'true' - with: - name: ${{ matrix.Package }}-${{ steps.convert_arch_hyphen.outputs.arch_list }}-CI-Setup-Log - path: | - **/CISETUP.txt - retention-days: 7 - if-no-files-found: ignore - - - name: Update - run: stuart_update -c .pytool/CISettings.py -t DEBUG -a ${{ matrix.ArchList }} TOOL_CHAIN_TAG=VS2019 - - - name: Upload Update Log As An Artifact - uses: actions/upload-artifact@v4 - if: success() || failure() - with: - name: ${{ matrix.Package }}-${{ steps.convert_arch_hyphen.outputs.arch_list }}-Update-Log - path: | - **/UPDATE_LOG.txt - retention-days: 7 - if-no-files-found: ignore - - - name: Build Tools From Source - run: python BaseTools/Edk2ToolsBuild.py -t VS2019 - - - name: Find CodeQL Plugin Directory - id: find_dir - shell: python - run: | - import os - import sys - from pathlib import Path - - # Find the plugin directory that contains the CodeQL plugin - plugin_dir = list(Path(os.environ['GITHUB_WORKSPACE']).rglob('BaseTools/Plugin/CodeQL')) - - # This should only be found once - if len(plugin_dir) == 1: - plugin_dir = str(plugin_dir[0]) - - with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: - print(f'codeql_plugin_dir={plugin_dir}', file=fh) - else: - print("::error title=Workspace Error!::Failed to find CodeQL plugin directory!") - sys.exit(1) - - - name: Get CodeQL CLI Cache Data - id: cache_key_gen - env: - CODEQL_PLUGIN_DIR: ${{ steps.find_dir.outputs.codeql_plugin_dir }} - shell: python - run: | - import os - import yaml - - codeql_cli_ext_dep_name = 'codeqlcli_windows_ext_dep' - codeql_plugin_file = os.path.join(os.environ['CODEQL_PLUGIN_DIR'], codeql_cli_ext_dep_name + '.yaml') - - with open (codeql_plugin_file) as pf: - codeql_cli_ext_dep = yaml.safe_load(pf) - - cache_key_name = codeql_cli_ext_dep['name'] - cache_key_version = codeql_cli_ext_dep['version'] - cache_key = f'{cache_key_name}-{cache_key_version}' - - codeql_plugin_cli_ext_dep_dir = os.path.join(os.environ['CODEQL_PLUGIN_DIR'], codeql_cli_ext_dep['name'].strip() + '_extdep') - - with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: - print(f'codeql_cli_cache_key={cache_key}', file=fh) - print(f'codeql_cli_ext_dep_dir={codeql_plugin_cli_ext_dep_dir}', file=fh) - - - name: Attempt to Load CodeQL CLI From Cache - id: codeqlcli_cache - uses: actions/cache@v4 - with: - path: ${{ steps.cache_key_gen.outputs.codeql_cli_ext_dep_dir }} - key: ${{ steps.cache_key_gen.outputs.codeql_cli_cache_key }} - - - 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 - - - name: Remove CI Plugins Irrelevant to CodeQL - shell: python - env: - CODEQL_PLUGIN_DIR: ${{ steps.find_dir.outputs.codeql_plugin_dir }} - run: | - import os - import shutil - from pathlib import Path - - # Only these two plugins are needed for CodeQL - plugins_to_keep = ['CompilerPlugin'] - - plugin_dir = Path('.pytool/Plugin').absolute() - if plugin_dir.is_dir(): - for dir in plugin_dir.iterdir(): - if str(dir.stem) not in plugins_to_keep: - shutil.rmtree(str(dir.absolute()), ignore_errors=True) - - - 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 - - - name: Build Cleanup - id: build_cleanup - shell: python - run: | - import os - import shutil - from pathlib import Path - - dirs_to_delete = ['ia32', 'x64', 'arm', 'aarch64'] - - def delete_dirs(path: Path): - if path.exists() and path.is_dir(): - if path.name.lower() in dirs_to_delete: - print(f'Removed {str(path)}') - shutil.rmtree(path) - return - - for child_dir in path.iterdir(): - delete_dirs(child_dir) - - build_path = Path(os.environ['GITHUB_WORKSPACE'], 'Build') - delete_dirs(build_path) - - - name: Upload Build Logs As An Artifact - uses: actions/upload-artifact@v4 - if: success() || failure() - with: - name: ${{ matrix.Package }}-${{ steps.convert_arch_hyphen.outputs.arch_list }}-Build-Logs - path: | - **/BUILD_REPORT.TXT - **/OVERRIDELOG.TXT - **/BUILDLOG_*.md - **/BUILDLOG_*.txt - **/CI_*.md - **/CI_*.txt - retention-days: 7 - if-no-files-found: ignore - - - name: Prepare Env Data for CodeQL Upload - id: env_data - env: - PACKAGE_NAME: ${{ matrix.Package }} - shell: python - run: | - import logging - import os - from edk2toollib.utility_functions import RunCmd - from io import StringIO - from pathlib import Path - - package = os.environ['PACKAGE_NAME'].strip().lower() - directory_name = 'codeql-analysis-' + package + '-debug' - file_name = 'codeql-db-' + package + '-debug-0.sarif' - sarif_path = Path('Build', directory_name, file_name) - - with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: - if sarif_path.is_file(): - emacs_file_path = sarif_path.with_name(sarif_path.stem + "-emacs.txt") - out_stream_buffer = StringIO() - exit_code = RunCmd("sarif", f"emacs {sarif_path} --output {emacs_file_path} --no-autotrim", - outstream=out_stream_buffer, - logging_level=logging.NOTSET) - print(f'upload_sarif_file=true', file=fh) - print(f'emacs_file_path={emacs_file_path}', file=fh) - print(f'sarif_file_path={sarif_path}', file=fh) - else: - print(f'upload_sarif_file=false', file=fh) - - - name: Upload CodeQL Results (SARIF) As An Artifact - uses: actions/upload-artifact@v4 - if: steps.env_data.outputs.upload_sarif_file == 'true' - with: - name: ${{ matrix.Package }}-${{ steps.convert_arch_hyphen.outputs.arch_list }}-CodeQL-SARIF - path: | - ${{ steps.env_data.outputs.emacs_file_path }} - ${{ steps.env_data.outputs.sarif_file_path }} - retention-days: 14 - if-no-files-found: warn - - - name: Upload CodeQL Results (SARIF) To GitHub Code Scanning - uses: github/codeql-action/upload-sarif@v3 - if: steps.env_data.outputs.upload_sarif_file == 'true' - with: - # Path to SARIF file relative to the root of the repository. - sarif_file: ${{ steps.env_data.outputs.sarif_file_path }} - # Optional category for the results. Used to differentiate multiple results for one commit. - # Each package is a separate category. - category: ${{ matrix.Package }} diff --git a/.github/workflows/pr-labeler.yml b/.github/workflows/pr-labeler.yml deleted file mode 100644 index b98489808454..000000000000 --- a/.github/workflows/pr-labeler.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This workflow automatically applies labels to pull requests based on regular expression matches against the content -# in the pull request. -# -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -# For more information, see: -# https://github.com/github/issue-labeler - -name: Apply Labels Based on Message Content - -on: - pull_request_target: - types: - - edited - - opened - - reopened - - synchronize - workflow_dispatch: - -jobs: - sync: - name: Label PR from Description - runs-on: ubuntu-latest - - permissions: - contents: read - pull-requests: write - - steps: - - name: Apply Labels Based on PR Description - uses: github/issue-labeler@v3.4 - with: - configuration-path: .github/workflows/pr-labeler/regex.yml - enable-versioned-regex: 0 - repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/request-reviews.yml b/.github/workflows/request-reviews.yml deleted file mode 100644 index e5db19ca088d..000000000000 --- a/.github/workflows/request-reviews.yml +++ /dev/null @@ -1,73 +0,0 @@ - -# This workflow automatically adds the appropriate reviewers to a pull request. -# -# The workflow directly reuses logic in the BaseTools/Scripts/GetMaintainer.py script -# to determine the appropriate reviewers, so it matches what a user would see running -# the script locally. -# -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: BSD-2-Clause-Patent - -name: Add Pull Request Reviewers - -on: - pull_request_target: - branches: - - master - types: [opened, ready_for_review, reopened, synchronize] - -env: - GET_MAINTAINER_REL_PATH: "BaseTools/Scripts/GetMaintainer.py" - -jobs: - auto-request-review: - name: Add Pull Request Reviewers - # Do not run on draft PRs and only run on PRs in the tianocore organization - if: ${{ github.event.pull_request.draft == false && github.repository_owner == 'tianocore' }} - runs-on: ubuntu-latest - - permissions: - contents: read - issues: write - pull-requests: write - - steps: - - name: Generate Token - id: generate-token - uses: actions/create-github-app-token@v1 - with: - app-id: ${{ secrets.TIANOCORE_ASSIGN_REVIEWERS_APPLICATION_ID }} - private-key: ${{ secrets.TIANOCORE_ASSIGN_REVIEWERS_APPLICATION_PRIVATE_KEY }} - - # Reduce checkout time with sparse-checkout - # - .github: Contains the scripts to interact with Github and add reviewers - # - BaseTools/Scripts: Contains the GetMaintainer.py script - # - Maintainers.txt: Contains the list of maintainers for the repository - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 1 - sparse-checkout: | - .github - BaseTools/Scripts - Maintainers.txt - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - cache: 'pip' - cache-dependency-path: '.github/scripts/requirements.txt' - - - name: Install PIP Modules - run: pip install -r .github/scripts/requirements.txt --upgrade - - - name: Add Reviewers to Pull Request - env: - GH_TOKEN: ${{ steps.generate-token.outputs.token }} - ORG_NAME: ${{ github.repository_owner }} - PR_NUMBER: ${{ github.event.number}} - REPO_NAME: ${{ github.event.pull_request.base.repo.name }} - TARGET_BRANCH: ${{ github.event.pull_request.base.ref }} - WORKSPACE_PATH: ${{ github.workspace }} - run: python .github/scripts/RequestPrReviewers.py diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index b9160b548ab3..000000000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,44 +0,0 @@ -# This workflow warns and then closes issues and PRs that have had no activity -# for a specified amount of time. -# -# For more information, see: -# https://github.com/actions/stale -# -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: BSD-2-Clause-Patent -# - -name: Stale Check - -on: - schedule: - # At 23:35 on every day-of-week from Sunday through Saturday - # https://crontab.guru/#35_23_*_*_0-6 - - cron: '35 23 * * 0-6' - workflow_dispatch: - -jobs: - stale: - name: Stale - runs-on: ubuntu-latest - permissions: - issues: write - pull-requests: write - - steps: - - name: Check for Stale Items - uses: actions/stale@v8 - with: - days-before-issue-close: -1 - days-before-issue-stale: -1 - days-before-pr-stale: 60 - days-before-pr-close: 7 - stale-pr-message: > - This PR has been automatically marked as stale because it has not had - activity in 60 days. It will be closed if no further activity occurs within - 7 days. Thank you for your contributions. - close-pr-message: > - This pull request has been automatically been closed because it did not have any - activity in 60 days and no follow up within 7 days after being marked stale. - Thank you for your contributions. - stale-pr-label: stale diff --git a/.pytool/Plugin/UncrustifyCheck/uncrustify_ext_dep.yaml b/.pytool/Plugin/UncrustifyCheck/uncrustify_ext_dep.yaml deleted file mode 100644 index 74f3ffe41acf..000000000000 --- a/.pytool/Plugin/UncrustifyCheck/uncrustify_ext_dep.yaml +++ /dev/null @@ -1,16 +0,0 @@ -## @file -# Downloads the Uncrustify application from a Project Mu NuGet package. -# -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: BSD-2-Clause-Patent -## -{ - "id": "uncrustify-ci-1", - "scope": "cibuild", - "type": "nuget", - "name": "mu-uncrustify-release", - "source": "https://pkgs.dev.azure.com/projectmu/Uncrustify/_packaging/mu_uncrustify/nuget/v3/index.json", - "version": "73.0.8", - "flags": ["set_shell_var", "host_specific"], - "var_name": "UNCRUSTIFY_CI_PATH" -} diff --git a/ArmVirtPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml b/ArmVirtPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml index ab8a2db53026..46a081d14d86 100644 --- a/ArmVirtPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml +++ b/ArmVirtPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml @@ -2,8 +2,8 @@ # Azure Pipeline build file for building a platform. # # Platform: ArmVirtQemu -# OS: Ubuntu -# Toolchain: GCC5 +# OS: macOS +# Toolchain: XCODE5 # # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -22,7 +22,7 @@ jobs: - job: Platform_CI variables: package: 'ArmVirtPkg' - vm_image: 'ubuntu-22.04' + vm_image: 'macOS-14' should_run: true run_flags: "MAKE_STARTUP_NSH=TRUE QEMU_HEADLESS=TRUE" @@ -159,16 +159,14 @@ jobs: pool: vmImage: $(vm_image) - container: ${{ variables.default_linux_image }} - steps: - template: ../../../.azurepipelines/templates/platform-build-run-steps.yml parameters: - tool_chain_tag: GCC5 + tool_chain_tag: XCODE5 build_pkg: $(package) build_target: $(Build.Target) build_arch: $(Build.Arch) build_file: $(Build.File) build_flags: $(Build.Flags) run_flags: $(Run.Flags) - usePythonVersion: '' # use Python from the container image + usePythonVersion: '' # use default Python from the vm image diff --git a/ArmVirtPkg/PlatformCI/iasl_ext_dep.yaml b/ArmVirtPkg/PlatformCI/iasl_ext_dep.yaml deleted file mode 100644 index 8869ed3ecef1..000000000000 --- a/ArmVirtPkg/PlatformCI/iasl_ext_dep.yaml +++ /dev/null @@ -1,21 +0,0 @@ -## @file -# Download iasl executable tool from a nuget.org package -# - package contains different binaries based on host -# Add the folder with the tool to the path -# -# This is only downloaded for scope armvirt thus -# should have no impact on the asl compiler used by any -# other platform build -# -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: BSD-2-Clause-Patent -## -{ - "id": "iasl-armvirt-1", - "scope": "armvirt", - "type": "nuget", - "name": "iasl", - "source": "https://api.nuget.org/v3/index.json", - "version": "20190215.0.0", - "flags": ["set_path", "host_specific"], -} diff --git a/BaseTools/Bin/iasl_ext_dep.yaml b/BaseTools/Bin/iasl_ext_dep.yaml deleted file mode 100644 index ea2bc315d184..000000000000 --- a/BaseTools/Bin/iasl_ext_dep.yaml +++ /dev/null @@ -1,21 +0,0 @@ -## @file -# Download iasl executable tool from a nuget.org package -# - package contains different binaries based on host -# Add the folder with the tool to the path -# -# This is only downloaded for scope cibuild thus -# should have no impact on the asl compiler used by any -# given platform to build. -# -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: BSD-2-Clause-Patent -## -{ - "id": "iasl-ci-1", - "scope": "cibuild", - "type": "nuget", - "name": "edk2-acpica-iasl", - "source": "https://pkgs.dev.azure.com/projectmu/acpica/_packaging/mu_iasl/nuget/v3/index.json", - "version": "20200717.0.0", - "flags": ["set_path", "host_specific"] -} diff --git a/BaseTools/Bin/nasm_ext_dep.yaml b/BaseTools/Bin/nasm_ext_dep.yaml deleted file mode 100644 index 56703d4c18e7..000000000000 --- a/BaseTools/Bin/nasm_ext_dep.yaml +++ /dev/null @@ -1,18 +0,0 @@ -## @file -# Download nasm x86 assembler executable tool from a nuget.org package -# - package contains different binaries based on host -# Put on the tool on the path -# -# -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: BSD-2-Clause-Patent -## -{ - "id": "nasm-1", - "scope": "edk2-build", - "type": "nuget", - "name": "mu_nasm", - "source": "https://api.nuget.org/v3/index.json", - "version": "2.15.5", - "flags": ["set_path", "host_specific"] -} diff --git a/BaseTools/Edk2ToolsBuild.py b/BaseTools/Edk2ToolsBuild.py old mode 100644 new mode 100755 index 425bb1b63963..598446625699 --- a/BaseTools/Edk2ToolsBuild.py +++ b/BaseTools/Edk2ToolsBuild.py @@ -1,7 +1,7 @@ # @file Edk2ToolsBuild.py # Invocable class that builds the basetool c files. # -# Supports VS2017, VS2019, and GCC5 +# Supports VS2017, VS2019, GCC5 and XCODE5 ## # Copyright (c) Microsoft Corporation # @@ -146,7 +146,7 @@ def Go(self): self.WritePathEnvFile(self.OutputDir) return ret - elif self.tool_chain_tag.lower().startswith("gcc"): + elif self.tool_chain_tag.lower().startswith("gcc") or self.tool_chain_tag.lower().startswith("xcode"): cpu_count = self.GetCpuThreads() output_stream = edk2_logging.create_output_stream() diff --git a/BaseTools/Source/C/Common/Decompress.c b/BaseTools/Source/C/Common/Decompress.c index 0f2bdbffa72e..0cf0c4a0a8e5 100644 --- a/BaseTools/Source/C/Common/Decompress.c +++ b/BaseTools/Source/C/Common/Decompress.c @@ -15,7 +15,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent // // Decompression algorithm begins here // +#ifndef UINT8_MAX #define UINT8_MAX 0xff +#endif #define BITBUFSIZ 32 #define MAXMATCH 256 #define THRESHOLD 3 diff --git a/BaseTools/Source/Python/Ecc/Check.py b/BaseTools/Source/Python/Ecc/Check.py index 4561961141d4..160e803764fe 100644 --- a/BaseTools/Source/Python/Ecc/Check.py +++ b/BaseTools/Source/Python/Ecc/Check.py @@ -1092,7 +1092,7 @@ def MetaDataFileCheckModuleFileNoUse(self): RecordSet = EccGlobalData.gDb.TblInf.Exec(SqlCommand) for Record in RecordSet: Path = Record[1] - Path = Path.upper().replace('\X64', '').replace('\IA32', '').replace('\EBC', '').replace('\IPF', '').replace('\ARM', '') + Path = Path.upper().replace(r'\X64', '').replace(r'\IA32', '').replace(r'\EBC', '').replace(r'\IPF', '').replace(r'\ARM', '') if Path in InfPathList: if not EccGlobalData.gException.IsException(ERROR_META_DATA_FILE_CHECK_MODULE_FILE_NO_USE, Record[2]): EccGlobalData.gDb.TblReport.Insert(ERROR_META_DATA_FILE_CHECK_MODULE_FILE_NO_USE, OtherMsg="The source file [%s] is existing in module directory but it is not described in INF file." % (Record[2]), BelongsToTable='File', BelongsToItem=Record[0]) diff --git a/BaseTools/Source/Python/Ecc/Configuration.py b/BaseTools/Source/Python/Ecc/Configuration.py index d4aab1d1310b..9a9ca49eee41 100644 --- a/BaseTools/Source/Python/Ecc/Configuration.py +++ b/BaseTools/Source/Python/Ecc/Configuration.py @@ -432,7 +432,7 @@ def ShowMe(self): # test that our dict and out class still match in contents. # if __name__ == '__main__': - myconfig = Configuration("BaseTools\Source\Python\Ecc\config.ini") + myconfig = Configuration(r"BaseTools\Source\Python\Ecc\config.ini") for each in myconfig.__dict__: if each == "Filename": continue diff --git a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py index 2d98ac5eadb2..2ef2847b1ba9 100644 --- a/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py +++ b/BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py @@ -1841,14 +1841,14 @@ def _PcdParser(self): if EccGlobalData.gConfig.UniCheckPCDInfo == '1' or EccGlobalData.gConfig.UniCheckAll == '1' or EccGlobalData.gConfig.CheckAll == '1': # check Description, Prompt information - PatternDesc = re.compile('##\s*([\x21-\x7E\s]*)', re.S) - PatternPrompt = re.compile('#\s+@Prompt\s+([\x21-\x7E\s]*)', re.S) + PatternDesc = re.compile(r'##\s*([\x21-\x7E\s]*)', re.S) + PatternPrompt = re.compile(r'#\s+@Prompt\s+([\x21-\x7E\s]*)', re.S) Description = None Prompt = None # check @ValidRange, @ValidList and @Expression format valid ErrorCodeValid = '0x0 <= %s <= 0xFFFFFFFF' - PatternValidRangeIn = '(NOT)?\s*(\d+\s*-\s*\d+|0[xX][a-fA-F0-9]+\s*-\s*0[xX][a-fA-F0-9]+|LT\s*\d+|LT\s*0[xX][a-fA-F0-9]+|GT\s*\d+|GT\s*0[xX][a-fA-F0-9]+|LE\s*\d+|LE\s*0[xX][a-fA-F0-9]+|GE\s*\d+|GE\s*0[xX][a-fA-F0-9]+|XOR\s*\d+|XOR\s*0[xX][a-fA-F0-9]+|EQ\s*\d+|EQ\s*0[xX][a-fA-F0-9]+)' - PatternValidRng = re.compile('^' + '(NOT)?\s*' + PatternValidRangeIn + '$') + PatternValidRangeIn = r'(NOT)?\s*(\d+\s*-\s*\d+|0[xX][a-fA-F0-9]+\s*-\s*0[xX][a-fA-F0-9]+|LT\s*\d+|LT\s*0[xX][a-fA-F0-9]+|GT\s*\d+|GT\s*0[xX][a-fA-F0-9]+|LE\s*\d+|LE\s*0[xX][a-fA-F0-9]+|GE\s*\d+|GE\s*0[xX][a-fA-F0-9]+|XOR\s*\d+|XOR\s*0[xX][a-fA-F0-9]+|EQ\s*\d+|EQ\s*0[xX][a-fA-F0-9]+)' + PatternValidRng = re.compile('^' + r'(NOT)?\s*' + PatternValidRangeIn + '$') for Comment in self._Comments: Comm = Comment[0].strip() if not Comm: @@ -2071,7 +2071,7 @@ def Start(self): def CheckKeyValid(self, Key, Contents=None): if not Contents: Contents = self.FileIn - KeyPattern = re.compile('#string\s+%s\s+.*?#language.*?".*?"' % Key, re.S) + KeyPattern = re.compile(r'#string\s+%s\s+.*?#language.*?".*?"' % Key, re.S) if KeyPattern.search(Contents): return True return False diff --git a/BaseTools/Source/Python/Ecc/c.py b/BaseTools/Source/Python/Ecc/c.py index 61ad084fcc5b..0ebdc1a99605 100644 --- a/BaseTools/Source/Python/Ecc/c.py +++ b/BaseTools/Source/Python/Ecc/c.py @@ -43,7 +43,7 @@ def GetArrayPattern(): return p def GetTypedefFuncPointerPattern(): - p = re.compile('[_\w\s]*\([\w\s]*\*+\s*[_\w]+\s*\)\s*\(.*\)', re.DOTALL) + p = re.compile(r'[_\w\s]*\([\w\s]*\*+\s*[_\w]+\s*\)\s*\(.*\)', re.DOTALL) return p def GetDB(): diff --git a/BaseTools/Source/Python/Eot/EotGlobalData.py b/BaseTools/Source/Python/Eot/EotGlobalData.py index 3218f86f441c..887a7a259545 100644 --- a/BaseTools/Source/Python/Eot/EotGlobalData.py +++ b/BaseTools/Source/Python/Eot/EotGlobalData.py @@ -11,7 +11,7 @@ gEFI_SOURCE = '' gEDK_SOURCE = '' gWORKSPACE = '' -gSHELL_INF = 'Application\Shell' +gSHELL_INF = r'Application\Shell' gMAKE_FILE = '' gDSC_FILE = '' gFV_FILE = [] diff --git a/BaseTools/Source/Python/Eot/c.py b/BaseTools/Source/Python/Eot/c.py index dd9530fed6d0..a85564d60030 100644 --- a/BaseTools/Source/Python/Eot/c.py +++ b/BaseTools/Source/Python/Eot/c.py @@ -54,7 +54,7 @@ def GetArrayPattern(): # @return p: the pattern of function pointer # def GetTypedefFuncPointerPattern(): - p = re.compile('[_\w\s]*\([\w\s]*\*+\s*[_\w]+\s*\)\s*\(.*\)', re.DOTALL) + p = re.compile(r'[_\w\s]*\([\w\s]*\*+\s*[_\w]+\s*\)\s*\(.*\)', re.DOTALL) return p ## GetDB() method diff --git a/BaseTools/Source/Python/UPT/Library/CommentParsing.py b/BaseTools/Source/Python/UPT/Library/CommentParsing.py index 7ba9830d34ac..7b1ce05493c1 100644 --- a/BaseTools/Source/Python/UPT/Library/CommentParsing.py +++ b/BaseTools/Source/Python/UPT/Library/CommentParsing.py @@ -238,7 +238,7 @@ def ParseDecPcdGenericComment (GenericComment, ContainerFile, TokenSpaceGuidCNam # # To replace Macro # - MACRO_PATTERN = '[\t\s]*\$\([A-Z][_A-Z0-9]*\)' + MACRO_PATTERN = r'[\t\s]*\$\([A-Z][_A-Z0-9]*\)' MatchedStrs = re.findall(MACRO_PATTERN, Comment) for MatchedStr in MatchedStrs: if MatchedStr: diff --git a/BaseTools/Source/Python/UPT/Library/ExpressionValidate.py b/BaseTools/Source/Python/UPT/Library/ExpressionValidate.py index 7718ca12e5cf..2c0750efe45d 100644 --- a/BaseTools/Source/Python/UPT/Library/ExpressionValidate.py +++ b/BaseTools/Source/Python/UPT/Library/ExpressionValidate.py @@ -66,13 +66,13 @@ def __init__(self, Error = ''): ## _ExprBase # class _ExprBase: - HEX_PATTERN = '[\t\s]*0[xX][a-fA-F0-9]+' - INT_PATTERN = '[\t\s]*[0-9]+' - MACRO_PATTERN = '[\t\s]*\$\(([A-Z][_A-Z0-9]*)\)' + HEX_PATTERN = r'[\t\s]*0[xX][a-fA-F0-9]+' + INT_PATTERN = r'[\t\s]*[0-9]+' + MACRO_PATTERN = r'[\t\s]*\$\(([A-Z][_A-Z0-9]*)\)' PCD_PATTERN = \ - '[\t\s]*[_a-zA-Z][a-zA-Z0-9_]*[\t\s]*\.[\t\s]*[_a-zA-Z][a-zA-Z0-9_]*' - QUOTED_PATTERN = '[\t\s]*L?"[^"]*"' - BOOL_PATTERN = '[\t\s]*(true|True|TRUE|false|False|FALSE)' + r'[\t\s]*[_a-zA-Z][a-zA-Z0-9_]*[\t\s]*\.[\t\s]*[_a-zA-Z][a-zA-Z0-9_]*' + QUOTED_PATTERN = r'[\t\s]*L?"[^"]*"' + BOOL_PATTERN = r'[\t\s]*(true|True|TRUE|false|False|FALSE)' def __init__(self, Token): self.Token = Token self.Index = 0 @@ -303,9 +303,9 @@ def IsValidLogicalExpression(self): ## _ValidRangeExpressionParser # class _ValidRangeExpressionParser(_ExprBase): - INT_RANGE_PATTERN = '[\t\s]*[0-9]+[\t\s]*-[\t\s]*[0-9]+' + INT_RANGE_PATTERN = r'[\t\s]*[0-9]+[\t\s]*-[\t\s]*[0-9]+' HEX_RANGE_PATTERN = \ - '[\t\s]*0[xX][a-fA-F0-9]+[\t\s]*-[\t\s]*0[xX][a-fA-F0-9]+' + r'[\t\s]*0[xX][a-fA-F0-9]+[\t\s]*-[\t\s]*0[xX][a-fA-F0-9]+' def __init__(self, Token): _ExprBase.__init__(self, Token) self.Parens = 0 @@ -407,7 +407,7 @@ def ValidRange(self): ## _ValidListExpressionParser # class _ValidListExpressionParser(_ExprBase): - VALID_LIST_PATTERN = '(0[xX][0-9a-fA-F]+|[0-9]+)([\t\s]*,[\t\s]*(0[xX][0-9a-fA-F]+|[0-9]+))*' + VALID_LIST_PATTERN = r'(0[xX][0-9a-fA-F]+|[0-9]+)([\t\s]*,[\t\s]*(0[xX][0-9a-fA-F]+|[0-9]+))*' def __init__(self, Token): _ExprBase.__init__(self, Token) self.NUM = 1 diff --git a/BaseTools/Source/Python/UPT/Library/Misc.py b/BaseTools/Source/Python/UPT/Library/Misc.py index 77ba3584e000..f3688de4b1b7 100644 --- a/BaseTools/Source/Python/UPT/Library/Misc.py +++ b/BaseTools/Source/Python/UPT/Library/Misc.py @@ -69,11 +69,11 @@ def GuidStringToGuidStructureString(Guid): def CheckGuidRegFormat(GuidValue): ## Regular expression used to find out register format of GUID # - RegFormatGuidPattern = re.compile("^\s*([0-9a-fA-F]){8}-" + RegFormatGuidPattern = re.compile(r"^\s*([0-9a-fA-F]){8}-" "([0-9a-fA-F]){4}-" "([0-9a-fA-F]){4}-" "([0-9a-fA-F]){4}-" - "([0-9a-fA-F]){12}\s*$") + r"([0-9a-fA-F]){12}\s*$") if RegFormatGuidPattern.match(GuidValue): return True @@ -837,8 +837,8 @@ def GetLibInstanceInfo(String, WorkSpace, LineNo): ST.ERR_FILE_OPEN_FAILURE, File=FullFileName) - ReFileGuidPattern = re.compile("^\s*FILE_GUID\s*=.*$") - ReVerStringPattern = re.compile("^\s*VERSION_STRING\s*=.*$") + ReFileGuidPattern = re.compile(r"^\s*FILE_GUID\s*=.*$") + ReVerStringPattern = re.compile(r"^\s*VERSION_STRING\s*=.*$") FileLinesList = ProcessLineExtender(FileLinesList) @@ -978,7 +978,7 @@ def ValidateUNIFilePath(Path): # # Check if the file name is valid according to the DEC and INF specification # - Pattern = '[a-zA-Z0-9_][a-zA-Z0-9_\-\.]*' + Pattern = r'[a-zA-Z0-9_][a-zA-Z0-9_\-\.]*' FileName = Path.replace(Suffix, '') InvalidCh = re.sub(Pattern, '', FileName) if InvalidCh: diff --git a/BaseTools/Source/Python/UPT/Library/StringUtils.py b/BaseTools/Source/Python/UPT/Library/StringUtils.py index fbc5177caf5a..a6f47d0dd79b 100644 --- a/BaseTools/Source/Python/UPT/Library/StringUtils.py +++ b/BaseTools/Source/Python/UPT/Library/StringUtils.py @@ -23,7 +23,7 @@ # # Regular expression for matching macro used in DSC/DEC/INF file inclusion # -gMACRO_PATTERN = re.compile("\$\(([_A-Z][_A-Z0-9]*)\)", re.UNICODE) +gMACRO_PATTERN = re.compile(r"\$\(([_A-Z][_A-Z0-9]*)\)", re.UNICODE) ## GetSplitValueList # diff --git a/BaseTools/Source/Python/UPT/Parser/DecParserMisc.py b/BaseTools/Source/Python/UPT/Parser/DecParserMisc.py index 27990467d1c5..92dbcaaabeb0 100644 --- a/BaseTools/Source/Python/UPT/Parser/DecParserMisc.py +++ b/BaseTools/Source/Python/UPT/Parser/DecParserMisc.py @@ -25,7 +25,7 @@ from Library.Misc import CheckGuidRegFormat TOOL_NAME = 'DecParser' -VERSION_PATTERN = '[0-9]+(\.[0-9]+)?' +VERSION_PATTERN = r'[0-9]+(\.[0-9]+)?' CVAR_PATTERN = '[_a-zA-Z][a-zA-Z0-9_]*' PCD_TOKEN_PATTERN = '(0[xX]0*[a-fA-F0-9]{1,8})|([0-9]+)' MACRO_PATTERN = '[A-Z][_A-Z0-9]*' diff --git a/BaseTools/Source/Python/UPT/Parser/InfAsBuiltProcess.py b/BaseTools/Source/Python/UPT/Parser/InfAsBuiltProcess.py index 992b609120f8..fb646191b186 100644 --- a/BaseTools/Source/Python/UPT/Parser/InfAsBuiltProcess.py +++ b/BaseTools/Source/Python/UPT/Parser/InfAsBuiltProcess.py @@ -53,12 +53,12 @@ def GetLibInstanceInfo(String, WorkSpace, LineNo, CurrentInfFileName): # # To deal with library instance specified by GUID and version # - RegFormatGuidPattern = re.compile("\s*([0-9a-fA-F]){8}-" + RegFormatGuidPattern = re.compile(r"\s*([0-9a-fA-F]){8}-" "([0-9a-fA-F]){4}-" "([0-9a-fA-F]){4}-" "([0-9a-fA-F]){4}-" - "([0-9a-fA-F]){12}\s*") - VersionPattern = re.compile('[\t\s]*\d+(\.\d+)?[\t\s]*') + r"([0-9a-fA-F]){12}\s*") + VersionPattern = re.compile(r'[\t\s]*\d+(\.\d+)?[\t\s]*') GuidMatchedObj = RegFormatGuidPattern.search(String) if String.upper().startswith('GUID') and GuidMatchedObj and 'Version' in String: @@ -75,8 +75,8 @@ def GetLibInstanceInfo(String, WorkSpace, LineNo, CurrentInfFileName): FileLinesList = GetFileLineContent(String, WorkSpace, LineNo, OriginalString) - ReFindFileGuidPattern = re.compile("^\s*FILE_GUID\s*=.*$") - ReFindVerStringPattern = re.compile("^\s*VERSION_STRING\s*=.*$") + ReFindFileGuidPattern = re.compile(r"^\s*FILE_GUID\s*=.*$") + ReFindVerStringPattern = re.compile(r"^\s*VERSION_STRING\s*=.*$") for Line in FileLinesList: if ReFindFileGuidPattern.match(Line): @@ -106,8 +106,8 @@ def GetPackageListInfo(FileNameString, WorkSpace, LineNo): FileLinesList = GetFileLineContent(FileNameString, WorkSpace, LineNo, '') - RePackageHeader = re.compile('^\s*\[Packages.*\].*$') - ReDefineHeader = re.compile('^\s*\[Defines].*$') + RePackageHeader = re.compile(r'^\s*\[Packages.*\].*$') + ReDefineHeader = re.compile(r'^\s*\[Defines].*$') PackageHederFlag = False DefineHeaderFlag = False @@ -255,8 +255,8 @@ def GetGuidVerFormLibInstance(Guid, Version, WorkSpace, CurrentInfFileName): FileLinesList = InfFileObj.readlines() FileLinesList = ProcessLineExtender(FileLinesList) - ReFindFileGuidPattern = re.compile("^\s*FILE_GUID\s*=.*$") - ReFindVerStringPattern = re.compile("^\s*VERSION_STRING\s*=.*$") + ReFindFileGuidPattern = re.compile(r"^\s*FILE_GUID\s*=.*$") + ReFindVerStringPattern = re.compile(r"^\s*VERSION_STRING\s*=.*$") for Line in FileLinesList: if ReFindFileGuidPattern.match(Line): diff --git a/BaseTools/Source/Python/UPT/Parser/InfDefineSectionParser.py b/BaseTools/Source/Python/UPT/Parser/InfDefineSectionParser.py index a63e40e61787..9edcc2cb3f4c 100644 --- a/BaseTools/Source/Python/UPT/Parser/InfDefineSectionParser.py +++ b/BaseTools/Source/Python/UPT/Parser/InfDefineSectionParser.py @@ -40,7 +40,7 @@ def GetValidateArchList(LineContent): TempArch = GetSplitValueList(TempArch, '(', 1)[0] - ArchList = re.split('\s+', TempArch) + ArchList = re.split(r'\s+', TempArch) NewArchList = [] for Arch in ArchList: if IsValidArch(Arch): diff --git a/BaseTools/Source/Python/UPT/Parser/InfParserMisc.py b/BaseTools/Source/Python/UPT/Parser/InfParserMisc.py index d01ae9aa0246..eb768b9a1241 100644 --- a/BaseTools/Source/Python/UPT/Parser/InfParserMisc.py +++ b/BaseTools/Source/Python/UPT/Parser/InfParserMisc.py @@ -109,7 +109,7 @@ def InfExpandMacro(Content, LineInfo, GlobalMacros=None, SectionMacros=None, Fla return Content else: for Macro in MacroUsed: - gQuotedMacro = re.compile(".*\".*\$\(%s\).*\".*"%(Macro)) + gQuotedMacro = re.compile(r".*\".*\$\(%s\).*\".*"%(Macro)) if not gQuotedMacro.match(Content): # # Still have MACROs can't be expanded. @@ -130,8 +130,8 @@ def IsBinaryInf(FileLineList): if not FileLineList: return False - ReIsSourcesSection = re.compile("^\s*\[Sources.*\]\s.*$", re.IGNORECASE) - ReIsBinarySection = re.compile("^\s*\[Binaries.*\]\s.*$", re.IGNORECASE) + ReIsSourcesSection = re.compile(r"^\s*\[Sources.*\]\s.*$", re.IGNORECASE) + ReIsBinarySection = re.compile(r"^\s*\[Binaries.*\]\s.*$", re.IGNORECASE) BinarySectionFoundFlag = False for Line in FileLineList: @@ -155,7 +155,7 @@ def IsBinaryInf(FileLineList): # @return Flag # def IsLibInstanceInfo(String): - ReIsLibInstance = re.compile("^\s*##\s*@LIB_INSTANCES\s*$") + ReIsLibInstance = re.compile(r"^\s*##\s*@LIB_INSTANCES\s*$") if ReIsLibInstance.match(String): return True else: @@ -171,7 +171,7 @@ def IsLibInstanceInfo(String): # @return Flag # def IsAsBuildOptionInfo(String): - ReIsAsBuildInstance = re.compile("^\s*##\s*@AsBuilt\s*$") + ReIsAsBuildInstance = re.compile(r"^\s*##\s*@AsBuilt\s*$") if ReIsAsBuildInstance.match(String): return True else: diff --git a/BaseTools/Source/Python/UPT/PomAdapter/DecPomAlignment.py b/BaseTools/Source/Python/UPT/PomAdapter/DecPomAlignment.py index da92fe5d3eb2..b1f8135bc780 100644 --- a/BaseTools/Source/Python/UPT/PomAdapter/DecPomAlignment.py +++ b/BaseTools/Source/Python/UPT/PomAdapter/DecPomAlignment.py @@ -747,12 +747,12 @@ def ReplaceForEval(self, ReplaceValue, IsRange=False, IsExpr=False): # # deal with "NOT EQ", "NOT LT", "NOT GT", "NOT LE", "NOT GE", "NOT NOT" # - NOTNOT_Pattern = '[\t\s]*NOT[\t\s]+NOT[\t\s]*' - NOTGE_Pattern = '[\t\s]*NOT[\t\s]+GE[\t\s]*' - NOTLE_Pattern = '[\t\s]*NOT[\t\s]+LE[\t\s]*' - NOTGT_Pattern = '[\t\s]*NOT[\t\s]+GT[\t\s]*' - NOTLT_Pattern = '[\t\s]*NOT[\t\s]+LT[\t\s]*' - NOTEQ_Pattern = '[\t\s]*NOT[\t\s]+EQ[\t\s]*' + NOTNOT_Pattern = r'[\t\s]*NOT[\t\s]+NOT[\t\s]*' + NOTGE_Pattern = r'[\t\s]*NOT[\t\s]+GE[\t\s]*' + NOTLE_Pattern = r'[\t\s]*NOT[\t\s]+LE[\t\s]*' + NOTGT_Pattern = r'[\t\s]*NOT[\t\s]+GT[\t\s]*' + NOTLT_Pattern = r'[\t\s]*NOT[\t\s]+LT[\t\s]*' + NOTEQ_Pattern = r'[\t\s]*NOT[\t\s]+EQ[\t\s]*' ReplaceValue = re.compile(NOTNOT_Pattern).sub('', ReplaceValue) ReplaceValue = re.compile(NOTLT_Pattern).sub('x >= ', ReplaceValue) ReplaceValue = re.compile(NOTGT_Pattern).sub('x <= ', ReplaceValue) @@ -785,7 +785,7 @@ def ReplaceForEval(self, ReplaceValue, IsRange=False, IsExpr=False): if ReplaceValue.find('!') >= 0 and ReplaceValue[ReplaceValue.index('!') + 1] != '=': ReplaceValue = ReplaceValue.replace('!', ' not ') if '.' in ReplaceValue: - Pattern = '[a-zA-Z0-9]{1,}\.[a-zA-Z0-9]{1,}' + Pattern = r'[a-zA-Z0-9]{1,}\.[a-zA-Z0-9]{1,}' MatchedList = re.findall(Pattern, ReplaceValue) for MatchedItem in MatchedList: if MatchedItem not in self.PcdDefaultValueDict: @@ -814,7 +814,7 @@ def CheckPcdValue(self): # # Delete the 'L' prefix of a quoted string, this operation is for eval() # - QUOTED_PATTERN = '[\t\s]*L?"[^"]*"' + QUOTED_PATTERN = r'[\t\s]*L?"[^"]*"' QuotedMatchedObj = re.search(QUOTED_PATTERN, Expression) if QuotedMatchedObj: MatchedStr = QuotedMatchedObj.group().strip() @@ -847,7 +847,7 @@ def CheckPcdValue(self): # # Delete the 'L' prefix of a quoted string, this operation is for eval() # - QUOTED_PATTERN = '[\t\s]*L?"[^"]*"' + QUOTED_PATTERN = r'[\t\s]*L?"[^"]*"' QuotedMatchedObj = re.search(QUOTED_PATTERN, DefaultValue) if QuotedMatchedObj: MatchedStr = QuotedMatchedObj.group().strip() diff --git a/BaseTools/Source/Python/UPT/Xml/IniToXml.py b/BaseTools/Source/Python/UPT/Xml/IniToXml.py index 3dc4001313de..2c01c97fa519 100644 --- a/BaseTools/Source/Python/UPT/Xml/IniToXml.py +++ b/BaseTools/Source/Python/UPT/Xml/IniToXml.py @@ -200,9 +200,9 @@ def ValidateRegValues(Key, Value): ('[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}' '-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}', ST.ERR_GUID_VALUE % Value), - 'Version' : ('[0-9]+(\.[0-9]+)?', ST.ERR_VERSION_VALUE % \ + 'Version' : (r'[0-9]+(\.[0-9]+)?', ST.ERR_VERSION_VALUE % \ (Key, Value)), - 'XmlSpecification' : ('1\.1', ST.ERR_VERSION_XMLSPEC % Value) + 'XmlSpecification' : (r'1\.1', ST.ERR_VERSION_XMLSPEC % Value) } if Key not in ValidateMap: return True, '' diff --git a/BaseTools/Source/Python/UPT/Xml/PcdXml.py b/BaseTools/Source/Python/UPT/Xml/PcdXml.py index bbcee45a0132..ca95c820c9a9 100644 --- a/BaseTools/Source/Python/UPT/Xml/PcdXml.py +++ b/BaseTools/Source/Python/UPT/Xml/PcdXml.py @@ -100,11 +100,11 @@ def ToXml(self, PcdError, Key): def TransferValidRange2Expr(self, TokenSpaceGuidCName, CName, ValidRange): if self.Expression: pass - INT_RANGE_PATTERN1 = '[\t\s]*[0-9]+[\t\s]*-[\t\s]*[0-9]+' - INT_RANGE_PATTERN2 = '[\t\s]*(LT|GT|LE|GE|XOR|EQ)[\t\s]+\d+[\t\s]*' + INT_RANGE_PATTERN1 = r'[\t\s]*[0-9]+[\t\s]*-[\t\s]*[0-9]+' + INT_RANGE_PATTERN2 = r'[\t\s]*(LT|GT|LE|GE|XOR|EQ)[\t\s]+\d+[\t\s]*' HEX_RANGE_PATTERN1 = \ - '[\t\s]*0[xX][a-fA-F0-9]+[\t\s]*-[\t\s]*0[xX][a-fA-F0-9]+' - HEX_RANGE_PATTERN2 = '[\t\s]*(LT|GT|LE|GE|XOR|EQ)[\t\s]+0[xX][a-fA-F0-9]+[\t\s]*' + r'[\t\s]*0[xX][a-fA-F0-9]+[\t\s]*-[\t\s]*0[xX][a-fA-F0-9]+' + HEX_RANGE_PATTERN2 = r'[\t\s]*(LT|GT|LE|GE|XOR|EQ)[\t\s]+0[xX][a-fA-F0-9]+[\t\s]*' IntMatch1 = re.compile(INT_RANGE_PATTERN1) IntMatch2 = re.compile(INT_RANGE_PATTERN2) HexMatch1 = re.compile(HEX_RANGE_PATTERN1) @@ -158,18 +158,18 @@ def TransferValidEpxr2ValidRange(self, ValidRangeExpr): pass PCD_PATTERN = \ - '[\t\s]*[_a-zA-Z][a-zA-Z0-9_]*[\t\s]*\.[\t\s]*[_a-zA-Z][a-zA-Z0-9_]*[\t\s]*' + r'[\t\s]*[_a-zA-Z][a-zA-Z0-9_]*[\t\s]*\.[\t\s]*[_a-zA-Z][a-zA-Z0-9_]*[\t\s]*' IntPattern1 = \ - '[\t\s]*\([\t\s]*'+PCD_PATTERN+'[\t\s]+GE[\t\s]+\d+[\t\s]*\)[\t\s]+AND[\t\s]+\([\t\s]*'+\ - PCD_PATTERN+'[\t\s]+LE[\t\s]+\d+[\t\s]*\)' + r'[\t\s]*\([\t\s]*'+PCD_PATTERN+r'[\t\s]+GE[\t\s]+\d+[\t\s]*\)[\t\s]+AND[\t\s]+\([\t\s]*'+\ + PCD_PATTERN+r'[\t\s]+LE[\t\s]+\d+[\t\s]*\)' IntPattern1 = IntPattern1.replace(' ', '') - IntPattern2 = '[\t\s]*'+PCD_PATTERN+'[\t\s]+(LT|GT|LE|GE|XOR|EQ)[\t\s]+\d+[\t\s]*' + IntPattern2 = r'[\t\s]*'+PCD_PATTERN+r'[\t\s]+(LT|GT|LE|GE|XOR|EQ)[\t\s]+\d+[\t\s]*' HexPattern1 = \ - '[\t\s]*\([\t\s]*'+PCD_PATTERN+'[\t\s]+GE[\t\s]+0[xX][0-9a-fA-F]+[\t\s]*\)[\t\s]+AND[\t\s]+\([\t\s]*'+\ - PCD_PATTERN+'[\t\s]+LE[\t\s]+0[xX][0-9a-fA-F]+[\t\s]*\)' + r'[\t\s]*\([\t\s]*'+PCD_PATTERN+r'[\t\s]+GE[\t\s]+0[xX][0-9a-fA-F]+[\t\s]*\)[\t\s]+AND[\t\s]+\([\t\s]*'+\ + PCD_PATTERN+r'[\t\s]+LE[\t\s]+0[xX][0-9a-fA-F]+[\t\s]*\)' HexPattern1 = HexPattern1.replace(' ', '') - HexPattern2 = '[\t\s]*'+PCD_PATTERN+'[\t\s]+(LT|GT|LE|GE|XOR|EQ)[\t\s]+0[xX][0-9a-zA-Z]+[\t\s]*' + HexPattern2 = r'[\t\s]*'+PCD_PATTERN+r'[\t\s]+(LT|GT|LE|GE|XOR|EQ)[\t\s]+0[xX][0-9a-zA-Z]+[\t\s]*' # # Do the Hex1 conversion @@ -180,7 +180,7 @@ def TransferValidEpxr2ValidRange(self, ValidRangeExpr): # # To match items on both sides of '-' # - RangeItemList = re.compile('[\t\s]*0[xX][0-9a-fA-F]+[\t\s]*').findall(HexMatchedItem) + RangeItemList = re.compile(r'[\t\s]*0[xX][0-9a-fA-F]+[\t\s]*').findall(HexMatchedItem) if RangeItemList and len(RangeItemList) == 2: HexRangeDict[HexMatchedItem] = RangeItemList @@ -204,7 +204,7 @@ def TransferValidEpxr2ValidRange(self, ValidRangeExpr): # # To match items on both sides of '-' # - RangeItemList = re.compile('[\t\s]*\d+[\t\s]*').findall(MatchedItem) + RangeItemList = re.compile(r'[\t\s]*\d+[\t\s]*').findall(MatchedItem) if RangeItemList and len(RangeItemList) == 2: IntRangeDict[MatchedItem] = RangeItemList diff --git a/BaseTools/Source/Python/UPT/Xml/XmlParser.py b/BaseTools/Source/Python/UPT/Xml/XmlParser.py index 8e22a280f655..f23958883180 100644 --- a/BaseTools/Source/Python/UPT/Xml/XmlParser.py +++ b/BaseTools/Source/Python/UPT/Xml/XmlParser.py @@ -281,33 +281,33 @@ def ToXml(self, DistP): # XmlContent = \ re.sub(r'[\s\r\n]*SupArchList[\s\r\n]*=[\s\r\n]*"[\s\r\n]*COMMON' - '[\s\r\n]*"', '', XmlContent) + r'[\s\r\n]*"', '', XmlContent) XmlContent = \ re.sub(r'[\s\r\n]*SupArchList[\s\r\n]*=[\s\r\n]*"[\s\r\n]*common' - '[\s\r\n]*"', '', XmlContent) + r'[\s\r\n]*"', '', XmlContent) # # Remove COMMON # XmlContent = \ re.sub(r'[\s\r\n]*[\s\r\n]*COMMON[\s\r\n]*' - '[\s\r\n]*', '', XmlContent) + r'[\s\r\n]*', '', XmlContent) # # Remove common # XmlContent = \ re.sub(r'[\s\r\n]*[\s\r\n]*' - 'common[\s\r\n]*[\s\r\n]*', '', XmlContent) + r'common[\s\r\n]*[\s\r\n]*', '', XmlContent) # # Remove SupModList="COMMON" or "common" # XmlContent = \ re.sub(r'[\s\r\n]*SupModList[\s\r\n]*=[\s\r\n]*"[\s\r\n]*COMMON' - '[\s\r\n]*"', '', XmlContent) + r'[\s\r\n]*"', '', XmlContent) XmlContent = \ re.sub(r'[\s\r\n]*SupModList[\s\r\n]*=[\s\r\n]*"[\s\r\n]*common' - '[\s\r\n]*"', '', XmlContent) + r'[\s\r\n]*"', '', XmlContent) return XmlContent diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c b/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c index 349d37b045fb..628e71439e3e 100644 --- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c +++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c @@ -102,7 +102,6 @@ X509ConstructCertificateStackV ( STACK_OF (X509) *CertStack; BOOLEAN Status; - UINTN Index; // // Check input parameters. @@ -124,7 +123,7 @@ X509ConstructCertificateStackV ( } } - for (Index = 0; ; Index++) { + while (TRUE) { // // If Cert is NULL, then it is the end of the list. // diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf b/CryptoPkg/Library/OpensslLib/OpensslLib.inf index d499eb710232..9bc9e5ec2bbf 100644 --- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf +++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf @@ -739,8 +739,8 @@ # 1: ignore "#1-D: last line of file ends without a newline" # 3017: may be used before being set (NOTE: This was fixed in OpenSSL 1.1 HEAD with # commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and can be dropped then.) - XCODE:*_*_IA32_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_NOASM) -w -std=c99 -Wno-error=uninitialized - XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_NOASM) -w -std=c99 -Wno-error=uninitialized + XCODE:*_*_IA32_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_NOASM) -w -std=c99 -Wno-error=uninitialized -DOPENSSL_NO_APPLE_CRYPTO_RANDOM + XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_NOASM) -w -std=c99 -Wno-error=uninitialized -DOPENSSL_NO_APPLE_CRYPTO_RANDOM # # AARCH64 uses strict alignment and avoids SIMD registers for code that may execute diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf b/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf index dd07d0f72260..deabf82940d4 100644 --- a/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf +++ b/CryptoPkg/Library/OpensslLib/OpensslLibAccel.inf @@ -2027,8 +2027,8 @@ # 1: ignore "#1-D: last line of file ends without a newline" # 3017: may be used before being set (NOTE: This was fixed in OpenSSL 1.1 HEAD with # commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and can be dropped then.) - XCODE:*_*_IA32_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_IA32) -w -std=c99 -Wno-error=uninitialized - XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_X64) -w -std=c99 -Wno-error=uninitialized + XCODE:*_*_IA32_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_IA32) -w -std=c99 -Wno-error=uninitialized -DOPENSSL_NO_APPLE_CRYPTO_RANDOM + XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_X64) -w -std=c99 -Wno-error=uninitialized -DOPENSSL_NO_APPLE_CRYPTO_RANDOM GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_AARCH64) -Wno-error=format -Wno-format -D_BITS_STDINT_UINTN_H -D_BITS_STDINT_INTN_H diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf index d414988f7815..1590dda35335 100644 --- a/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf +++ b/CryptoPkg/Library/OpensslLib/OpensslLibCrypto.inf @@ -695,8 +695,8 @@ # 1: ignore "#1-D: last line of file ends without a newline" # 3017: may be used before being set (NOTE: This was fixed in OpenSSL 1.1 HEAD with # commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and can be dropped then.) - XCODE:*_*_IA32_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_NOASM) -w -std=c99 -Wno-error=uninitialized - XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_NOASM) -w -std=c99 -Wno-error=uninitialized + XCODE:*_*_IA32_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_NOASM) -w -std=c99 -Wno-error=uninitialized -DOPENSSL_NO_APPLE_CRYPTO_RANDOM + XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_NOASM) -w -std=c99 -Wno-error=uninitialized -DOPENSSL_NO_APPLE_CRYPTO_RANDOM # # AARCH64 uses strict alignment and avoids SIMD registers for code that may execute diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf b/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf index 55c634290484..83f9d2195c50 100644 --- a/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf +++ b/CryptoPkg/Library/OpensslLib/OpensslLibFull.inf @@ -793,8 +793,8 @@ # 1: ignore "#1-D: last line of file ends without a newline" # 3017: may be used before being set (NOTE: This was fixed in OpenSSL 1.1 HEAD with # commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and can be dropped then.) - XCODE:*_*_IA32_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_NOASM) -w -std=c99 -Wno-error=uninitialized - XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_NOASM) -w -std=c99 -Wno-error=uninitialized + XCODE:*_*_IA32_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_NOASM) -w -std=c99 -Wno-error=uninitialized -DOPENSSL_NO_APPLE_CRYPTO_RANDOM + XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_NOASM) -w -std=c99 -Wno-error=uninitialized -DOPENSSL_NO_APPLE_CRYPTO_RANDOM # # AARCH64 uses strict alignment and avoids SIMD registers for code that may execute diff --git a/CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf b/CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf index b65ecf1e37cf..8e8c23937398 100644 --- a/CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf +++ b/CryptoPkg/Library/OpensslLib/OpensslLibFullAccel.inf @@ -2179,8 +2179,8 @@ # 1: ignore "#1-D: last line of file ends without a newline" # 3017: may be used before being set (NOTE: This was fixed in OpenSSL 1.1 HEAD with # commit d9b8b89bec4480de3a10bdaf9425db371c19145b, and can be dropped then.) - XCODE:*_*_IA32_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_IA32) -w -std=c99 -Wno-error=uninitialized - XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_X64) -w -std=c99 -Wno-error=uninitialized + XCODE:*_*_IA32_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_IA32) -w -std=c99 -Wno-error=uninitialized -DOPENSSL_NO_APPLE_CRYPTO_RANDOM + XCODE:*_*_X64_CC_FLAGS = -mmmx -msse -U_WIN32 -U_WIN64 $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_X64) -w -std=c99 -Wno-error=uninitialized -DOPENSSL_NO_APPLE_CRYPTO_RANDOM GCC:*_*_AARCH64_CC_FLAGS = $(OPENSSL_FLAGS) $(OPENSSL_FLAGS_AARCH64) -Wno-error=format -Wno-format -D_BITS_STDINT_UINTN_H -D_BITS_STDINT_INTN_H diff --git a/EmulatorPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml b/EmulatorPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml deleted file mode 100644 index 8af4c9c778cb..000000000000 --- a/EmulatorPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml +++ /dev/null @@ -1,94 +0,0 @@ -## @file -# Azure Pipeline build file for building a platform. -# -# Platform: EmulatorPkg -# OS: Ubuntu -# Toolchain: GCC5 -# -# Copyright (c) Microsoft Corporation. -# Copyright (c) 2020, Intel Corporation. All rights reserved. -# SPDX-License-Identifier: BSD-2-Clause-Patent -## -trigger: - - master - - stable/* -pr: - - master - - stable/* - -variables: - - template: ../../../.azurepipelines/templates/defaults.yml - -jobs: - - job: Platform_CI - variables: - package: 'EmulatorPkg' - vm_image: 'ubuntu-22.04' - should_run: false - run_flags: "MAKE_STARTUP_NSH=TRUE" - - #Use matrix to speed up the build process - strategy: - matrix: - EmulatorPkg_X64_DEBUG: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "X64" - Build.Flags: "" - Build.Target: "DEBUG" - Run.Flags: $(run_flags) - Run: $(should_run) - EmulatorPkg_X64_RELEASE: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "X64" - Build.Flags: "" - Build.Target: "RELEASE" - Run.Flags: $(run_flags) - Run: $(should_run) - EmulatorPkg_X64_NOOPT: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "X64" - Build.Flags: "" - Build.Target: "NOOPT" - Run.Flags: $(run_flags) - Run: $(should_run) - EmulatorPkg_X64_FULL_DEBUG: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "X64" - Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=TRUE" - Build.Target: "DEBUG" - Run.Flags: $(run_flags) - Run: $(should_run) - EmulatorPkg_X64_FULL_RELEASE: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "X64" - Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=TRUE" - Build.Target: "RELEASE" - Run.Flags: $(run_flags) - Run: $(should_run) - EmulatorPkg_X64_FULL_NOOPT: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "X64" - Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=TRUE" - Build.Target: "NOOPT" - Run.Flags: $(run_flags) - Run: $(should_run) - - workspace: - clean: all - - pool: - vmImage: $(vm_image) - - container: ${{ variables.default_linux_image }} - - steps: - - template: ../../../.azurepipelines/templates/platform-build-run-steps.yml - parameters: - tool_chain_tag: GCC5 - build_pkg: $(package) - build_target: $(Build.Target) - build_arch: $(Build.Arch) - build_file: $(Build.File) - build_flags: $(Build.Flags) - run_flags: $(Run.Flags) - usePythonVersion: '' # use Python from the container image diff --git a/EmulatorPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml b/EmulatorPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml deleted file mode 100644 index 09960e7c7a6e..000000000000 --- a/EmulatorPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml +++ /dev/null @@ -1,134 +0,0 @@ -## @file -# Azure Pipeline build file for building a platform. -# -# Platform: EMULATORPKG -# OS: Windows -# Toolchain: VS2019 -# -# Copyright (c) Microsoft Corporation. -# Copyright (c) 2020, Intel Corporation. All rights reserved. -# SPDX-License-Identifier: BSD-2-Clause-Patent -## -trigger: - - master - - stable/* -pr: - - master - - stable/* - -variables: - - template: ../../../.azurepipelines/templates/defaults.yml - -jobs: - - job: Platform_CI - variables: - package: 'EmulatorPkg' - vm_image: 'windows-2019' - should_run: true - run_flags: "MAKE_STARTUP_NSH=TRUE" - - #Use matrix to speed up the build process - strategy: - matrix: - EmulatorPkg_X64_DEBUG: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "X64" - Build.Flags: "" - Build.Target: "DEBUG" - Run.Flags: $(run_flags) - Run: $(should_run) - EmulatorPkg_X64_RELEASE: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "X64" - Build.Flags: "" - Build.Target: "RELEASE" - Run.Flags: $(run_flags) - Run: $(should_run) - EmulatorPkg_X64_NOOPT: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "X64" - Build.Flags: "" - Build.Target: "NOOPT" - Run.Flags: $(run_flags) - Run: $(should_run) - EmulatorPkg_IA32_DEBUG: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "IA32 " - Build.Flags: "" - Build.Target: "DEBUG" - Run.Flags: $(run_flags) - Run: $(should_run) - EmulatorPkg_IA32_RELEASE: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "IA32 " - Build.Flags: "" - Build.Target: "RELEASE" - Run.Flags: $(run_flags) - Run: $(should_run) - EmulatorPkg_IA32_NOOPT: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "IA32 " - Build.Flags: "" - Build.Target: "NOOPT" - Run.Flags: $(run_flags) - Run: $(should_run) - EmulatorPkg_X64_FULL_DEBUG: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "X64" - Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=TRUE" - Build.Target: "DEBUG" - Run.Flags: $(run_flags) - Run: $(should_run) - EmulatorPkg_X64_FULL_RELEASE: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "X64" - Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=TRUE" - Build.Target: "RELEASE" - Run.Flags: $(run_flags) - Run: $(should_run) - EmulatorPkg_X64_FULL_NOOPT: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "X64" - Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=TRUE" - Build.Target: "NOOPT" - Run.Flags: $(run_flags) - Run: $(should_run) - EmulatorPkg_IA32_FULL_DEBUG: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "IA32" - Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=TRUE" - Build.Target: "DEBUG" - Run.Flags: $(run_flags) - Run: $(should_run) - EmulatorPkg_IA32_FULL_RELEASE: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "IA32" - Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=TRUE" - Build.Target: "RELEASE" - Run.Flags: $(run_flags) - Run: $(should_run) - EmulatorPkg_IA32_FULL_NOOPT: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "IA32" - Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=TRUE" - Build.Target: "NOOPT" - Run.Flags: $(run_flags) - Run: $(should_run) - - workspace: - clean: all - - pool: - vmImage: $(vm_image) - - steps: - - template: ../../../.azurepipelines/templates/platform-build-run-steps.yml - parameters: - tool_chain_tag: VS2019 - build_pkg: $(package) - build_target: $(Build.Target) - build_arch: $(Build.Arch) - build_file: $(Build.File) - build_flags: $(Build.Flags) - run_flags: $(Run.Flags) - usePythonVersion: ${{ variables.default_python_version }} diff --git a/MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c b/MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c index 053b48d90e4d..f5b9418a3834 100644 --- a/MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c +++ b/MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c @@ -918,7 +918,7 @@ GetLockOnVariableStateVariablePolicyInfo ( LocalLockOnVarStatePolicy = (VARIABLE_LOCK_ON_VAR_STATE_POLICY *)(MatchPolicy + 1); CopyMem (VariablePolicy, LocalLockOnVarStatePolicy, sizeof (*LocalLockOnVarStatePolicy)); - if ((VariableLockPolicyVariableNameBufferSize == NULL)) { + if (VariableLockPolicyVariableNameBufferSize == NULL) { if (VariableLockPolicyVariableName != NULL) { return EFI_INVALID_PARAMETER; } diff --git a/MdePkg/Include/Library/DebugLib.h b/MdePkg/Include/Library/DebugLib.h index fc5c83463d4a..e9f7b5b49e79 100644 --- a/MdePkg/Include/Library/DebugLib.h +++ b/MdePkg/Include/Library/DebugLib.h @@ -534,7 +534,12 @@ UnitTestDebugAssert ( are not included in a module. **/ -#define DEBUG_CODE_BEGIN() do { if (DebugCodeEnabled ()) { UINT8 __DebugCodeLocal +#define DEBUG_CODE_BEGIN() \ + do { \ + BOOLEAN __DebugCodeLocal; \ + __DebugCodeLocal = FALSE; \ + do { \ + if (DebugCodeEnabled ()) { /** The macro that marks the end of debug source code. @@ -545,7 +550,10 @@ UnitTestDebugAssert ( are not included in a module. **/ -#define DEBUG_CODE_END() __DebugCodeLocal = 0; __DebugCodeLocal++; } } while (FALSE) +#define DEBUG_CODE_END() \ + } \ + } while (__DebugCodeLocal); \ + } while (FALSE) /** The macro that declares a section of debug source code. diff --git a/MdePkg/Include/Library/PerformanceLib.h b/MdePkg/Include/Library/PerformanceLib.h index d0f2dfb070d5..57ba45eb7b58 100644 --- a/MdePkg/Include/Library/PerformanceLib.h +++ b/MdePkg/Include/Library/PerformanceLib.h @@ -734,7 +734,12 @@ LogPerformanceMeasurement ( Otherwise, the source lines between PERF_CODE_BEGIN() and PERF_CODE_END() are not included in a module. **/ -#define PERF_CODE_BEGIN() do { if (PerformanceMeasurementEnabled ()) { UINT8 __PerformanceCodeLocal +#define PERF_CODE_BEGIN() \ + do { \ + BOOLEAN __PerformanceCodeLocal; \ + __PerformanceCodeLocal = FALSE; \ + do { \ + if (PerformanceMeasurementEnabled ()) { /** Macro that marks the end of performance measurement source code. @@ -744,7 +749,10 @@ LogPerformanceMeasurement ( Otherwise, the source lines between PERF_CODE_BEGIN() and PERF_CODE_END() are not included in a module. **/ -#define PERF_CODE_END() __PerformanceCodeLocal = 0; __PerformanceCodeLocal++; } } while (FALSE) +#define PERF_CODE_END() \ + } \ + } while (__PerformanceCodeLocal); \ + } while (FALSE) /** Macro that declares a section of performance measurement source code. diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c b/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c index f38e3ee3fe1a..f72bc93a689f 100644 --- a/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c +++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c @@ -1001,7 +1001,7 @@ Dhcp6AppendETOption ( return EFI_INVALID_PARAMETER; } - if ((Elapsed == NULL)) { + if (Elapsed == NULL) { return EFI_INVALID_PARAMETER; } diff --git a/OvmfPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml b/OvmfPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml index 6762c2cc3a78..50df1ac8de76 100644 --- a/OvmfPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml +++ b/OvmfPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml @@ -2,8 +2,8 @@ # Azure Pipeline build file for building a platform. # # Platform: OVMF -# OS: Ubuntu -# Toolchain: GCC5 +# OS: macOS +# Toolchain: XCODE5 # # Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -22,7 +22,7 @@ jobs: - job: Platform_CI variables: package: 'OvmfPkg' - vm_image: 'ubuntu-22.04' + vm_image: 'macOS-14' should_run: true run_flags: "MAKE_STARTUP_NSH=TRUE QEMU_HEADLESS=TRUE" @@ -201,16 +201,14 @@ jobs: pool: vmImage: $(vm_image) - container: ${{ variables.default_linux_image }} - steps: - template: ../../../.azurepipelines/templates/platform-build-run-steps.yml parameters: - tool_chain_tag: GCC5 + tool_chain_tag: XCODE5 build_pkg: $(package) build_target: $(Build.Target) build_arch: $(Build.Arch) build_file: $(Build.File) build_flags: $(Build.Flags) run_flags: $(Run.Flags) - usePythonVersion: '' # use Python from the container image + usePythonVersion: '' # use default Python from the vm image diff --git a/OvmfPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml b/OvmfPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml deleted file mode 100644 index cada81023548..000000000000 --- a/OvmfPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml +++ /dev/null @@ -1,145 +0,0 @@ -## @file -# Azure Pipeline build file for building a platform. -# -# Platform: OVMF -# OS: Windows -# Toolchain: VS2019 -# -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: BSD-2-Clause-Patent -## -trigger: - - master - - stable/* -pr: - - master - - stable/* - -variables: - - template: ../../../.azurepipelines/templates/defaults.yml - -jobs: - - job: Platform_CI - variables: - package: 'OvmfPkg' - vm_image: 'windows-2019' - should_run: true - run_flags: "MAKE_STARTUP_NSH=TRUE QEMU_HEADLESS=TRUE" - - #Use matrix to speed up the build process - strategy: - matrix: - OVMF_IA32_DEBUG: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "IA32" - Build.Flags: "" - Build.Target: "DEBUG" - Run.Flags: $(run_flags) - Run: $(should_run) - OVMF_IA32_RELEASE: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "IA32" - Build.Flags: "" - Build.Target: "RELEASE" - Run.Flags: $(run_flags) - Run: $(should_run) - OVMF_IA32_NOOPT: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "IA32" - Build.Flags: "" - Build.Target: "NOOPT" - Run.Flags: $(run_flags) - Run: $(should_run) - - OVMF_X64_DEBUG: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "X64" - Build.Flags: "" - Build.Target: "DEBUG" - Run.Flags: $(run_flags) - Run: $(should_run) - OVMF_X64_RELEASE: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "X64" - Build.Flags: "" - Build.Target: "RELEASE" - Run.Flags: $(run_flags) - Run: $(should_run) - OVMF_X64_NOOPT: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "X64" - Build.Flags: "" - Build.Target: "NOOPT" - Run.Flags: $(run_flags) - Run: $(should_run) - - OVMF_IA32X64_DEBUG: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "IA32,X64" - Build.Flags: "" - Build.Target: "DEBUG" - Run.Flags: $(run_flags) - Run: $(should_run) - OVMF_IA32X64_RELEASE: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "IA32,X64" - Build.Flags: "" - Build.Target: "RELEASE" - Run.Flags: $(run_flags) - Run: $(should_run) - OVMF_IA32X64_NOOPT: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "IA32,X64" - Build.Flags: "" - Build.Target: "NOOPT" - Run.Flags: $(run_flags) - Run: $(should_run) - - OVMF_IA32X64_FULL_DEBUG: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "IA32,X64" - Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1 BLD_*_SMM_REQUIRE=1 BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1 BLD_*_NETWORK_IP6_ENABLE=1 BLD_*_NETWORK_HTTP_BOOT_ENABLE=1" - Build.Target: "DEBUG" - Run.Flags: $(run_flags) - Run: $(should_run) - OVMF_IA32X64_FULL_RELEASE: - Build.File: "$(package)/PlatformCI/PlatformBuild.py" - Build.Arch: "IA32,X64" - Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1 BLD_*_SMM_REQUIRE=1 BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1 BLD_*_NETWORK_IP6_ENABLE=1 BLD_*_NETWORK_HTTP_BOOT_ENABLE=1" - Build.Target: "RELEASE" - Run.Flags: $(run_flags) - Run: $(should_run) - - # This currently creates a very large image which is too big for the FDF declared range - # Ovmf maintainers suggest to skip this build for now. - # - # OVMF_IA32X64_FULL_NOOPT: - # Build.File: "$(package)/PlatformCI/PlatformBuild.py" - # Build.Arch: "IA32,X64" - # Build.Flags: "BLD_*_SECURE_BOOT_ENABLE=1 BLD_*_SMM_REQUIRE=1 BLD_*_TPM2_ENABLE=1 BLD_*_NETWORK_TLS_ENABLE=1 BLD_*_NETWORK_IP6_ENABLE=1 BLD_*_NETWORK_HTTP_BOOT_ENABLE=1" - # Build.Target: "NOOPT" - # Run.Flags: $(run_flags) - # Run: $(should_run) - - workspace: - clean: all - - pool: - vmImage: $(vm_image) - - steps: - - template: ../../../.azurepipelines/templates/platform-build-run-steps.yml - parameters: - tool_chain_tag: VS2019 - build_pkg: $(package) - build_target: $(Build.Target) - build_arch: $(Build.Arch) - build_file: $(Build.File) - build_flags: $(Build.Flags) - run_flags: $(Run.Flags) - usePythonVersion: ${{ variables.default_python_version }} - extra_install_step: - - powershell: choco install qemu --version=2023.7.25; Write-Host "##vso[task.prependpath]c:\Program Files\qemu" - displayName: Install QEMU and Set QEMU on path # friendly name displayed in the UI - condition: and(gt(variables.pkg_count, 0), succeeded()) - diff --git a/OvmfPkg/PlatformCI/iasl_ext_dep.yaml b/OvmfPkg/PlatformCI/iasl_ext_dep.yaml deleted file mode 100644 index cbee0e5a5a92..000000000000 --- a/OvmfPkg/PlatformCI/iasl_ext_dep.yaml +++ /dev/null @@ -1,21 +0,0 @@ -## @file -# Download iasl executable tool from a nuget.org package -# - package contains different binaries based on host -# Add the folder with the tool to the path -# -# This is only downloaded for scope ovmf thus -# should have no impact on the asl compiler used by any -# other given platform to build. -# -# Copyright (c) Microsoft Corporation. -# SPDX-License-Identifier: BSD-2-Clause-Patent -## -{ - "id": "iasl-ovmf-1", - "scope": "ovmf", - "type": "nuget", - "name": "iasl", - "source": "https://api.nuget.org/v3/index.json", - "version": "20190215.0.0", - "flags": ["set_path", "host_specific"], -}