From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.107]) by mx.groups.io with SMTP id smtpd.web12.348.1587759733648339654 for ; Fri, 24 Apr 2020 13:22:13 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@microsoft.com header.s=selector2 header.b=VhsksH5f; spf=pass (domain: microsoft.com, ip: 40.107.93.107, mailfrom: bret.barkelew@microsoft.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SsOEE8xQoTe552/bXIWIHEV0ndwmGQTto9tHu5Y/dWFzp7X+EcayJaGO8wIM1kQvypklJpXynaAqicPZDh7+55TsTh0SHLHL2X7R3bvfIp4qu7Kqsp6b/7358TflvBf+94s1D+LJxIxRzZ+RYp3OaoE/v2BhLxOL7ue4bk5ty/MYUw1zZs23ifeZ8Y/W2onK+pmZzd+RrWKEiLE9O3AyH2VJo5xhz2eot0vOsEU3soMVJEqql7JPi5q66F7GPxxL6Lg9C3hN64tMehnPKkj0C6wfytnTeFXd6d8X9TnNogPUrlwx/1c6LboEaBkH303sXUODJm9lZ5VK1u567YUDIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AqqRxEKi5h568l63VO5ryzosMFUxgmUA3k7I5h3FzSk=; b=UnSnBOTlmKY1/ljea1OHXUvjsg1c+stjNASUTaEFnKbBJAoZcTOpiqAdey17vxbiEQEAycBn/EgsSCGE8MSAqiAzrlYoS2SRS6DiBvN/rcjOlOH6TVHfdjjHdg4SiF6VI32sHHhob1vZ/DR8OtlQKQB3L1FOEinw45x/eaZ3ss/zcF8oRnnjom12fjH6I6wZVk4rGYpWZGFL261kNeb+xRbRlJ+MRFyStji6ZtwCjtPZAVLjedgjrJ+hk8Z6apOMxbk8NEaNjeuk6/bd00KOYU/kBgSUwn8e9unRlA/doLoL/bwQ327JC+piTNxCwp6p90j/HTBsTtFUKF+YYY288Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AqqRxEKi5h568l63VO5ryzosMFUxgmUA3k7I5h3FzSk=; b=VhsksH5fVN9KXi5uMhdaubExgolr+DWvqbTb8MPuDiCf7nv0TjcR22TOh358M+cOVKBpUlBIpX4MJUfHaMInt3U8K6WYY1PJSZFCDB7pXQoyud5v9otylKqDQyOhxcp2mCO6ZjOKS4z9VqzODj+N0BYRvUqsNr5J+Pz8/4Ivgr8= Received: from CY4PR21MB0743.namprd21.prod.outlook.com (2603:10b6:903:b2::9) by CY4PR21MB0744.namprd21.prod.outlook.com (2603:10b6:903:b2::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.3; Fri, 24 Apr 2020 20:22:10 +0000 Received: from CY4PR21MB0743.namprd21.prod.outlook.com ([fe80::90d:10d9:c5bc:5318]) by CY4PR21MB0743.namprd21.prod.outlook.com ([fe80::90d:10d9:c5bc:5318%12]) with mapi id 15.20.2958.010; Fri, 24 Apr 2020 20:22:10 +0000 From: "Bret Barkelew" To: "devel@edk2.groups.io" , "michael.kubacki@outlook.com" CC: Jordan Justen , Andrew Fish , Ray Ni Subject: Re: [EXTERNAL] [edk2-devel] [PATCH v2 3/6] EmulatorPkg: Add Platform CI and configuration for Core CI Thread-Topic: [EXTERNAL] [edk2-devel] [PATCH v2 3/6] EmulatorPkg: Add Platform CI and configuration for Core CI Thread-Index: AQHWF0e38nSFeCgTE06kEGnLsjiJiKiIvXsH Date: Fri, 24 Apr 2020 20:22:10 +0000 Message-ID: References: <20200420191216.24572-1-michael.kubacki@outlook.com>, In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2020-04-24T20:22:05.0986487Z;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0;MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Privileged authentication-results: spf=none (sender IP is ) smtp.mailfrom=Bret.Barkelew@microsoft.com; x-originating-ip: [174.21.83.205] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: d493eb69-8d09-48d4-6618-08d7e88d2ae3 x-ms-traffictypediagnostic: CY4PR21MB0744: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3968; x-forefront-prvs: 03838E948C x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR21MB0743.namprd21.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(366004)(346002)(376002)(396003)(39860400002)(136003)(186003)(66946007)(76116006)(2906002)(110136005)(66446008)(64756008)(66556008)(66476007)(8936002)(5660300002)(53546011)(26005)(52536014)(60390400001)(82950400001)(82960400001)(54906003)(55016002)(33656002)(8990500004)(7696005)(9686003)(6506007)(30864003)(86362001)(4326008)(478600001)(71200400001)(8676002)(83080400001)(81156014)(316002)(19627235002)(10290500003)(966005)(559001)(579004)(460985005);DIR:OUT;SFP:1102; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HRWWh3uCyoY69kLsPT0ulnRqijv6CDZAsMGJUbv9O54Xu8aHcpNF3Jlc15SdBxuYUmbfgkJ7q9TPFQBcULl6vk5eD7eHwczKVNWZ1GZt2OtF8DKEMklFHysnB+LZXT5LAxWmsHGXlP3qJCGJBsz+NDfjj2zbXkpDbXUFDOwsTLZEp1H6iZkruF8jv+IJGBCRWoh0KJWLuZNtffvY2j3NFOM9iW4W0EVL4ZAJp9xAsCt8dbU2+qbdrJu4n/VEhdDHxY2QlDeFA0nIeWpJMKNEGIrltDl7mO6BD6Kh0gt23zAytRJhbx2Nm8S+0XXi3lP79/u2/4PJWA79qN/4N6gbXv8etipG6v0D93TS5exxepDvWnP1LYydlGFcfnyIoFcmx50MQYgmSzJW4C30kN+hc8OSt8e+mPA2PATMr4LjMeQfBeuH84jB4quPbUCSpxXhGPIddEBJp2O4kI5a/3+MYwidB3ruc95yNHKqEhGBtyyoFeFD5eH1gBi9PuELojBE4u5tbCCdk5xL4XGVAeVUmBAYMMDOoBjkNoMWBR8Ij0u+KqIZumw5C6pLK+1MaUii x-ms-exchange-antispam-messagedata: q6zHP0AP77tySzESVgl0Lt0JW6rZvr8dCTUd1sia1jAWrvjM1SYPhoyyX+W/76RemAoqFV7Ayw3l8xuIVaHMYyercfmu3jBW7tIS2rricjbB6bmtKS2zZL/sjyRHYP2UmxMcQ7RBK5By/xWr/bdBA+M0t01iZVSbJCMlmO0YmcerPcmdtYw/9hWgYNJIR8iDz1LcCAUWOsbnI+IsB76ipVgokMu9Pp8oKZcyYBWyWqSU8J5aNprWFSazQKPUU8VJBCW5K2iHb9X0TYyttLz9SKbnbEFNDeY7c+mp/m9APnYujGq0dCSblKALHfhBxOV+aE2akkIOKlP2GQ+kcshr4kwMcfA8/YfjJMeu9IX6VlwbW3iV7iuAgUAX87uhXYkGx+vwSFCrQwOB6RS3tODxuQsR7cGAPxoYxmEM6Wp2mUKGNiOMS0+uThAOP8wVDsFWjb42kdS/H+GAwKqIls4NBaidfpQH1iggG7S8ZyXrtGybtwzqIZm853cyXiC2SnCu1yN6a7O/iGDS9/PklvGtldnr/2tY5vGgSHIllWdRFrRe2M+DlUll3SJXBHWszTgfskoioxA/F2OlAoXcR6SlFM7QOI3CfnqOry/0ce69esUyTUG1ANiwJ5v9sjY8EVnPiFey8XuhZt2HyxkR8HQxdLJNdhl/HX0/XB1W3jzBfMMR1AO+y6VdrUM2wI9Mu5YUkY7hqssJCRF10iXwcA6MoJWtzRYJp5HaZGfTKPoSCA3Yeh9xIFWLGbq4JrsQwca5/hLXmF5HcPyFMovrguHiurVZSHQepYWXq7Pv98Yz248= x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: d493eb69-8d09-48d4-6618-08d7e88d2ae3 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Apr 2020 20:22:10.2643 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: /Pa4hfhOM6wZBGaZDO8kkrk8NAYlUKpSsOgy2mhFGCpY+Ia7I4D4ST5FAGaL+dAVTSfzYy632DRfhOIwUXwsLg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0744 Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_CY4PR21MB074379549C211D9C070F13D6EFD00CY4PR21MB0743namp_" --_000_CY4PR21MB074379549C211D9C070F13D6EFD00CY4PR21MB0743namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Bret Barkelew - Bret ________________________________ From: devel@edk2.groups.io on behalf of Michael Kub= acki via groups.io Sent: Monday, April 20, 2020 12:12:13 PM To: devel@edk2.groups.io Cc: Jordan Justen ; Andrew Fish ; Ray Ni Subject: [EXTERNAL] [edk2-devel] [PATCH v2 3/6] EmulatorPkg: Add Platform = CI and configuration for Core CI From: Sean Brogan REF:https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbu= gzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2570&data=3D02%7C01%7CBret.B= arkelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed95e%7C72f988bf86f141= af91ab2d7cd011db47%7C1%7C0%7C637230067846856524&sdata=3DsD1c4yU98JcgeHN= ncveZX%2BA%2BfP211%2F8JZloAyO7%2BrUg%3D&reserved=3D0 Add new Azure Pipeline definitions to build and run EmulatorPkg with: * Ubuntu GCC5 * Windows VS2019 Add PyTool based build of EmulatorPkg Add EmulatorPkg.ci.yaml for Core CI Add ReadMe.rst for status, details and instructions Cc: Jordan Justen Cc: Andrew Fish Cc: Ray Ni Signed-off-by: Sean Brogan Signed-off-by: Michael Kubacki --- EmulatorPkg/EmulatorPkg.ci.yaml | 85 ++++++ EmulatorPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml | 95 +++++++ EmulatorPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml | 85 ++++++ EmulatorPkg/PlatformCI/PlatformBuild.py | 272 +++++++++= +++++++++++ EmulatorPkg/README.rst | 175 +++++++++= ++++ 5 files changed, 712 insertions(+) diff --git a/EmulatorPkg/EmulatorPkg.ci.yaml b/EmulatorPkg/EmulatorPkg.ci.= yaml new file mode 100644 index 000000000000..81f81780ec76 --- /dev/null +++ b/EmulatorPkg/EmulatorPkg.ci.yaml @@ -0,0 +1,85 @@ +## @file +# Core CI configuration for EmulatorPkg +# +# EmulatorPkg is part of Platform Ci for builds so this is only +# used for code analysis. +# +# Copyright (c) Microsoft Corporation +# SPDX-License-Identifier: BSD-2-Clause-Patent +## +{ + ## options defined .pytool/Plugin/CompilerPlugin + "CompilerPlugin": { + "DscPath": "" # Don't support this test + }, + + ## options defined .pytool/Plugin/HostUnitTestCompilerPlugin + "HostUnitTestCompilerPlugin": { + "DscPath": "" # Don't support this test + }, + + ## options defined .pytool/Plugin/CharEncodingCheck + "CharEncodingCheck": { + "IgnoreFiles": [] + }, + + ## options defined .pytool/Plugin/DependencyCheck + "DependencyCheck": { + "AcceptableDependencies": [ + # For this platform all packages are allowed??? + "MdePkg/MdePkg.dec", + "MdeModulePkg/MdeModulePkg.dec", + "EmulatorPkg/EmulatorPkg.dec", + "NetworkPkg/NetworkPkg.dec", + "EmbeddedPkg/EmbeddedPkg.dec", ## is this one OK?? + ], + # For host based unit tests + "AcceptableDependencies-HOST_APPLICATION":[ + "UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec" + ], + # For UEFI shell based apps + "AcceptableDependencies-UEFI_APPLICATION":[], + "IgnoreInf": [] + }, + + ## options defined .pytool/Plugin/DscCompleteCheck + "DscCompleteCheck": { + "IgnoreInf": [""], + "DscPath": "" # Don't support this test + }, + + ## options defined .pytool/Plugin/HostUnitTestDscCompleteCheck + "HostUnitTestDscCompleteCheck": { + "IgnoreInf": [""], + "DscPath": "" # Don't support this test + }, + + ## options defined .pytool/Plugin/GuidCheck + "GuidCheck": { + "IgnoreGuidName": [], + "IgnoreGuidValue": [], + "IgnoreFoldersAndFiles": [], + "IgnoreDuplicates": [], + }, + + ## options defined .pytool/Plugin/LibraryClassCheck + "LibraryClassCheck": { + "IgnoreHeaderFile": [] + }, + + ## options defined .pytool/Plugin/SpellCheck + "SpellCheck": { + "AuditOnly": True, # Fails right now with over 270 erro= rs + "IgnoreFiles": [], # use gitignore syntax to ignore err= ors in matching files + "ExtendWords": [ + "setjump", + "plong", + "lparam", + "lpdword", + "lpthread", + "lresult", + ], # words to extend to the dictionary for this package + "IgnoreStandardPaths": [], # Standard Plugin defined paths that= should be ignore + "AdditionalIncludePaths": [] # Additional paths to spell check (w= ildcards supported) + } +} diff --git a/EmulatorPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml b/Emul= atorPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml new file mode 100644 index 000000000000..12ef8226ff54 --- /dev/null +++ b/EmulatorPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml @@ -0,0 +1,95 @@ +## @file +# Azure Pipeline build file for building a platform. +# +# Platform: EmulatorPkg +# OS: Ubuntu +# Toolchain: GCC5 +# +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: BSD-2-Clause-Patent +## +trigger: + - master +pr: + - master +jobs: + - job: Platform_CI + variables: + package: 'EmulatorPkg' + vm_image: 'ubuntu-latest' + should_run: false + run_flags: "MAKE_STARTUP_NSH=3DTRUE" + + #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) + + workspace: + clean: all + + pool: + vmImage: $(vm_image) + + steps: + - template: ../../../.azurepipelines/templates/platform-build-run-ste= ps.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) + # Add steps to install some IA32 only dependencies + extra_install_step: + - bash: sudo dpkg --add-architecture i386 + displayName: Add i386 to dpkg + condition: and(gt(variables.pkg_count, 0), eq(variables['Build.= Arch'], 'IA32'), succeeded()) + - bash: sudo apt-get update + displayName: do apt-get update + condition: and(gt(variables.pkg_count, 0), eq(variables['Build.= Arch'], 'IA32'), succeeded()) + - bash: sudo apt-get install libc6-dev:i386 libx11-dev:i386 libxe= xt-dev:i386 lib32gcc-7-dev + displayName: Add additional i386 packages + condition: and(gt(variables.pkg_count, 0), eq(variables['Build.= Arch'], 'IA32'), succeeded()) diff --git a/EmulatorPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml b/E= mulatorPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml new file mode 100644 index 000000000000..a5baf4b6064b --- /dev/null +++ b/EmulatorPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml @@ -0,0 +1,85 @@ +## @file +# Azure Pipeline build file for building a platform. +# +# Platform: EMULATORPKG +# OS: Windows +# Toolchain: VS2019 +# +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: BSD-2-Clause-Patent +## +trigger: + - master +pr: + - master + +jobs: + - job: Platform_CI + variables: + package: 'EmulatorPkg' + vm_image: 'windows-latest' + should_run: true + run_flags: "MAKE_STARTUP_NSH=3DTRUE" + + #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) + + workspace: + clean: all + + pool: + vmImage: $(vm_image) + + steps: + - template: ../../../.azurepipelines/templates/platform-build-run-ste= ps.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) diff --git a/EmulatorPkg/PlatformCI/PlatformBuild.py b/EmulatorPkg/Platfor= mCI/PlatformBuild.py new file mode 100644 index 000000000000..6defbf6ef148 --- /dev/null +++ b/EmulatorPkg/PlatformCI/PlatformBuild.py @@ -0,0 +1,272 @@ +# @file +# Script to Build EmulatorPkg UEFI firmware +# +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: BSD-2-Clause-Patent +## +import os +import logging +import io + +from edk2toolext.environment import shell_environment +from edk2toolext.environment.uefi_build import UefiBuilder +from edk2toolext.invocables.edk2_platform_build import BuildSettingsManag= er +from edk2toolext.invocables.edk2_setup import SetupSettingsManager, Requi= redSubmodule +from edk2toolext.invocables.edk2_update import UpdateSettingsManager +from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager +from edk2toollib.utility_functions import RunCmd +from edk2toollib.utility_functions import GetHostInfo + +# #######################################################################= ################ # +# Common Configuration = # +# #######################################################################= ################ # + + +class CommonPlatform(): + ''' Common settings for this platform. Define static data here and u= se + for the different parts of stuart + ''' + PackagesSupported =3D ("EmulatorPkg",) + ArchSupported =3D ("X64", "IA32") + TargetsSupported =3D ("DEBUG", "RELEASE", "NOOPT") + Scopes =3D ('emulatorpkg', 'edk2-build') + WorkspaceRoot =3D os.path.realpath(os.path.join( + os.path.dirname(os.path.abspath(__file__)), "..", "..")) + + # ###################################################################= #################### # + # Configuration for Update & Setup = # + # ###################################################################= #################### # + + +class SettingsManager(UpdateSettingsManager, SetupSettingsManager, PrEval= SettingsManager): + + def GetPackagesSupported(self): + ''' return iterable of edk2 packages supported by this build. + These should be edk2 workspace relative paths ''' + return CommonPlatform.PackagesSupported + + def GetArchitecturesSupported(self): + ''' return iterable of edk2 architectures supported by this build= ''' + return CommonPlatform.ArchSupported + + def GetTargetsSupported(self): + ''' return iterable of edk2 target tags supported by this build '= '' + return CommonPlatform.TargetsSupported + + def GetRequiredSubmodules(self): + ''' return iterable containing RequiredSubmodule objects. + If no RequiredSubmodules return an empty iterable + ''' + rs =3D [] + # intentionally declare this one with recursive false to avoid ov= erhead + rs.append(RequiredSubmodule( + "CryptoPkg/Library/OpensslLib/openssl", False)) + + # To avoid maintenance of this file for every new submodule + # lets just parse the .gitmodules and add each if not already in = list. + # The GetRequiredSubmodules is designed to allow a build to optim= ize + # the desired submodules but it isn't necessary for this reposito= ry. + result =3D io.StringIO() + ret =3D RunCmd("git", "config --file .gitmodules --get-regexp pat= h", workingdir=3Dself.GetWorkspaceRoot(), outstream=3Dresult) + # Cmd output is expected to look like: + # submodule.CryptoPkg/Library/OpensslLib/openssl.path CryptoPkg/L= ibrary/OpensslLib/openssl + # submodule.SoftFloat.path ArmPkg/Library/ArmSoftFloatLib/berkele= y-softfloat-3 + if ret =3D=3D 0: + for line in result.getvalue().splitlines(): + _, _, path =3D line.partition(" ") + if path is not None: + if path not in [x.path for x in rs]: + rs.append(RequiredSubmodule(path, True)) # add it= with recursive since we don't know + return rs + + def SetArchitectures(self, list_of_requested_architectures): + ''' Confirm the requests architecture list is valid and configure= SettingsManager + to run only the requested architectures. + + Raise Exception if a list_of_requested_architectures is not suppo= rted + ''' + unsupported =3D set(list_of_requested_architectures) - \ + set(self.GetArchitecturesSupported()) + if(len(unsupported) > 0): + errorString =3D ( + "Unsupported Architecture Requested: " + " ".join(unsuppo= rted)) + logging.critical(errorString) + raise Exception(errorString) + self.ActualArchitectures =3D list_of_requested_architectures + + def GetWorkspaceRoot(self): + ''' get WorkspacePath ''' + return CommonPlatform.WorkspaceRoot + + def GetActiveScopes(self): + ''' return tuple containing scopes that should be active for this= process ''' + return CommonPlatform.Scopes + + def FilterPackagesToTest(self, changedFilesList: list, potentialPacka= gesList: list) -> list: + ''' Filter other cases that this package should be built + based on changed files. This should cover things that can't + be detected as dependencies. ''' + build_these_packages =3D [] + possible_packages =3D potentialPackagesList.copy() + for f in changedFilesList: + # BaseTools files that might change the build + if "BaseTools" in f: + if os.path.splitext(f) not in [".txt", ".md"]: + build_these_packages =3D possible_packages + break + # if the azure pipeline platform template file changed + if "platform-build-run-steps.yml" in f: + build_these_packages =3D possible_packages + break + return build_these_packages + + def GetPlatformDscAndConfig(self) -> tuple: + ''' If a platform desires to provide its DSC then Policy 4 will e= valuate if + any of the changes will be built in the dsc. + + The tuple should be (, ) + ''' + return (os.path.join("EmulatorPkg", "EmulatorPkg.dsc"), {}) + + # ###################################################################= #################### # + # Actual Configuration for Platform Build = # + # ###################################################################= #################### # + + +class PlatformBuilder(UefiBuilder, BuildSettingsManager): + def __init__(self): + UefiBuilder.__init__(self) + + def AddCommandLineOptions(self, parserObj): + ''' Add command line options to the argparser ''' + parserObj.add_argument('-a', "--arch", dest=3D"build_arch", type= =3Dstr, default=3D"X64", + help=3D"Optional - architecture to build. = IA32 will use IA32 for Pei & Dxe. " + "X64 will use X64 for both PEI and DXE.") + + def RetrieveCommandLineOptions(self, args): + ''' Retrieve command line options from the argparser ''' + + shell_environment.GetBuildVars().SetValue( + "TARGET_ARCH", args.build_arch.upper(), "From CmdLine") + shell_environment.GetBuildVars().SetValue( + "ACTIVE_PLATFORM", "EmulatorPkg/EmulatorPkg.dsc", "From CmdLi= ne") + + def GetWorkspaceRoot(self): + ''' get WorkspacePath ''' + return CommonPlatform.WorkspaceRoot + + def GetPackagesPath(self): + ''' Return a list of workspace relative paths that should be mapp= ed as edk2 PackagesPath ''' + return () + + def GetActiveScopes(self): + ''' return tuple containing scopes that should be active for this= process ''' + return CommonPlatform.Scopes + + def GetName(self): + ''' Get the name of the repo, platform, or product being build ''= ' + ''' Used for naming the log file, among others ''' + + # check the startup nsh flag and if set then rename the log file. + # this helps in CI so we don't overwrite the build log since runn= ing + # uses the stuart_build command. + if(shell_environment.GetBuildVars().GetValue("MAKE_STARTUP_NSH", = "FALSE") =3D=3D "TRUE"): + return "EmulatorPkg_With_Run" + return "EmulatorPkg" + + def GetLoggingLevel(self, loggerType): + ''' Get the logging level for a given type + base =3D=3D lowest logging level supported + con =3D=3D Screen logging + txt =3D=3D plain text file logging + md =3D=3D markdown file logging + ''' + return logging.DEBUG + + def SetPlatformEnv(self): + logging.debug("PlatformBuilder SetPlatformEnv") + self.env.SetValue("PRODUCT_NAME", "EmulatorPkg", "Platform Hardco= ded") + self.env.SetValue("TOOL_CHAIN_TAG", "VS2019", "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") =3D=3D "VS2019" or self.en= v.GetValue("TOOL_CHAIN_TAG") =3D=3D "VS2017": + key =3D self.env.GetValue("TOOL_CHAIN_TAG") + "_HOST" + if self.env.GetValue("TARGET_ARCH") =3D=3D "IA32": + shell_environment.ShellEnvironment().set_shell_var(key, "= x86") + elif self.env.GetValue("TARGET_ARCH") =3D=3D "X64": + shell_environment.ShellEnvironment().set_shell_var(key, "= x64") + + # Add support for using the correct Platform Headers, tools, and = Libs based on emulator architecture + # requested to be built when building on linux. + if GetHostInfo().os.upper() =3D=3D "LINUX": + self.ConfigureLinuxDLinkPath() + + if GetHostInfo().os.upper() =3D=3D "WINDOWS": + self.env.SetValue("BLD_*_WIN_HOST_BUILD", "TRUE", + "Trigger Windows host build") + + self.env.SetValue("MAKE_STARTUP_NSH", "FALSE", "Default to false"= ) + + # I don't see what this does but it is in build.sh + key =3D "BLD_*_BUILD_" + self.env.GetValue("TARGET_ARCH") + self.env.SetValue(key, "TRUE", "match script in build.sh") + return 0 + + def PlatformPreBuild(self): + return 0 + + def PlatformPostBuild(self): + return 0 + + def FlashRomImage(self): + ''' Use the FlashRom Function to run the emulator. This gives an= easy stuart command line to + activate the emulator. ''' + + OutputPath =3D os.path.join(self.env.GetValue( + "BUILD_OUTPUT_BASE"), self.env.GetValue("TARGET_ARCH")) + + if (self.env.GetValue("MAKE_STARTUP_NSH") =3D=3D "TRUE"): + f =3D open(os.path.join(OutputPath, "startup.nsh"), "w") + f.write("BOOT SUCCESS !!! \n") + # add commands here + f.write("reset\n") + f.close() + + if GetHostInfo().os.upper() =3D=3D "WINDOWS": + cmd =3D "WinHost.exe" + elif GetHostInfo().os.upper() =3D=3D "LINUX": + cmd =3D "./Host" + else: + logging.critical("Unsupported Host") + return -1 + return RunCmd(cmd, "", workingdir=3DOutputPath) + + def ConfigureLinuxDLinkPath(self): + ''' + logic copied from build.sh to setup the correct libraries + ''' + if self.env.GetValue("TARGET_ARCH") =3D=3D "IA32": + LIB_NAMES =3D ["ld-linux.so.2", "libdl.so.2 crt1.o", "crti.o = crtn.o"] + LIB_SEARCH_PATHS =3D ["/usr/lib/i386-linux-gnu", + "/usr/lib32", "/lib32", "/usr/lib", "/lib= "] + elif self.env.GetValue("TARGET_ARCH") =3D=3D "X64": + LIB_NAMES =3D ["ld-linux-x86-64.so.2", + "libdl.so.2", "crt1.o", "crti.o", "crtn.o"] + LIB_SEARCH_PATHS =3D ["/usr/lib/x86_64-linux-gnu", + "/usr/lib64", "/lib64", "/usr/lib", "/lib= "] + + HOST_DLINK_PATHS =3D "" + for lname in LIB_NAMES: + logging.debug(f"Looking for {lname}") + for dname in LIB_SEARCH_PATHS: + logging.debug(f"In {dname}") + if os.path.isfile(os.path.join(dname, lname)): + logging.debug(f"Found {lname} in {dname}") + HOST_DLINK_PATHS +=3D os.path.join( + os.path.join(dname, lname)) + os.pathsep + break + HOST_DLINK_PATHS =3D HOST_DLINK_PATHS.rstrip(os.pathsep) + logging.critical(f"Setting HOST_DLINK_PATHS to {HOST_DLINK_PATHS}= ") + shell_environment.ShellEnvironment().set_shell_var( + "HOST_DLINK_PATHS", HOST_DLINK_PATHS) diff --git a/EmulatorPkg/README.rst b/EmulatorPkg/README.rst new file mode 100644 index 000000000000..d1aa0a367965 --- /dev/null +++ b/EmulatorPkg/README.rst @@ -0,0 +1,175 @@ +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +EmulatorPkg +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +This README.rst summarizes the current state of Azure DevOps Platform CI +for EmulatorPkg. It also describes how to *build* EmulatorPkg locally usi= ng the +Pytools build system. For general documentation on EmulatorPkg, refer +to the `ReadMe <./Readme.md>`_. + +Platform CI Current Status +--------------------------- + +IA32 Configuration +`````````````````` +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D= = =3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D= = =3D=3D=3D=3D=3D=3D + Toolchain DEBUG RELEASE NOOPT +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D= = =3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D= = =3D=3D=3D=3D=3D=3D +`Win VS2019`_ |ap32d| |ap32r| |ap32n| +`Ubuntu GCC5`_ |ap32du| |ap32ru| |ap32nu| +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D= = =3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D= = =3D=3D=3D=3D=3D=3D + +|TCBZ_2668|_ - Ubuntu GCC5 Segfaults during execution. The builds +only compile for Ubuntu GCC5 (not run to shell). + +X64 Configuration +````````````````` +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D= = =3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D= = =3D=3D=3D=3D=3D=3D + Toolchain DEBUG RELEASE NOOPT +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D= = =3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D= = =3D=3D=3D=3D=3D=3D +`Win VS2019`_ |ap64d| |ap64r| |ap64n| +`Ubuntu GCC5`_ |ap64du| |ap64ru| |ap64nu| +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D= = =3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D= = =3D=3D=3D=3D=3D=3D + +|TCBZ_2639|_ - Ubuntu GCC5 Segfaults during execution. The builds +only compile for Ubuntu GCC5 (not run to shell). + +Setup +----- + +The Usual EDK2 Build Setup +`````````````````````````` + +- `Python 3.8.x - Download & Install `_ +- `GIT - Download & Install `_ +- `GIT - Configure for EDK II `_ +- `EDKII Source - Download/Checkout from Github `_ + +**NOTE:** Do *not* follow the EDK II Compile Tools and Build instructions= , see below... + +Install the necessary development packages for your distribution +```````````````````````````````````````````````````````````````` + +This varies by distribution, toolchain, and your configuration but here a= re a few hints. + +* For building ARCH IA32 on X64 Ubuntu 18.04 LTS these steps where needed= . + + .. code-block:: bash + + sudo dpkg --add-architecture i386 + sudo apt-get update + sudo apt-get install libc6-dev:i386 libx11-dev:i386 libxext-dev:i386 = lib32gcc-7-dev + +* For building Basetools and other host applications + + .. code-block:: bash + + sudo apt-get update + sudo apt-get install gcc g++ make uuid-dev + +Differences from EDK Classic Build Setup +```````````````````````````````````````` + +- Build BaseTools using `python BaseTools/Edk2ToolsBuild.py [-t ]` + + - This replaces `edksetup Rebuild`" from the classic build system + - For Windows `` examples, refer to `Windows ToolChain Ma= trix `_, + defaults to `VS2017` if not specified + +- **No Action:** edksetup, Submodule initialization and manual setup of N= ASM and iASL are **not** required, it is + handled by the Pytools build system + +Install & Configure Pytools for EmulatorPkg +``````````````````````````````````````````` + +* Install Pytools + + .. code-block:: bash + + pip install --upgrade -r pip-requirements.txt + +* Initialize & Update Submodules + + .. code-block:: bash + + stuart_setup -c EmulatorPkg/PlatformCI/PlatformBuild.py + +* Initialize & Update Dependencies (e.g. iASL & NASM) + + .. code-block:: bash + + stuart_update -c EmulatorPkg/PlatformCI/PlatformBuild.py + +* Compile (IA32 or X64 supported) + + .. code-block:: bash + + stuart_build -c EmulatorPkg/PlatformCI/PlatformBuild.py [TOOL_CHAIN_T= AG=3D] -a + +* Running Emulator + + - You can add `--FlashRom` to the end of your build command and the emu= lator will run after the build is complete. + - or use the `--FlashOnly` feature to just run the emulator. + + .. code-block:: bash + + stuart_build -c EmulatorPkg/PlatformCI/PlatformBuild.py TOOL_CHAIN_TA= G=3D -a --FlashOnly + +**NOTE:** configuring ACTIVE_PLATFORM and TARGET_ARCH in Conf/target.txt = is *not* required. +This environment is set by PlatformBuild.py based upon the `[-a ]` parameter. + +Custom Build Options +```````````````````` + +**MAKE_STARTUP_NSH=3DTRUE** will output a *startup.nsh* file to the locat= ion mapped as fs0. This is used in CI in +combination with the `--FlashOnly` feature to run the emulator to the UEF= I shell and then execute the +contents of startup.nsh. + +Passing Build Defines +````````````````````` + +To pass build defines through stuart_build, prepend `BLD_*_` to the defin= e name and pass it on the command-line. +stuart_build currently requires values to be assigned, so add a `=3D1` su= ffix for bare defines. +For example, to enable the IP6 Network Stack, the stuart_build command-li= ne would be: + +.. code-block:: bash + + stuart_build -c EmulatorPkg/PlatformCI/PlatformBuild.py BLD_*_NETWORK_I= P6_ENABLE=3D1 + +References +---------- + +- `Installing Pytools `_ +- For each workspace, consider creating & using a `Python Virtual Environ= ment `_ + + * `Sample Layout `_ + +- `stuart_build commandline parser `_ + + +.. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +.. This is a bunch of directives to make the README file more readable +.. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +.. |TCBZ_2668| image:: https://nam06.safelinks.protection.outlook.com/?ur= l=3Dhttps%3A%2F%2Fimg.shields.io%2Fbugzilla%2F2668%3FbaseUrl%3Dhttps%253A%2= 52F%252Fbugzilla.tianocore.org&data=3D02%7C01%7CBret.Barkelew%40microso= ft.com%7C60f1628fdb874f6eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db4= 7%7C1%7C0%7C637230067846866478&sdata=3D%2F4beWFJGZt3Y6Dwoy6kncF1LBqlIPI= 00HTgExl2sIIA%3D&reserved=3D0 +.. _TCBZ_2668: https://nam06.safelinks.protection.outlook.com/?url=3Dhttp= s%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2668&data=3D02%7= C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed95e%7C72= f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637230067846866478&sdata=3Drd0= kLIJUxWe64zS47%2BEjvqr7ZuhIdQv18W06Gc3%2FHDk%3D&reserved=3D0 + +.. |TCBZ_2639| image:: https://nam06.safelinks.protection.outlook.com/?ur= l=3Dhttps%3A%2F%2Fimg.shields.io%2Fbugzilla%2F2639%3FbaseUrl%3Dhttps%253A%2= 52F%252Fbugzilla.tianocore.org&data=3D02%7C01%7CBret.Barkelew%40microso= ft.com%7C60f1628fdb874f6eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db4= 7%7C1%7C0%7C637230067846866478&sdata=3DFrC7IHjytho3X9PW%2BGootElj1K%2B0= o%2B5QCCG5lufqncY%3D&reserved=3D0 +.. _TCBZ_2639: https://nam06.safelinks.protection.outlook.com/?url=3Dhttp= s%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2639&data=3D02%7= C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed95e%7C72= f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637230067846866478&sdata=3DMSv= MhRRPL%2FIMq8wOQlvStw0Dzq%2BmtGBsdDLPCf6UEic%3D&reserved=3D0 + +.. _Win VS2019: https://nam06.safelinks.protection.outlook.com/?url=3Dht= tps%3A%2F%2Fdev.azure.com%2Ftianocore%2Fedk2-ci-play%2F_build%2Flatest%3Fde= finitionId%3D40%26branchName%3Dmaster&data=3D02%7C01%7CBret.Barkelew%40= microsoft.com%7C60f1628fdb874f6eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7c= d011db47%7C1%7C0%7C637230067846866478&sdata=3DraTqUt0KjgAFwO%2FsB9VY5yG= tqRHYUntKZk3ENp2Nh8o%3D&reserved=3D0 +.. _Ubuntu GCC5: https://nam06.safelinks.protection.outlook.com/?url=3Dht= tps%3A%2F%2Fdev.azure.com%2Ftianocore%2Fedk2-ci-play%2F_build%2Flatest%3Fde= finitionId%3D39%26branchName%3Dmaster&data=3D02%7C01%7CBret.Barkelew%40= microsoft.com%7C60f1628fdb874f6eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7c= d011db47%7C1%7C0%7C637230067846866478&sdata=3DdXUMFuAjB1njpE5Krr9aX8W1p= CrqygffF18jMEvp5nM%3D&reserved=3D0 + +.. |ap32d| image:: https://nam06.safelinks.protection.outlook.com/?url=3D= https%3A%2F%2Fdev.azure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%2Fst= atus%2FEmulatorPkg%2FEmulatorPkg%2520Windows%2520VS2019%3FbranchName%3Dmast= er%26jobName%3DPlatform_CI%26configuration%3DPlatform_CI%2520EmulatorPkg_IA= 32_DEBUG&data=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874= f6eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6372300678= 46866478&sdata=3DVaYoGOdbPTWreXMVOyDuLmJfTeSNnHnPvsTXSnrTJyA%3D&res= erved=3D0 +.. |ap32du| image:: https://nam06.safelinks.protection.outlook.com/?url= =3Dhttps%3A%2F%2Fdev.azure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%= 2Fstatus%2FEmulatorPkg%2FEmulatorPkg%2520Ubuntu%2520GCC5%3FbranchName%3Dmas= ter%26jobName%3DPlatform_CI%26configuration%3DPlatform_CI%2520EmulatorPkg_I= A32_DEBUG&data=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb87= 4f6eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637230067= 846866478&sdata=3DtHIiLKT23FXzpQenoVNNjgqWfNXd45kCqs%2FROIJRD1o%3D&= reserved=3D0 +.. |ap32r| image:: https://nam06.safelinks.protection.outlook.com/?url=3D= https%3A%2F%2Fdev.azure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%2Fst= atus%2FEmulatorPkg%2FEmulatorPkg%2520Windows%2520VS2019%3FbranchName%3Dmast= er%26jobName%3DPlatform_CI%26configuration%3DPlatform_CI%2520EmulatorPkg_IA= 32_RELEASE&data=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb8= 74f6eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63723006= 7846876439&sdata=3DuHhvdU6zwyAoq2NaFzRRf1af99Caj166ZwNgMaqLd1M%3D&r= eserved=3D0 +.. |ap32ru| image:: https://nam06.safelinks.protection.outlook.com/?url= =3Dhttps%3A%2F%2Fdev.azure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%= 2Fstatus%2FEmulatorPkg%2FEmulatorPkg%2520Ubuntu%2520GCC5%3FbranchName%3Dmas= ter%26jobName%3DPlatform_CI%26configuration%3DPlatform_CI%2520EmulatorPkg_I= A32_RELEASE&data=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb= 874f6eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6372300= 67846876439&sdata=3DPJat%2F3WWl0gXk5CcvUxlzVpHtYYNxTcRwhn7rQ7Ke%2B0%3D&= amp;reserved=3D0 +.. |ap32n| image:: https://nam06.safelinks.protection.outlook.com/?url=3D= https%3A%2F%2Fdev.azure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%2Fst= atus%2FEmulatorPkg%2FEmulatorPkg%2520Windows%2520VS2019%3FbranchName%3Dmast= er%26jobName%3DPlatform_CI%26configuration%3DPlatform_CI%2520EmulatorPkg_IA= 32_NOOPT&data=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874= f6eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6372300678= 46876439&sdata=3D9NuYzTrU3ejU%2FR7rG%2B5Q88%2F8dkPeDYQgRoAoGjkjUTQ%3D&a= mp;reserved=3D0 +.. |ap32nu| image:: https://nam06.safelinks.protection.outlook.com/?url= =3Dhttps%3A%2F%2Fdev.azure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%= 2Fstatus%2FEmulatorPkg%2FEmulatorPkg%2520Ubuntu%2520GCC5%3FbranchName%3Dmas= ter%26jobName%3DPlatform_CI%26configuration%3DPlatform_CI%2520EmulatorPkg_I= A32_NOOPT&data=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb87= 4f6eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637230067= 846876439&sdata=3D9K8HEeu3921Sq5Fqh1dCOhwLv0lZb3iIr4CAukyxl8s%3D&re= served=3D0 + +.. |ap64d| image:: https://nam06.safelinks.protection.outlook.com/?url=3D= https%3A%2F%2Fdev.azure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%2Fst= atus%2FEmulatorPkg%2FEmulatorPkg%2520Ubuntu%2520GCC5%3FbranchName%3Dmaster%= 26jobName%3DPlatform_CI%26configuration%3DPlatform_CI%2520EmulatorPkg_X64_D= EBUG&data=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874f6ee= f3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63723006784687= 6439&sdata=3DB3Qa3vLBgmPTN8HbU2zch5y%2F0A06fwD91Yq7VD9urx8%3D&reser= ved=3D0 +.. |ap64du| image:: https://nam06.safelinks.protection.outlook.com/?url= =3Dhttps%3A%2F%2Fdev.azure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%= 2Fstatus%2FEmulatorPkg%2FEmulatorPkg%2520Ubuntu%2520GCC5%3FbranchName%3Dmas= ter%26jobName%3DPlatform_CI%26configuration%3DPlatform_CI%2520EmulatorPkg_X= 64_DEBUG&data=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874= f6eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6372300678= 46876439&sdata=3DB3Qa3vLBgmPTN8HbU2zch5y%2F0A06fwD91Yq7VD9urx8%3D&r= eserved=3D0 +.. |ap64r| image:: https://nam06.safelinks.protection.outlook.com/?url=3D= https%3A%2F%2Fdev.azure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%2Fst= atus%2FEmulatorPkg%2FEmulatorPkg%2520Ubuntu%2520GCC5%3FbranchName%3Dmaster%= 26jobName%3DPlatform_CI%26configuration%3DPlatform_CI%2520EmulatorPkg_X64_R= ELEASE&data=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874f6= eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637230067846= 876439&sdata=3DxqgwH4hsdvKNFm%2FgmhxDLy007VbWBBOhgrgEgbcJGOw%3D&res= erved=3D0 +.. |ap64ru| image:: https://nam06.safelinks.protection.outlook.com/?url= =3Dhttps%3A%2F%2Fdev.azure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%= 2Fstatus%2FEmulatorPkg%2FEmulatorPkg%2520Ubuntu%2520GCC5%3FbranchName%3Dmas= ter%26jobName%3DPlatform_CI%26configuration%3DPlatform_CI%2520EmulatorPkg_X= 64_RELEASE&data=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb8= 74f6eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63723006= 7846876439&sdata=3DxqgwH4hsdvKNFm%2FgmhxDLy007VbWBBOhgrgEgbcJGOw%3D&= ;reserved=3D0 +.. |ap64n| image:: https://nam06.safelinks.protection.outlook.com/?url=3D= https%3A%2F%2Fdev.azure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%2Fst= atus%2FEmulatorPkg%2FEmulatorPkg%2520Ubuntu%2520GCC5%3FbranchName%3Dmaster%= 26jobName%3DPlatform_CI%26configuration%3DPlatform_CI%2520EmulatorPkg_X64_N= OOPT&data=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874f6ee= f3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63723006784687= 6439&sdata=3DhInPpx3zQpbIZ1uwgW43py4pFJlS%2BvOtbYtnTokzhJk%3D&reser= ved=3D0 +.. |ap64nu| image:: https://nam06.safelinks.protection.outlook.com/?url= =3Dhttps%3A%2F%2Fdev.azure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%= 2Fstatus%2FEmulatorPkg%2FEmulatorPkg%2520Ubuntu%2520GCC5%3FbranchName%3Dmas= ter%26jobName%3DPlatform_CI%26configuration%3DPlatform_CI%2520EmulatorPkg_X= 64_NOOPT&data=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874= f6eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6372300678= 46876439&sdata=3DhInPpx3zQpbIZ1uwgW43py4pFJlS%2BvOtbYtnTokzhJk%3D&r= eserved=3D0 -- 2.16.3.windows.1 --_000_CY4PR21MB074379549C211D9C070F13D6EFD00CY4PR21MB0743namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Reviewed-by: Bret Barkelew <bret.barkelew@micros= oft.com>

 

- Bret

 


From: devel@edk2.groups.io= <devel@edk2.groups.io> on behalf of Michael Kubacki via groups.io &l= t;michael.kubacki=3Doutlook.com@groups.io>
Sent: Monday, April 20, 2020 12:12:13 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Jordan Justen <jordan.l.justen@intel.com>; Andrew Fish &l= t;afish@apple.com>; Ray Ni <ray.ni@intel.com>
Subject: [EXTERNAL] [edk2-devel] [PATCH v2 3/6] EmulatorPkg: Add Pl= atform CI and configuration for Core CI
 
From: Sean Brogan <sean.brogan@microsoft.com&g= t;

REF:https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbu= gzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2570&amp;data=3D02%7C01%7CBr= et.Barkelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed95e%7C72f988bf86= f141af91ab2d7cd011db47%7C1%7C0%7C637230067846856524&amp;sdata=3DsD1c4yU= 98JcgeHNncveZX%2BA%2BfP211%2F8JZloAyO7%2BrUg%3D&amp;reserved=3D0

Add new Azure Pipeline definitions to build and run EmulatorPkg with:
  * Ubuntu GCC5
  * Windows VS2019
Add PyTool based build of EmulatorPkg
Add EmulatorPkg.ci.yaml for Core CI
Add ReadMe.rst for status, details and instructions

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
---
 EmulatorPkg/EmulatorPkg.ci.yaml      &= nbsp;           &nbs= p;        |  85 ++++= ;++
 EmulatorPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml  &n= bsp; |  95 +++++++
 EmulatorPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml |  85= ++++++
 EmulatorPkg/PlatformCI/PlatformBuild.py     = ;            &n= bsp; | 272 +++++++++++++= ;+++++++
 EmulatorPkg/README.rst       &nbs= p;            &= nbsp;           &nbs= p;   | 175 +++++++++++= ;++
 5 files changed, 712 insertions(+)

diff --git a/EmulatorPkg/EmulatorPkg.ci.yaml b/EmulatorPkg/EmulatorPkg.ci.= yaml
new file mode 100644
index 000000000000..81f81780ec76
--- /dev/null
+++ b/EmulatorPkg/EmulatorPkg.ci.yaml
@@ -0,0 +1,85 @@
+## @file
+# Core CI configuration for EmulatorPkg
+#
+# EmulatorPkg is part of Platform Ci for builds so this is only
+# used for code analysis.
+#
+# Copyright (c) Microsoft Corporation
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+{
+    ## options defined .pytool/Plugin/CompilerPlugin +    "CompilerPlugin": {
+        "DscPath": "= ;" # Don't support this test
+    },
+
+    ## options defined .pytool/Plugin/HostUnitTestComp= ilerPlugin
+    "HostUnitTestCompilerPlugin": {
+        "DscPath": "= ;" # Don't support this test
+    },
+
+    ## options defined .pytool/Plugin/CharEncodingChec= k
+    "CharEncodingCheck": {
+        "IgnoreFiles": [= ]
+    },
+
+    ## options defined .pytool/Plugin/DependencyCheck<= br> +    "DependencyCheck": {
+        "AcceptableDependenci= es": [
+            # = For this platform all packages are allowed???
+            &q= uot;MdePkg/MdePkg.dec",
+            &q= uot;MdeModulePkg/MdeModulePkg.dec",
+            &q= uot;EmulatorPkg/EmulatorPkg.dec",
+            &q= uot;NetworkPkg/NetworkPkg.dec",
+            &q= uot;EmbeddedPkg/EmbeddedPkg.dec", ## is this one OK??
+        ],
+        # For host based unit test= s
+        "AcceptableDependenci= es-HOST_APPLICATION":[
+            &q= uot;UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec"
+        ],
+        # For UEFI shell based app= s
+        "AcceptableDependenci= es-UEFI_APPLICATION":[],
+        "IgnoreInf": []<= br> +    },
+
+    ## options defined .pytool/Plugin/DscCompleteCheck=
+    "DscCompleteCheck": {
+        "IgnoreInf": [&q= uot;"],
+        "DscPath": "= ;"  # Don't support this test
+    },
+
+    ## options defined .pytool/Plugin/HostUnitTestDscC= ompleteCheck
+    "HostUnitTestDscCompleteCheck": {
+        "IgnoreInf": [&q= uot;"],
+        "DscPath": "= ;" # Don't support this test
+    },
+
+    ## options defined .pytool/Plugin/GuidCheck
+    "GuidCheck": {
+        "IgnoreGuidName"= : [],
+        "IgnoreGuidValue"= ;: [],
+        "IgnoreFoldersAndFile= s": [],
+        "IgnoreDuplicates&quo= t;: [],
+    },
+
+    ## options defined .pytool/Plugin/LibraryClassChec= k
+    "LibraryClassCheck": {
+        "IgnoreHeaderFile&quo= t;: []
+    },
+
+    ## options defined .pytool/Plugin/SpellCheck
+    "SpellCheck": {
+        "AuditOnly": Tru= e,           # Fails righ= t now with over 270 errors
+        "IgnoreFiles": [= ],           # use gitign= ore syntax to ignore errors in matching files
+        "ExtendWords": [=
+            &q= uot;setjump",
+            &q= uot;plong",
+            &q= uot;lparam",
+            &q= uot;lpdword",
+            &q= uot;lpthread",
+            &q= uot;lresult",
+        ],    =        # words to extend to the dictionary fo= r this package
+        "IgnoreStandardPaths&= quot;: [],   # Standard Plugin defined paths that should be ignor= e
+        "AdditionalIncludePat= hs": [] # Additional paths to spell check (wildcards supported)
+    }
+}
diff --git a/EmulatorPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml b/Emul= atorPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml
new file mode 100644
index 000000000000..12ef8226ff54
--- /dev/null
+++ b/EmulatorPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml @@ -0,0 +1,95 @@
+## @file
+# Azure Pipeline build file for building a platform.
+#
+# Platform: EmulatorPkg
+# OS: Ubuntu
+# Toolchain: GCC5
+#
+# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+trigger:
+  - master
+pr:
+  - master
+jobs:
+  - job: Platform_CI
+    variables:
+      package: 'EmulatorPkg'
+      vm_image: 'ubuntu-latest'
+      should_run: false
+      run_flags: "MAKE_STARTUP_NSH=3DTR= UE"
+
+    #Use matrix to speed up the build process
+    strategy:
+        matrix:
+          EmulatorPkg_X6= 4_DEBUG:
+            Bu= ild.File: "$(package)/PlatformCI/PlatformBuild.py"
+            Bu= ild.Arch: "X64"
+            Bu= ild.Flags: ""
+            Bu= ild.Target: "DEBUG"
+            Ru= n.Flags: $(run_flags)
+            Ru= n: $(should_run)
+          EmulatorPkg_X6= 4_RELEASE:
+            Bu= ild.File: "$(package)/PlatformCI/PlatformBuild.py"
+            Bu= ild.Arch: "X64"
+            Bu= ild.Flags: ""
+            Bu= ild.Target: "RELEASE"
+            Ru= n.Flags: $(run_flags)
+            Ru= n: $(should_run)
+          EmulatorPkg_X6= 4_NOOPT:
+            Bu= ild.File: "$(package)/PlatformCI/PlatformBuild.py"
+            Bu= ild.Arch: "X64"
+            Bu= ild.Flags: ""
+            Bu= ild.Target: "NOOPT"
+            Ru= n.Flags: $(run_flags)
+            Ru= n: $(should_run)
+          EmulatorPkg_IA= 32_DEBUG:
+            Bu= ild.File: "$(package)/PlatformCI/PlatformBuild.py"
+            Bu= ild.Arch: "IA32"
+            Bu= ild.Flags: ""
+            Bu= ild.Target: "DEBUG"
+            Ru= n.Flags: $(run_flags)
+            Ru= n: $(should_run)
+          EmulatorPkg_IA= 32_RELEASE:
+            Bu= ild.File: "$(package)/PlatformCI/PlatformBuild.py"
+            Bu= ild.Arch: "IA32"
+            Bu= ild.Flags: ""
+            Bu= ild.Target: "RELEASE"
+            Ru= n.Flags: $(run_flags)
+            Ru= n: $(should_run)
+          EmulatorPkg_IA= 32_NOOPT:
+            Bu= ild.File: "$(package)/PlatformCI/PlatformBuild.py"
+            Bu= ild.Arch: "IA32"
+            Bu= ild.Flags: ""
+            Bu= ild.Target: "NOOPT"
+            Ru= n.Flags: $(run_flags)
+            Ru= n: $(should_run)
+
+    workspace:
+      clean: all
+
+    pool:
+      vmImage: $(vm_image)
+
+    steps:
+    - template: ../../../.azurepipelines/templates/pla= tform-build-run-steps.yml
+      parameters:
+        tool_chain_tag: GCC5
+        build_pkg: $(package)
+        build_target: $(Build.Targ= et)
+        build_arch: $(Build.Arch)<= br> +        build_file: $(Build.File)<= br> +        build_flags: $(Build.Flags= )
+        run_flags: $(Run.Flags) +        # Add steps to install som= e IA32 only dependencies
+        extra_install_step:
+        - bash: sudo dpkg --add-ar= chitecture i386
+          displayName: A= dd i386 to dpkg
+          condition: and= (gt(variables.pkg_count, 0), eq(variables['Build.Arch'], 'IA32'), succeeded= ())
+        - bash: sudo apt-get updat= e
+          displayName: d= o apt-get update
+          condition: and= (gt(variables.pkg_count, 0), eq(variables['Build.Arch'], 'IA32'), succeeded= ())
+        - bash: sudo apt-get insta= ll libc6-dev:i386 libx11-dev:i386 libxext-dev:i386 lib32gcc-7-dev
+          displayName: A= dd additional i386 packages
+          condition: and= (gt(variables.pkg_count, 0), eq(variables['Build.Arch'], 'IA32'), succeeded= ())
diff --git a/EmulatorPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml b/E= mulatorPkg/PlatformCI/.azurepipelines/Windows-VS2019.yml
new file mode 100644
index 000000000000..a5baf4b6064b
--- /dev/null
+++ b/EmulatorPkg/PlatformCI/.azurepipelines/Windows-VS2019.ym= l
@@ -0,0 +1,85 @@
+## @file
+# Azure Pipeline build file for building a platform.
+#
+# Platform: EMULATORPKG
+# OS: Windows
+# Toolchain: VS2019
+#
+# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+trigger:
+  - master
+pr:
+  - master
+
+jobs:
+  - job: Platform_CI
+    variables:
+      package: 'EmulatorPkg'
+      vm_image: 'windows-latest'
+      should_run: true
+      run_flags: "MAKE_STARTUP_NSH=3DTR= UE"
+
+    #Use matrix to speed up the build process
+    strategy:
+        matrix:
+          EmulatorPkg_X6= 4_DEBUG:
+            Bu= ild.File: "$(package)/PlatformCI/PlatformBuild.py"
+            Bu= ild.Arch: "X64"
+            Bu= ild.Flags: ""
+            Bu= ild.Target: "DEBUG"
+            Ru= n.Flags: $(run_flags)
+            Ru= n: $(should_run)
+          EmulatorPkg_X6= 4_RELEASE:
+            Bu= ild.File: "$(package)/PlatformCI/PlatformBuild.py"
+            Bu= ild.Arch: "X64"
+            Bu= ild.Flags: ""
+            Bu= ild.Target: "RELEASE"
+            Ru= n.Flags: $(run_flags)
+            Ru= n: $(should_run)
+          EmulatorPkg_X6= 4_NOOPT:
+            Bu= ild.File: "$(package)/PlatformCI/PlatformBuild.py"
+            Bu= ild.Arch: "X64"
+            Bu= ild.Flags: ""
+            Bu= ild.Target: "NOOPT"
+            Ru= n.Flags: $(run_flags)
+            Ru= n: $(should_run)
+          EmulatorPkg_IA= 32_DEBUG:
+            Bu= ild.File: "$(package)/PlatformCI/PlatformBuild.py"
+            Bu= ild.Arch: "IA32 "
+            Bu= ild.Flags: ""
+            Bu= ild.Target: "DEBUG"
+            Ru= n.Flags: $(run_flags)
+            Ru= n: $(should_run)
+          EmulatorPkg_IA= 32_RELEASE:
+            Bu= ild.File: "$(package)/PlatformCI/PlatformBuild.py"
+            Bu= ild.Arch: "IA32 "
+            Bu= ild.Flags: ""
+            Bu= ild.Target: "RELEASE"
+            Ru= n.Flags: $(run_flags)
+            Ru= n: $(should_run)
+          EmulatorPkg_IA= 32_NOOPT:
+            Bu= ild.File: "$(package)/PlatformCI/PlatformBuild.py"
+            Bu= ild.Arch: "IA32 "
+            Bu= ild.Flags: ""
+            Bu= ild.Target: "NOOPT"
+            Ru= n.Flags: $(run_flags)
+            Ru= n: $(should_run)
+
+    workspace:
+      clean: all
+
+    pool:
+      vmImage: $(vm_image)
+
+    steps:
+    - template: ../../../.azurepipelines/templates/pla= tform-build-run-steps.yml
+      parameters:
+        tool_chain_tag: VS2019
+        build_pkg: $(package)
+        build_target: $(Build.Targ= et)
+        build_arch: $(Build.Arch)<= br> +        build_file: $(Build.File)<= br> +        build_flags: $(Build.Flags= )
+        run_flags: $(Run.Flags) diff --git a/EmulatorPkg/PlatformCI/PlatformBuild.py b/EmulatorPkg/Platfor= mCI/PlatformBuild.py
new file mode 100644
index 000000000000..6defbf6ef148
--- /dev/null
+++ b/EmulatorPkg/PlatformCI/PlatformBuild.py
@@ -0,0 +1,272 @@
+# @file
+# Script to Build EmulatorPkg UEFI firmware
+#
+# Copyright (c) Microsoft Corporation.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+import os
+import logging
+import io
+
+from edk2toolext.environment import shell_environment
+from edk2toolext.environment.uefi_build import UefiBuilder
+from edk2toolext.invocables.edk2_platform_build import BuildSettingsM= anager
+from edk2toolext.invocables.edk2_setup import SetupSettingsManager, R= equiredSubmodule
+from edk2toolext.invocables.edk2_update import UpdateSettingsManager<= br> +from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager=
+from edk2toollib.utility_functions import RunCmd
+from edk2toollib.utility_functions import GetHostInfo
+
+# ###################################################################= #################### #
+#           &n= bsp;            = ;        Common Configuration  = ;            &n= bsp;            = ;          #
+# ###################################################################= #################### #
+
+
+class CommonPlatform():
+    ''' Common settings for this platform.  Defin= e static data here and use
+        for the different parts of= stuart
+    '''
+    PackagesSupported =3D ("EmulatorPkg",) +    ArchSupported =3D ("X64", "IA32&quo= t;)
+    TargetsSupported =3D ("DEBUG", "REL= EASE", "NOOPT")
+    Scopes =3D ('emulatorpkg', 'edk2-build')
+    WorkspaceRoot =3D os.path.realpath(os.path.join( +        os.path.dirname(os.path.ab= spath(__file__)), "..", ".."))
+
+    # ################################################= ####################################### #
+    #        &= nbsp;           &nbs= p;    Configuration for Update & Setup   =             &nb= sp;            =     #
+    # ################################################= ####################################### #
+
+
+class SettingsManager(UpdateSettingsManager, SetupSettingsManager, Pr= EvalSettingsManager):
+
+    def GetPackagesSupported(self):
+        ''' return iterable of edk= 2 packages supported by this build.
+        These should be edk2 works= pace relative paths '''
+        return CommonPlatform.Pack= agesSupported
+
+    def GetArchitecturesSupported(self):
+        ''' return iterable of edk= 2 architectures supported by this build '''
+        return CommonPlatform.Arch= Supported
+
+    def GetTargetsSupported(self):
+        ''' return iterable of edk= 2 target tags supported by this build '''
+        return CommonPlatform.Targ= etsSupported
+
+    def GetRequiredSubmodules(self):
+        ''' return iterable contai= ning RequiredSubmodule objects.
+        If no RequiredSubmodules r= eturn an empty iterable
+        '''
+        rs =3D []
+        # intentionally declare th= is one with recursive false to avoid overhead
+        rs.append(RequiredSubmodul= e(
+            &q= uot;CryptoPkg/Library/OpensslLib/openssl", False))
+
+        # To avoid maintenance of = this file for every new submodule
+        # lets just parse the .git= modules and add each if not already in list.
+        # The GetRequiredSubmodule= s is designed to allow a build to optimize
+        # the desired submodules b= ut it isn't necessary for this repository.
+        result =3D io.StringIO() +        ret =3D RunCmd("git&q= uot;, "config --file .gitmodules --get-regexp path", workingdir= =3Dself.GetWorkspaceRoot(), outstream=3Dresult)
+        # Cmd output is expected t= o look like:
+        # submodule.CryptoPkg/Libr= ary/OpensslLib/openssl.path CryptoPkg/Library/OpensslLib/openssl
+        # submodule.SoftFloat.path= ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3
+        if ret =3D=3D 0:
+            fo= r line in result.getvalue().splitlines():
+           &nb= sp;    _, _, path =3D line.partition(" ")
+           &nb= sp;    if path is not None:
+           &nb= sp;        if path not in [x.path for x = in rs]:
+           &nb= sp;            rs.ap= pend(RequiredSubmodule(path, True)) # add it with recursive since we don't = know
+        return rs
+
+    def SetArchitectures(self, list_of_requested_archi= tectures):
+        ''' Confirm the requests a= rchitecture list is valid and configure SettingsManager
+        to run only the requested = architectures.
+
+        Raise Exception if a list_= of_requested_architectures is not supported
+        '''
+        unsupported =3D set(list_o= f_requested_architectures) - \
+            se= t(self.GetArchitecturesSupported())
+        if(len(unsupported) > 0= ):
+            er= rorString =3D (
+           &nb= sp;    "Unsupported Architecture Requested: " += ; " ".join(unsupported))
+            lo= gging.critical(errorString)
+            ra= ise Exception(errorString)
+        self.ActualArchitectures = =3D list_of_requested_architectures
+
+    def GetWorkspaceRoot(self):
+        ''' get WorkspacePath '''<= br> +        return CommonPlatform.Work= spaceRoot
+
+    def GetActiveScopes(self):
+        ''' return tuple containin= g scopes that should be active for this process '''
+        return CommonPlatform.Scop= es
+
+    def FilterPackagesToTest(self, changedFilesList: l= ist, potentialPackagesList: list) -> list:
+        ''' Filter other cases tha= t this package should be built
+        based on changed files. Th= is should cover things that can't
+        be detected as dependencie= s. '''
+        build_these_packages =3D [= ]
+        possible_packages =3D pote= ntialPackagesList.copy()
+        for f in changedFilesList:=
+            # = BaseTools files that might change the build
+            if= "BaseTools" in f:
+           &nb= sp;    if os.path.splitext(f) not in [".txt", &quo= t;.md"]:
+           &nb= sp;        build_these_packages =3D poss= ible_packages
+           &nb= sp;        break
+            # = if the azure pipeline platform template file changed
+            if= "platform-build-run-steps.yml" in f:
+           &nb= sp;    build_these_packages =3D possible_packages
+           &nb= sp;    break
+        return build_these_package= s
+
+    def GetPlatformDscAndConfig(self) -> tuple:
+        ''' If a platform desires = to provide its DSC then Policy 4 will evaluate if
+        any of the changes will be= built in the dsc.
+
+        The tuple should be (<w= orkspace relative path to dsc file>, <input dictionary of dsc key val= ue pairs>)
+        '''
+        return (os.path.join("= ;EmulatorPkg", "EmulatorPkg.dsc"), {})
+
+    # ################################################= ####################################### #
+    #        &= nbsp;           &nbs= p;    Actual Configuration for Platform Build  &nb= sp;            =           #
+    # ################################################= ####################################### #
+
+
+class PlatformBuilder(UefiBuilder, BuildSettingsManager):
+    def __init__(self):
+        UefiBuilder.__init__(self)=
+
+    def AddCommandLineOptions(self, parserObj):
+        ''' Add command line optio= ns to the argparser '''
+        parserObj.add_argument('-a= ', "--arch", dest=3D"build_arch", type=3Dstr, default= =3D"X64",
+           &nb= sp;            =        help=3D"Optional - architecture t= o build.  IA32 will use IA32 for Pei & Dxe. "
+           &nb= sp;            =        "X64 will use X64 for both PEI an= d DXE.")
+
+    def RetrieveCommandLineOptions(self, args):
+        '''  Retrieve command= line options from the argparser '''
+
+        shell_environment.GetBuild= Vars().SetValue(
+            &q= uot;TARGET_ARCH", args.build_arch.upper(), "From CmdLine") +        shell_environment.GetBuild= Vars().SetValue(
+            &q= uot;ACTIVE_PLATFORM", "EmulatorPkg/EmulatorPkg.dsc", "F= rom CmdLine")
+
+    def GetWorkspaceRoot(self):
+        ''' get WorkspacePath '''<= br> +        return CommonPlatform.Work= spaceRoot
+
+    def GetPackagesPath(self):
+        ''' Return a list of works= pace relative paths that should be mapped as edk2 PackagesPath '''
+        return ()
+
+    def GetActiveScopes(self):
+        ''' return tuple containin= g scopes that should be active for this process '''
+        return CommonPlatform.Scop= es
+
+    def GetName(self):
+        ''' Get the name of the re= po, platform, or product being build '''
+        ''' Used for naming the lo= g file, among others '''
+
+        # check the startup nsh fl= ag and if set then rename the log file.
+        # this helps in CI so we d= on't overwrite the build log since running
+        # uses the stuart_build co= mmand.
+        if(shell_environment.GetBu= ildVars().GetValue("MAKE_STARTUP_NSH", "FALSE") =3D=3D = "TRUE"):
+            re= turn "EmulatorPkg_With_Run"
+        return "EmulatorPkg&q= uot;
+
+    def GetLoggingLevel(self, loggerType):
+        ''' Get the logging level = for a given type
+        base =3D=3D lowest logging= level supported
+        con  =3D=3D Screen lo= gging
+        txt  =3D=3D plain tex= t file logging
+        md   =3D=3D mark= down file logging
+        '''
+        return logging.DEBUG
+
+    def SetPlatformEnv(self):
+        logging.debug("Platfo= rmBuilder SetPlatformEnv")
+        self.env.SetValue("PR= ODUCT_NAME", "EmulatorPkg", "Platform Hardcoded")<= br> +        self.env.SetValue("TO= OL_CHAIN_TAG", "VS2019", "Default Toolchain")
+
+        # Add support for using th= e correct Platform Headers, tools, and Libs based on emulator architecture<= br> +        # requested to be built wh= en building VS2019 or VS2017
+        if self.env.GetValue("= ;TOOL_CHAIN_TAG") =3D=3D "VS2019" or self.env.GetValue("= ;TOOL_CHAIN_TAG") =3D=3D "VS2017":
+            ke= y =3D self.env.GetValue("TOOL_CHAIN_TAG") + "_HOST"=
+            if= self.env.GetValue("TARGET_ARCH") =3D=3D "IA32":
+           &nb= sp;    shell_environment.ShellEnvironment().set_shell_var(ke= y, "x86")
+            el= if self.env.GetValue("TARGET_ARCH") =3D=3D "X64":
+           &nb= sp;    shell_environment.ShellEnvironment().set_shell_var(ke= y, "x64")
+
+        # Add support for using th= e correct Platform Headers, tools, and Libs based on emulator architecture<= br> +        # requested to be built wh= en building on linux.
+        if GetHostInfo().os.upper(= ) =3D=3D "LINUX":
+            se= lf.ConfigureLinuxDLinkPath()
+
+        if GetHostInfo().os.upper(= ) =3D=3D "WINDOWS":
+            se= lf.env.SetValue("BLD_*_WIN_HOST_BUILD", "TRUE",
+           &nb= sp;            =       "Trigger Windows host build")
+
+        self.env.SetValue("MA= KE_STARTUP_NSH", "FALSE", "Default to false")
+
+        # I don't see what this do= es but it is in build.sh
+        key =3D "BLD_*_BUILD_= " + self.env.GetValue("TARGET_ARCH")
+        self.env.SetValue(key, &qu= ot;TRUE", "match script in build.sh")
+        return 0
+
+    def PlatformPreBuild(self):
+        return 0
+
+    def PlatformPostBuild(self):
+        return 0
+
+    def FlashRomImage(self):
+        ''' Use the FlashRom Funct= ion to run the emulator.  This gives an easy stuart command line to +        activate the emulator. '''=
+
+        OutputPath =3D os.path.joi= n(self.env.GetValue(
+            &q= uot;BUILD_OUTPUT_BASE"), self.env.GetValue("TARGET_ARCH")) +
+        if (self.env.GetValue(&quo= t;MAKE_STARTUP_NSH") =3D=3D "TRUE"):
+            f = = =3D open(os.path.join(OutputPath, "startup.nsh"), "w")=
+            f.= write("BOOT SUCCESS !!! \n")
+            # = add commands here
+            f.= write("reset\n")
+            f.= close()
+
+        if GetHostInfo().os.upper(= ) =3D=3D "WINDOWS":
+            cm= d =3D "WinHost.exe"
+        elif GetHostInfo().os.uppe= r() =3D=3D "LINUX":
+            cm= d =3D "./Host"
+        else:
+            lo= gging.critical("Unsupported Host")
+            re= turn -1
+        return RunCmd(cmd, "&= quot;, workingdir=3DOutputPath)
+
+    def ConfigureLinuxDLinkPath(self):
+        '''
+        logic copied from build.sh= to setup the correct libraries
+        '''
+        if self.env.GetValue("= ;TARGET_ARCH") =3D=3D "IA32":
+            LI= B_NAMES =3D ["ld-linux.so.2", "libdl.so.2 crt1.o", &quo= t;crti.o crtn.o"]
+            LI= B_SEARCH_PATHS =3D ["/usr/lib/i386-linux-gnu",
+           &nb= sp;            =         "/usr/lib32", "/l= ib32", "/usr/lib", "/lib"]
+        elif self.env.GetValue(&qu= ot;TARGET_ARCH") =3D=3D "X64":
+            LI= B_NAMES =3D ["ld-linux-x86-64.so.2",
+           &nb= sp;            = "libdl.so.2", "crt1.o", "crti.o", "crtn= .o"]
+            LI= B_SEARCH_PATHS =3D ["/usr/lib/x86_64-linux-gnu",
+           &nb= sp;            =         "/usr/lib64", "/l= ib64", "/usr/lib", "/lib"]
+
+        HOST_DLINK_PATHS =3D "= ;"
+        for lname in LIB_NAMES: +            lo= gging.debug(f"Looking for {lname}")
+            fo= r dname in LIB_SEARCH_PATHS:
+           &nb= sp;    logging.debug(f"In {dname}")
+           &nb= sp;    if os.path.isfile(os.path.join(dname, lname)):
+           &nb= sp;        logging.debug(f"Found {l= name} in {dname}")
+           &nb= sp;        HOST_DLINK_PATHS +=3D os.= path.join(
+           &nb= sp;            os.pa= th.join(dname, lname)) + os.pathsep
+           &nb= sp;        break
+        HOST_DLINK_PATHS =3D HOST_= DLINK_PATHS.rstrip(os.pathsep)
+        logging.critical(f"Se= tting HOST_DLINK_PATHS to {HOST_DLINK_PATHS}")
+        shell_environment.ShellEnv= ironment().set_shell_var(
+            &q= uot;HOST_DLINK_PATHS", HOST_DLINK_PATHS)
diff --git a/EmulatorPkg/README.rst b/EmulatorPkg/README.rst
new file mode 100644
index 000000000000..d1aa0a367965
--- /dev/null
+++ b/EmulatorPkg/README.rst
@@ -0,0 +1,175 @@
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
+EmulatorPkg
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
+
+This README.rst summarizes the current state of Azure DevOps Platform= CI
+for EmulatorPkg. It also describes how to *build* EmulatorPkg locally= using the
+Pytools build system. For general documentation on EmulatorPkg, refer=
+to the `ReadMe <./Readme.md>`_.
+
+Platform CI Current Status
+---------------------------
+
+IA32 Configuration
+``````````````````
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D= = =3D=3D=3D=3D=3D=3D=3D=3D
+ Toolchain      DEBUG    = ;     RELEASE       NOOPT=
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D= = =3D=3D=3D=3D=3D=3D=3D=3D
+`Win VS2019`_   |ap32d|      = |ap32r|       |ap32n|
+`Ubuntu GCC5`_  |ap32du|      |ap32ru|&= nbsp;     |ap32nu|
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D= = =3D=3D=3D=3D=3D=3D=3D=3D
+
+|TCBZ_2668|_ - Ubuntu GCC5 Segfaults during execution.  The buil= ds
+only compile for Ubuntu GCC5 (not run to shell).
+
+X64 Configuration
+`````````````````
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D= = =3D=3D=3D=3D=3D=3D=3D=3D
+ Toolchain      DEBUG    = ;     RELEASE       NOOPT=
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D= = =3D=3D=3D=3D=3D=3D=3D=3D
+`Win VS2019`_   |ap64d|      = |ap64r|       |ap64n|
+`Ubuntu GCC5`_  |ap64du|      |ap64ru|&= nbsp;     |ap64nu|
+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D= = =3D=3D=3D=3D=3D=3D=3D=3D
+
+|TCBZ_2639|_ - Ubuntu GCC5 Segfaults during execution.  The buil= ds
+only compile for Ubuntu GCC5 (not run to shell).
+
+Setup
+-----
+
+The Usual EDK2 Build Setup
+``````````````````````````
+
+- `Python 3.8.x - Download & Install <https://nam06.safelinks.protection.outlook.com/?url= = =3Dhttps%3A%2F%2Fwww.python.org%2Fdownloads%2F&amp;data=3D02%7C01%7CBr= et.Barkelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed95e%7C72f988bf86= f141af91ab2d7cd011db47%7C1%7C0%7C637230067846866478&amp;sdata=3DVjf04Z3= oIDa91k4spCGkxMDrF5swmbNUnpCaji6RbIU%3D&amp;reserved=3D0>`_
+- `GIT - Download & Install <https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%= 3A%2F%2Fgit-scm.com%2Fdownload%2F&amp;data=3D02%7C01%7CBret.Barkelew%40= microsoft.com%7C60f1628fdb874f6eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7c= d011db47%7C1%7C0%7C637230067846866478&amp;sdata=3DYjKDYF7%2BznyPzZ3cZLD= haGV8zdD76%2BslDoOAWoYEUkk%3D&amp;reserved=3D0>`_
+- `GIT - Configure for EDK II <= https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgithub.= com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FWindows-systems%23github-hel= p&amp;data=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874f6e= ef3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6372300678468= 66478&amp;sdata=3D4BR3zol%2FCC6G%2BiSHGCC3%2FkJqcXNVteeGVkc%2Bs3eDjgQ%3= D&amp;reserved=3D0>`_
+- `EDKII Source - Download/Checkout from Github <https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2F= github.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FWindows-systems%23dow= nload&amp;data=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb87= 4f6eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637230067= 846866478&amp;sdata=3DzyCa6iThiL9Tdhfr55RbsBvPtclAwzlgzEgWHCzCdA4%3D&am= p;amp;reserved=3D0>`_
+
+**NOTE:** Do *not* follow the EDK II Compile Tools and Build instruct= ions, see below...
+
+Install the necessary development packages for your distribution
+````````````````````````````````````````````````````````````````
+
+This varies by distribution, toolchain, and your configuration but he= re are a few hints.
+
+* For building ARCH IA32 on X64 Ubuntu 18.04 LTS these steps where ne= eded.
+
+  .. code-block:: bash
+
+    sudo dpkg --add-architecture i386
+    sudo apt-get update
+    sudo apt-get install libc6-dev:i386 libx11-dev:i38= 6 libxext-dev:i386 lib32gcc-7-dev
+
+* For building Basetools and other host applications
+
+  .. code-block:: bash
+
+    sudo apt-get update
+    sudo apt-get install gcc g++ make uuid-dev=
+
+Differences from EDK Classic Build Setup
+````````````````````````````````````````
+
+- Build BaseTools using `python BaseTools/Edk2ToolsBuild.py [-t <T= oolChainTag>]`
+
+  - This replaces `edksetup Rebuild`" from the classic buil= d system
+  - For Windows `<ToolChainTag>` examples, refer to `Windo= ws ToolChain Matrix <https://nam06.saf= elinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgithub.com%2Ftianocore%2= Ftianocore.github.io%2Fwiki%2FWindows-systems-ToolChain-Matrix&amp;data= = =3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed= 95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637230067846866478&amp= ;sdata=3Dkdd51pesL8Yqtay%2BXxF%2B7nzFUNuKxhl2LwZaF6RNUWI%3D&amp;reserve= d=3D0>`_,
+    defaults to `VS2017` if not specified
+
+- **No Action:** edksetup, Submodule initialization and manual setup = of NASM and iASL are **not** required, it is
+  handled by the Pytools build system
+
+Install & Configure Pytools for EmulatorPkg
+```````````````````````````````````````````
+
+* Install Pytools
+
+  .. code-block:: bash
+
+    pip install --upgrade -r pip-requirements.txt
+
+* Initialize & Update Submodules
+
+  .. code-block:: bash
+
+    stuart_setup -c EmulatorPkg/PlatformCI/PlatformBui= ld.py
+
+* Initialize & Update Dependencies (e.g. iASL & NASM)
+
+  .. code-block:: bash
+
+    stuart_update -c EmulatorPkg/PlatformCI/PlatformBu= ild.py
+
+* Compile (IA32 or X64 supported)
+
+  .. code-block:: bash
+
+    stuart_build -c EmulatorPkg/PlatformCI/PlatformBui= ld.py [TOOL_CHAIN_TAG=3D<TOOL_CHAIN_TAG>] -a <TARGET_ARCH>
+
+* Running Emulator
+
+  - You can add `--FlashRom` to the end of your build command an= d the emulator will run after the build is complete.
+  - or use the `--FlashOnly` feature to just run the emulator. +
+  .. code-block:: bash
+
+    stuart_build -c EmulatorPkg/PlatformCI/PlatformBui= ld.py TOOL_CHAIN_TAG=3D<TOOL_CHAIN_TAG> -a <TARGET_ARCH> --Flas= hOnly
+
+**NOTE:** configuring ACTIVE_PLATFORM and TARGET_ARCH in Conf/target.= txt is *not* required.
+This environment is set by PlatformBuild.py based upon the `[-a <T= ARGET_ARCH>]` parameter.
+
+Custom Build Options
+````````````````````
+
+**MAKE_STARTUP_NSH=3DTRUE** will output a *startup.nsh* file to the l= ocation mapped as fs0. This is used in CI in
+combination with the `--FlashOnly` feature to run the emulator to the= UEFI shell and then execute the
+contents of startup.nsh.
+
+Passing Build Defines
+`````````````````````
+
+To pass build defines through stuart_build, prepend `BLD_*_` to the d= efine name and pass it on the command-line.
+stuart_build currently requires values to be assigned, so add a `=3D1= ` suffix for bare defines.
+For example, to enable the IP6 Network Stack, the stuart_build comman= d-line would be:
+
+.. code-block:: bash
+
+  stuart_build -c EmulatorPkg/PlatformCI/PlatformBuild.py BLD_*_= NETWORK_IP6_ENABLE=3D1
+
+References
+----------
+
+- `Installing Pytools <= https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgithub.= com%2Ftianocore%2Fedk2-pytool-extensions%2Fblob%2Fmaster%2Fdocs%2Fusing.md%= 23installing&amp;data=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f16= 28fdb874f6eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63= 7230067846866478&amp;sdata=3DCZsEm5tFfggyMkWtc7VdpHWfbvrh0EzMLxGNlI%2Fn= Sos%3D&amp;reserved=3D0>`_
+- For each workspace, consider creating & using a `Python Virtual= Environment <https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2F= docs.python.org%2F3%2Flibrary%2Fvenv.html&amp;data=3D02%7C01%7CBret.Bar= kelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed95e%7C72f988bf86f141af= 91ab2d7cd011db47%7C1%7C0%7C637230067846866478&amp;sdata=3DeA05o6eWi136%= 2FE2TdlesAoGEE2ijYkr75lvWQsHIUA8%3D&amp;reserved=3D0>`_
+
+  * `Sample Layout <https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%= 2F%2Fmicrosoft.github.io%2Fmu%2FCodeDevelopment%2Fprerequisites%2F%23worksp= ace-virtual-environment-setup-process&amp;data=3D02%7C01%7CBret.Barkele= w%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed95e%7C72f988bf86f141af91ab= 2d7cd011db47%7C1%7C0%7C637230067846866478&amp;sdata=3DqW%2FM8UCTr1IcHfz= uQqbDfDVyCmmzOqxyMgXltbaNltU%3D&amp;reserved=3D0>`_
+
+- `stuart_build commandline parser <https://nam06.safel= inks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgithub.com%2Ftianocore%2Fe= dk2-pytool-extensions%2Fblob%2F56f6a7aee09995c2f22da4765e8b0a29c1cbf5de%2Fe= dk2toolext%2Fedk2_invocable.py%23L109&amp;data=3D02%7C01%7CBret.Barkele= w%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed95e%7C72f988bf86f141af91ab= 2d7cd011db47%7C1%7C0%7C637230067846866478&amp;sdata=3DscBBDXAhn%2BtnVDX= TNLWHkv%2FHT4BGaxVPTh6Hj3CU5yg%3D&amp;reserved=3D0>`_
+
+
+.. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
+.. This is a bunch of directives to make the README file more readabl= e
+.. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
+
+.. |TCBZ_2668| image:: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fimg.sh= ields.io%2Fbugzilla%2F2668%3FbaseUrl%3Dhttps%253A%252F%252Fbugzilla.tianoco= re.org&amp;data=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb8= 74f6eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63723006= 7846866478&amp;sdata=3D%2F4beWFJGZt3Y6Dwoy6kncF1LBqlIPI00HTgExl2sIIA%3D= &amp;reserved=3D0
+.. _TCBZ_2668: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbugzil= la.tianocore.org%2Fshow_bug.cgi%3Fid%3D2668&amp;data=3D02%7C01%7CBret.B= arkelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed95e%7C72f988bf86f141= af91ab2d7cd011db47%7C1%7C0%7C637230067846866478&amp;sdata=3Drd0kLIJUxWe= 64zS47%2BEjvqr7ZuhIdQv18W06Gc3%2FHDk%3D&amp;reserved=3D0
+
+.. |TCBZ_2639| image:: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fimg.sh= ields.io%2Fbugzilla%2F2639%3FbaseUrl%3Dhttps%253A%252F%252Fbugzilla.tianoco= re.org&amp;data=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb8= 74f6eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63723006= 7846866478&amp;sdata=3DFrC7IHjytho3X9PW%2BGootElj1K%2B0o%2B5QCCG5lufqnc= Y%3D&amp;reserved=3D0
+.. _TCBZ_2639: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbugzil= la.tianocore.org%2Fshow_bug.cgi%3Fid%3D2639&amp;data=3D02%7C01%7CBret.B= arkelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed95e%7C72f988bf86f141= af91ab2d7cd011db47%7C1%7C0%7C637230067846866478&amp;sdata=3DMSvMhRR= PL%2FIMq8wOQlvStw0Dzq%2BmtGBsdDLPCf6UEic%3D&amp;reserved=3D0
+
+.. _Win VS2019:  https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fdev.az= ure.com%2Ftianocore%2Fedk2-ci-play%2F_build%2Flatest%3FdefinitionId%3D40%26= branchName%3Dmaster&amp;data=3D02%7C01%7CBret.Barkelew%40microsoft.com%= 7C60f1628fdb874f6eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7= C0%7C637230067846866478&amp;sdata=3DraTqUt0KjgAFwO%2FsB9VY5yGtqRHYUntKZ= k3ENp2Nh8o%3D&amp;reserved=3D0
+.. _Ubuntu GCC5: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fdev.az= ure.com%2Ftianocore%2Fedk2-ci-play%2F_build%2Flatest%3FdefinitionId%3D39%26= branchName%3Dmaster&amp;data=3D02%7C01%7CBret.Barkelew%40microsoft.com%= 7C60f1628fdb874f6eef3108d7e55ed95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7= C0%7C637230067846866478&amp;sdata=3DdXUMFuAjB1njpE5Krr9aX8W1pCrqygffF18= jMEvp5nM%3D&amp;reserved=3D0
+
+.. |ap32d| image:: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fdev.az= ure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%2Fstatus%2FEmulatorPkg%2= FEmulatorPkg%2520Windows%2520VS2019%3FbranchName%3Dmaster%26jobName%3DPlatf= orm_CI%26configuration%3DPlatform_CI%2520EmulatorPkg_IA32_DEBUG&amp;dat= a=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed= 95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637230067846866478&amp= ;sdata=3DVaYoGOdbPTWreXMVOyDuLmJfTeSNnHnPvsTXSnrTJyA%3D&amp;reserved=3D= 0
+.. |ap32du| image:: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fdev.az= ure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%2Fstatus%2FEmulatorPkg%2= FEmulatorPkg%2520Ubuntu%2520GCC5%3FbranchName%3Dmaster%26jobName%3DPlatform= _CI%26configuration%3DPlatform_CI%2520EmulatorPkg_IA32_DEBUG&amp;data= =3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed= 95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637230067846866478&amp= ;sdata=3DtHIiLKT23FXzpQenoVNNjgqWfNXd45kCqs%2FROIJRD1o%3D&amp;reserved= =3D0
+.. |ap32r| image:: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fdev.az= ure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%2Fstatus%2FEmulatorPkg%2= FEmulatorPkg%2520Windows%2520VS2019%3FbranchName%3Dmaster%26jobName%3DPlatf= orm_CI%26configuration%3DPlatform_CI%2520EmulatorPkg_IA32_RELEASE&amp;d= ata=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55= ed95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637230067846876439&a= mp;sdata=3DuHhvdU6zwyAoq2NaFzRRf1af99Caj166ZwNgMaqLd1M%3D&amp;reserved= =3D0
+.. |ap32ru| image:: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fdev.az= ure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%2Fstatus%2FEmulatorPkg%2= FEmulatorPkg%2520Ubuntu%2520GCC5%3FbranchName%3Dmaster%26jobName%3DPlatform= _CI%26configuration%3DPlatform_CI%2520EmulatorPkg_IA32_RELEASE&amp;data= = =3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed= 95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637230067846876439&amp= ;sdata=3DPJat%2F3WWl0gXk5CcvUxlzVpHtYYNxTcRwhn7rQ7Ke%2B0%3D&amp;reserve= d=3D0
+.. |ap32n| image:: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fdev.az= ure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%2Fstatus%2FEmulatorPkg%2= FEmulatorPkg%2520Windows%2520VS2019%3FbranchName%3Dmaster%26jobName%3DPlatf= orm_CI%26configuration%3DPlatform_CI%2520EmulatorPkg_IA32_NOOPT&amp;dat= a=3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed= 95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637230067846876439&amp= ;sdata=3D9NuYzTrU3ejU%2FR7rG%2B5Q88%2F8dkPeDYQgRoAoGjkjUTQ%3D&amp;reser= ved=3D0
+.. |ap32nu| image:: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fdev.az= ure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%2Fstatus%2FEmulatorPkg%2= FEmulatorPkg%2520Ubuntu%2520GCC5%3FbranchName%3Dmaster%26jobName%3DPlatform= _CI%26configuration%3DPlatform_CI%2520EmulatorPkg_IA32_NOOPT&amp;data= =3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed= 95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637230067846876439&amp= ;sdata=3D9K8HEeu3921Sq5Fqh1dCOhwLv0lZb3iIr4CAukyxl8s%3D&amp;reserved=3D= 0
+
+.. |ap64d| image:: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fdev.az= ure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%2Fstatus%2FEmulatorPkg%2= FEmulatorPkg%2520Ubuntu%2520GCC5%3FbranchName%3Dmaster%26jobName%3DPlatform= _CI%26configuration%3DPlatform_CI%2520EmulatorPkg_X64_DEBUG&amp;data=3D= 02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed95e%= 7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637230067846876439&amp;sda= ta=3DB3Qa3vLBgmPTN8HbU2zch5y%2F0A06fwD91Yq7VD9urx8%3D&amp;reserved=3D0<= /a>
+.. |ap64du| image::
https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fdev.az= ure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%2Fstatus%2FEmulatorPkg%2= FEmulatorPkg%2520Ubuntu%2520GCC5%3FbranchName%3Dmaster%26jobName%3DPlatform= _CI%26configuration%3DPlatform_CI%2520EmulatorPkg_X64_DEBUG&amp;data=3D= 02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed95e%= 7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637230067846876439&amp;sda= ta=3DB3Qa3vLBgmPTN8HbU2zch5y%2F0A06fwD91Yq7VD9urx8%3D&amp;reserved=3D0<= /a>
+.. |ap64r| image::
https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fdev.az= ure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%2Fstatus%2FEmulatorPkg%2= FEmulatorPkg%2520Ubuntu%2520GCC5%3FbranchName%3Dmaster%26jobName%3DPlatform= _CI%26configuration%3DPlatform_CI%2520EmulatorPkg_X64_RELEASE&amp;data= =3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed= 95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637230067846876439&amp= ;sdata=3DxqgwH4hsdvKNFm%2FgmhxDLy007VbWBBOhgrgEgbcJGOw%3D&amp;reserved= =3D0
+.. |ap64ru| image:: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fdev.az= ure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%2Fstatus%2FEmulatorPkg%2= FEmulatorPkg%2520Ubuntu%2520GCC5%3FbranchName%3Dmaster%26jobName%3DPlatform= _CI%26configuration%3DPlatform_CI%2520EmulatorPkg_X64_RELEASE&amp;data= =3D02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed= 95e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637230067846876439&amp= ;sdata=3DxqgwH4hsdvKNFm%2FgmhxDLy007VbWBBOhgrgEgbcJGOw%3D&amp;reserved= =3D0
+.. |ap64n| image:: https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fdev.az= ure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%2Fstatus%2FEmulatorPkg%2= FEmulatorPkg%2520Ubuntu%2520GCC5%3FbranchName%3Dmaster%26jobName%3DPlatform= _CI%26configuration%3DPlatform_CI%2520EmulatorPkg_X64_NOOPT&amp;data=3D= 02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed95e%= 7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637230067846876439&amp;sda= ta=3DhInPpx3zQpbIZ1uwgW43py4pFJlS%2BvOtbYtnTokzhJk%3D&amp;reserved=3D0<= /a>
+.. |ap64nu| image::
https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fdev.az= ure.com%2Ftianocore%2Fedk2-ci-play%2F_apis%2Fbuild%2Fstatus%2FEmulatorPkg%2= FEmulatorPkg%2520Ubuntu%2520GCC5%3FbranchName%3Dmaster%26jobName%3DPlatform= _CI%26configuration%3DPlatform_CI%2520EmulatorPkg_X64_NOOPT&amp;data=3D= 02%7C01%7CBret.Barkelew%40microsoft.com%7C60f1628fdb874f6eef3108d7e55ed95e%= 7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637230067846876439&amp;sda= ta=3DhInPpx3zQpbIZ1uwgW43py4pFJlS%2BvOtbYtnTokzhJk%3D&amp;reserved=3D0<= /a>
--
2.16.3.windows.1




--_000_CY4PR21MB074379549C211D9C070F13D6EFD00CY4PR21MB0743namp_--