public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] pip-requirements.txt: Update extensions min version to 0.13.3
@ 2020-04-07  6:47 Zhang, Shenglei
  2020-04-07  6:47 ` [PATCH] .azurepiplines/pr-gate-steps.yml: Update python to 3.8.x for ci build Zhang, Shenglei
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Zhang, Shenglei @ 2020-04-07  6:47 UTC (permalink / raw)
  To: devel; +Cc: Sean Brogan, Bret Barkelew, Michael D Kinney, Liming Gao

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2616
Pytool extensions are locked on 0.12.x but extensions has
moved to 0.13.x. So update the pip-requirements.txt.

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
---
 pip-requirements.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pip-requirements.txt b/pip-requirements.txt
index 6a41a95ec594..574dac43b1a6 100644
--- a/pip-requirements.txt
+++ b/pip-requirements.txt
@@ -9,8 +9,8 @@
 # https://pypi.org/project/pip/
 # https://pip.pypa.io/en/stable/user_guide/#requirements-files
 # https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format
-#
+# https://www.python.org/dev/peps/pep-0440/#version-specifiers
 ##
 
 edk2-pytool-library==0.10.*
-edk2-pytool-extensions==0.12.*
+edk2-pytool-extensions~=0.13.3
-- 
2.18.0.windows.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] .azurepiplines/pr-gate-steps.yml: Update python to 3.8.x for ci build
  2020-04-07  6:47 [PATCH] pip-requirements.txt: Update extensions min version to 0.13.3 Zhang, Shenglei
@ 2020-04-07  6:47 ` Zhang, Shenglei
  2020-04-07  7:52   ` [edk2-devel] " Liming Gao
  2020-04-09  5:13   ` Michael Kubacki
  2020-04-07  6:47 ` [PATCH] BaseTools/WindowsVsToolChain.py: Update toolchain plugin Zhang, Shenglei
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 10+ messages in thread
From: Zhang, Shenglei @ 2020-04-07  6:47 UTC (permalink / raw)
  To: devel; +Cc: Sean Brogan, Bret Barkelew, Michael D Kinney, Liming Gao

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2617
Update edk2 build and test ci to use Python 3.8.x

Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
---
 .azurepipelines/templates/pr-gate-steps.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.azurepipelines/templates/pr-gate-steps.yml b/.azurepipelines/templates/pr-gate-steps.yml
index a969661dea15..8c4ad4e2efe6 100644
--- a/.azurepipelines/templates/pr-gate-steps.yml
+++ b/.azurepipelines/templates/pr-gate-steps.yml
@@ -20,7 +20,7 @@ steps:
 
 - task: UsePythonVersion@0
   inputs:
-    versionSpec: '3.7.x'
+    versionSpec: '3.8.x'
     architecture: 'x64'
 
 - script: pip install -r pip-requirements.txt --upgrade
-- 
2.18.0.windows.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] BaseTools/WindowsVsToolChain.py: Update toolchain plugin
  2020-04-07  6:47 [PATCH] pip-requirements.txt: Update extensions min version to 0.13.3 Zhang, Shenglei
  2020-04-07  6:47 ` [PATCH] .azurepiplines/pr-gate-steps.yml: Update python to 3.8.x for ci build Zhang, Shenglei
@ 2020-04-07  6:47 ` Zhang, Shenglei
  2020-04-07 21:31   ` [EXTERNAL] [edk2-devel] " Bret Barkelew
  2020-04-07  7:52 ` [edk2-devel] [PATCH] pip-requirements.txt: Update extensions min version to 0.13.3 Liming Gao
  2020-04-09  3:22 ` Michael Kubacki
  3 siblings, 1 reply; 10+ messages in thread
From: Zhang, Shenglei @ 2020-04-07  6:47 UTC (permalink / raw)
  To: devel; +Cc: Bob Feng, Liming Gao

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2659
Allow WindowsVsToolChain Plugin to add libraries and headers
of user defined ARCH for VS2017 and VS2019.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
---
 .../WindowsVsToolChain/WindowsVsToolChain.py  | 73 ++++++++++++++++---
 1 file changed, 62 insertions(+), 11 deletions(-)

diff --git a/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py b/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py
index c9279e1c75b5..0fba2c1b5325 100644
--- a/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py
+++ b/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py
@@ -13,6 +13,7 @@ import edk2toollib.windows.locate_tools as locate_tools
 from edk2toollib.windows.locate_tools import FindWithVsWhere
 from edk2toolext.environment import shell_environment
 from edk2toolext.environment import version_aggregator
+from edk2toollib.utility_functions import GetHostInfo
 
 
 class WindowsVsToolChain(IUefiBuildPlugin):
@@ -26,14 +27,41 @@ class WindowsVsToolChain(IUefiBuildPlugin):
                             "UCRTVersion", "WindowsLibPath", "WindowsSdkBinPath", "WindowsSdkDir", "WindowsSdkVerBinPath",
                             "WindowsSDKVersion", "VCToolsInstallDir", "Path"]
 
-#
+        #
         # VS2017 - Follow VS2017 where there is potential for many versions of the tools.
         # If a specific version is required then the user must set both env variables:
         # VS150INSTALLPATH:  base install path on system to VC install dir.  Here you will find the VC folder, etc
         # VS150TOOLVER:      version number for the VC compiler tools
         # VS2017_PREFIX:     path to MSVC compiler folder with trailing slash (can be used instead of two vars above)
+        # VS2017_HOST:       set the host architecture to use for host tools, and host libs, etc
         if thebuilder.env.GetValue("TOOL_CHAIN_TAG") == "VS2017":
 
+            # check to see if host is configured
+            # HostType for VS2017 should be (defined in tools_def):
+            # x86   == 32bit Intel
+            # x64   == 64bit Intel
+            # arm   == 32bit Arm
+            # arm64 == 64bit Arm
+            #
+            HostType = shell_environment.GetEnvironment().get_shell_var("VS2017_HOST")
+            if HostType is not None:
+                HostType = HostType.lower()
+                self.Logger.info(
+                    f"HOST TYPE defined by environment.  Host Type is {HostType}")
+            else:
+                HostInfo = GetHostInfo()
+                if HostInfo.arch == "x86":
+                    if HostInfo.bit == "32":
+                        HostType = "x86"
+                    elif HostInfo.bit == "64":
+                        HostType = "x64"
+                else:
+                    raise NotImplementedError()
+
+            # VS2017_HOST options are not exactly the same as QueryVcVariables. This translates.
+            VC_HOST_ARCH_TRANSLATOR = {
+                "x86": "x86", "x64": "AMD64", "arm": "not supported", "arm64": "not supported"}
+
             # check to see if full path already configured
             if shell_environment.GetEnvironment().get_shell_var("VS2017_PREFIX") != None:
                 self.Logger.info("VS2017_PREFIX is already set.")
@@ -58,16 +86,14 @@ class WindowsVsToolChain(IUefiBuildPlugin):
                                       "Tools", "MSVC", vc_ver)
                 prefix = prefix + os.path.sep
                 shell_environment.GetEnvironment().set_shell_var("VS2017_PREFIX", prefix)
+                shell_environment.GetEnvironment().set_shell_var("VS2017_HOST", HostType)
 
                 shell_env = shell_environment.GetEnvironment()
                 # Use the tools lib to determine the correct values for the vars that interest us.
                 vs_vars = locate_tools.QueryVcVariables(
-                    interesting_keys, "amd64", vs_version="vs2017")
+                    interesting_keys, VC_HOST_ARCH_TRANSLATOR[HostType], vs_version="vs2017")
                 for (k, v) in vs_vars.items():
-                    if k.upper() == "PATH":
-                        shell_env.insert_path(v)
-                    else:
-                        shell_env.set_shell_var(k, v)
+                    shell_env.set_shell_var(k, v)
 
             # now confirm it exists
             if not os.path.exists(shell_environment.GetEnvironment().get_shell_var("VS2017_PREFIX")):
@@ -80,8 +106,35 @@ class WindowsVsToolChain(IUefiBuildPlugin):
         # VS160INSTALLPATH:  base install path on system to VC install dir.  Here you will find the VC folder, etc
         # VS160TOOLVER:      version number for the VC compiler tools
         # VS2019_PREFIX:     path to MSVC compiler folder with trailing slash (can be used instead of two vars above)
+        # VS2017_HOST:       set the host architecture to use for host tools, and host libs, etc
         elif thebuilder.env.GetValue("TOOL_CHAIN_TAG") == "VS2019":
 
+            # check to see if host is configured
+            # HostType for VS2019 should be (defined in tools_def):
+            # x86   == 32bit Intel
+            # x64   == 64bit Intel
+            # arm   == 32bit Arm
+            # arm64 == 64bit Arm
+            #
+            HostType = shell_environment.GetEnvironment().get_shell_var("VS2019_HOST")
+            if HostType is not None:
+                HostType = HostType.lower()
+                self.Logger.info(
+                    f"HOST TYPE defined by environment.  Host Type is {HostType}")
+            else:
+                HostInfo = GetHostInfo()
+                if HostInfo.arch == "x86":
+                    if HostInfo.bit == "32":
+                        HostType = "x86"
+                    elif HostInfo.bit == "64":
+                        HostType = "x64"
+                else:
+                    raise NotImplementedError()
+
+            # VS2019_HOST options are not exactly the same as QueryVcVariables. This translates.
+            VC_HOST_ARCH_TRANSLATOR = {
+                "x86": "x86", "x64": "AMD64", "arm": "not supported", "arm64": "not supported"}
+
             # check to see if full path already configured
             if shell_environment.GetEnvironment().get_shell_var("VS2019_PREFIX") != None:
                 self.Logger.info("VS2019_PREFIX is already set.")
@@ -106,16 +159,14 @@ class WindowsVsToolChain(IUefiBuildPlugin):
                                       "Tools", "MSVC", vc_ver)
                 prefix = prefix + os.path.sep
                 shell_environment.GetEnvironment().set_shell_var("VS2019_PREFIX", prefix)
+                shell_environment.GetEnvironment().set_shell_var("VS2019_HOST", HostType)
 
                 shell_env = shell_environment.GetEnvironment()
                 # Use the tools lib to determine the correct values for the vars that interest us.
                 vs_vars = locate_tools.QueryVcVariables(
-                    interesting_keys, "amd64", vs_version="vs2019")
+                    interesting_keys, VC_HOST_ARCH_TRANSLATOR[HostType], vs_version="vs2019")
                 for (k, v) in vs_vars.items():
-                    if k.upper() == "PATH":
-                        shell_env.insert_path(v)
-                    else:
-                        shell_env.set_shell_var(k, v)
+                    shell_env.set_shell_var(k, v)
 
             # now confirm it exists
             if not os.path.exists(shell_environment.GetEnvironment().get_shell_var("VS2019_PREFIX")):
-- 
2.18.0.windows.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [edk2-devel] [PATCH] pip-requirements.txt: Update extensions min version to 0.13.3
  2020-04-07  6:47 [PATCH] pip-requirements.txt: Update extensions min version to 0.13.3 Zhang, Shenglei
  2020-04-07  6:47 ` [PATCH] .azurepiplines/pr-gate-steps.yml: Update python to 3.8.x for ci build Zhang, Shenglei
  2020-04-07  6:47 ` [PATCH] BaseTools/WindowsVsToolChain.py: Update toolchain plugin Zhang, Shenglei
@ 2020-04-07  7:52 ` Liming Gao
  2020-04-07 21:24   ` Bret Barkelew
  2020-04-09  3:22 ` Michael Kubacki
  3 siblings, 1 reply; 10+ messages in thread
From: Liming Gao @ 2020-04-07  7:52 UTC (permalink / raw)
  To: devel@edk2.groups.io, Zhang, Shenglei
  Cc: Sean Brogan, Bret Barkelew, Kinney, Michael D

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Zhang, Shenglei
> Sent: Tuesday, April 7, 2020 2:48 PM
> To: devel@edk2.groups.io
> Cc: Sean Brogan <sean.brogan@microsoft.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [edk2-devel] [PATCH] pip-requirements.txt: Update extensions min version to 0.13.3
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2616
> Pytool extensions are locked on 0.12.x but extensions has
> moved to 0.13.x. So update the pip-requirements.txt.
> 
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
> ---
>  pip-requirements.txt | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/pip-requirements.txt b/pip-requirements.txt
> index 6a41a95ec594..574dac43b1a6 100644
> --- a/pip-requirements.txt
> +++ b/pip-requirements.txt
> @@ -9,8 +9,8 @@
>  # https://pypi.org/project/pip/
>  # https://pip.pypa.io/en/stable/user_guide/#requirements-files
>  # https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format
> -#
> +# https://www.python.org/dev/peps/pep-0440/#version-specifiers
>  ##
> 
>  edk2-pytool-library==0.10.*
> -edk2-pytool-extensions==0.12.*
> +edk2-pytool-extensions~=0.13.3
> --
> 2.18.0.windows.1
> 
> 
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [edk2-devel] [PATCH] .azurepiplines/pr-gate-steps.yml: Update python to 3.8.x for ci build
  2020-04-07  6:47 ` [PATCH] .azurepiplines/pr-gate-steps.yml: Update python to 3.8.x for ci build Zhang, Shenglei
@ 2020-04-07  7:52   ` Liming Gao
  2020-04-07 21:23     ` Bret Barkelew
  2020-04-09  5:13   ` Michael Kubacki
  1 sibling, 1 reply; 10+ messages in thread
From: Liming Gao @ 2020-04-07  7:52 UTC (permalink / raw)
  To: devel@edk2.groups.io, Zhang, Shenglei
  Cc: Sean Brogan, Bret Barkelew, Kinney, Michael D

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Zhang, Shenglei
> Sent: Tuesday, April 7, 2020 2:48 PM
> To: devel@edk2.groups.io
> Cc: Sean Brogan <sean.brogan@microsoft.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [edk2-devel] [PATCH] .azurepiplines/pr-gate-steps.yml: Update python to 3.8.x for ci build
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2617
> Update edk2 build and test ci to use Python 3.8.x
> 
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
> ---
>  .azurepipelines/templates/pr-gate-steps.yml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/.azurepipelines/templates/pr-gate-steps.yml b/.azurepipelines/templates/pr-gate-steps.yml
> index a969661dea15..8c4ad4e2efe6 100644
> --- a/.azurepipelines/templates/pr-gate-steps.yml
> +++ b/.azurepipelines/templates/pr-gate-steps.yml
> @@ -20,7 +20,7 @@ steps:
> 
>  - task: UsePythonVersion@0
>    inputs:
> -    versionSpec: '3.7.x'
> +    versionSpec: '3.8.x'
>      architecture: 'x64'
> 
>  - script: pip install -r pip-requirements.txt --upgrade
> --
> 2.18.0.windows.1
> 
> 
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [edk2-devel] [PATCH] .azurepiplines/pr-gate-steps.yml: Update python to 3.8.x for ci build
  2020-04-07  7:52   ` [edk2-devel] " Liming Gao
@ 2020-04-07 21:23     ` Bret Barkelew
  0 siblings, 0 replies; 10+ messages in thread
From: Bret Barkelew @ 2020-04-07 21:23 UTC (permalink / raw)
  To: Gao, Liming, devel@edk2.groups.io, Zhang, Shenglei
  Cc: Sean Brogan, Kinney, Michael D

[-- Attachment #1: Type: text/plain, Size: 2341 bytes --]

Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>

- Bret

________________________________
From: Gao, Liming <liming.gao@intel.com>
Sent: Tuesday, April 7, 2020 12:52:35 AM
To: devel@edk2.groups.io <devel@edk2.groups.io>; Zhang, Shenglei <shenglei.zhang@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Kinney, Michael D <michael.d.kinney@intel.com>
Subject: [EXTERNAL] RE: [edk2-devel] [PATCH] .azurepiplines/pr-gate-steps.yml: Update python to 3.8.x for ci build

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Zhang, Shenglei
> Sent: Tuesday, April 7, 2020 2:48 PM
> To: devel@edk2.groups.io
> Cc: Sean Brogan <sean.brogan@microsoft.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [edk2-devel] [PATCH] .azurepiplines/pr-gate-steps.yml: Update python to 3.8.x for ci build
>
> REF: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2617&amp;data=02%7C01%7CBret.Barkelew%40microsoft.com%7Ca9fae05b3d424da0e3be08d7dac8a93f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637218427681081115&amp;sdata=v%2BI7IIIqK%2BjTnjtTjveikqRtBAYB71macIIDeivsE2M%3D&amp;reserved=0
> Update edk2 build and test ci to use Python 3.8.x
>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
> ---
>  .azurepipelines/templates/pr-gate-steps.yml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/.azurepipelines/templates/pr-gate-steps.yml b/.azurepipelines/templates/pr-gate-steps.yml
> index a969661dea15..8c4ad4e2efe6 100644
> --- a/.azurepipelines/templates/pr-gate-steps.yml
> +++ b/.azurepipelines/templates/pr-gate-steps.yml
> @@ -20,7 +20,7 @@ steps:
>
>  - task: UsePythonVersion@0
>    inputs:
> -    versionSpec: '3.7.x'
> +    versionSpec: '3.8.x'
>      architecture: 'x64'
>
>  - script: pip install -r pip-requirements.txt --upgrade
> --
> 2.18.0.windows.1
>
>
> 


[-- Attachment #2: Type: text/html, Size: 4844 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [edk2-devel] [PATCH] pip-requirements.txt: Update extensions min version to 0.13.3
  2020-04-07  7:52 ` [edk2-devel] [PATCH] pip-requirements.txt: Update extensions min version to 0.13.3 Liming Gao
@ 2020-04-07 21:24   ` Bret Barkelew
  0 siblings, 0 replies; 10+ messages in thread
From: Bret Barkelew @ 2020-04-07 21:24 UTC (permalink / raw)
  To: devel@edk2.groups.io, liming.gao@intel.com, Zhang, Shenglei
  Cc: Sean Brogan, Kinney, Michael D


[-- Attachment #1.1: Type: text/plain, Size: 3661 bytes --]

Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>

- Bret


From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Liming Gao via groups.io <liming.gao=intel.com@groups.io>
Sent: Tuesday, April 7, 2020 12:52:24 AM
To: devel@edk2.groups.io <devel@edk2.groups.io>; Zhang, Shenglei <shenglei.zhang@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Kinney, Michael D <michael.d.kinney@intel.com>
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] pip-requirements.txt: Update extensions min version to 0.13.3

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Zhang, Shenglei
> Sent: Tuesday, April 7, 2020 2:48 PM
> To: devel@edk2.groups.io
> Cc: Sean Brogan <sean.brogan@microsoft.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [edk2-devel] [PATCH] pip-requirements.txt: Update extensions min version to 0.13.3
>
> REF: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2616&amp;data=02%7C01%7Cbret.barkelew%40microsoft.com%7C6021f77b97e34c96669708d7dac89f6a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637218427518277862&amp;sdata=KBYxcmatNgKG4m9qVdJJYwywGEhRQCJ38tSlzR2gAbc%3D&amp;reserved=0
> Pytool extensions are locked on 0.12.x but extensions has
> moved to 0.13.x. So update the pip-requirements.txt.
>
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
> ---
>  pip-requirements.txt | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/pip-requirements.txt b/pip-requirements.txt
> index 6a41a95ec594..574dac43b1a6 100644
> --- a/pip-requirements.txt
> +++ b/pip-requirements.txt
> @@ -9,8 +9,8 @@
>  # https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpypi.org%2Fproject%2Fpip%2F&amp;data=02%7C01%7Cbret.barkelew%40microsoft.com%7C6021f77b97e34c96669708d7dac89f6a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637218427518287862&amp;sdata=Qrpu2VOJEePvUnpZq6kC869cTAPtbBEzczgdaoF%2BqvU%3D&amp;reserved=0
>  # https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpip.pypa.io%2Fen%2Fstable%2Fuser_guide%2F%23requirements-files&amp;data=02%7C01%7Cbret.barkelew%40microsoft.com%7C6021f77b97e34c96669708d7dac89f6a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637218427518287862&amp;sdata=EJKS3MVTDeiwgMduhrRQUWBBnQB%2BashSmMbz3qQT7fQ%3D&amp;reserved=0
>  # https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpip.pypa.io%2Fen%2Fstable%2Freference%2Fpip_install%2F%23requirements-file-format&amp;data=02%7C01%7Cbret.barkelew%40microsoft.com%7C6021f77b97e34c96669708d7dac89f6a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637218427518287862&amp;sdata=gA%2BY7KTBm4PG3zkg1oj5UZbXOpq3%2BbFs%2BLX%2F9M8SQz4%3D&amp;reserved=0
> -#
> +# https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.python.org%2Fdev%2Fpeps%2Fpep-0440%2F%23version-specifiers&amp;data=02%7C01%7Cbret.barkelew%40microsoft.com%7C6021f77b97e34c96669708d7dac89f6a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637218427518287862&amp;sdata=%2FgC4Wt8KqUrMVN%2BPZiYvlTKeNbPPSs2d%2BaqFVFtRQMY%3D&amp;reserved=0
>  ##
>
>  edk2-pytool-library==0.10.*
> -edk2-pytool-extensions==0.12.*
> +edk2-pytool-extensions~=0.13.3
> --
> 2.18.0.windows.1
>
>
>





[-- Attachment #1.2: Type: text/html, Size: 8216 bytes --]

[-- Attachment #2: 243E72E21CD24441BC96F9002E545D1F.png --]
[-- Type: image/png, Size: 159 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [EXTERNAL] [edk2-devel] [PATCH] BaseTools/WindowsVsToolChain.py: Update toolchain plugin
  2020-04-07  6:47 ` [PATCH] BaseTools/WindowsVsToolChain.py: Update toolchain plugin Zhang, Shenglei
@ 2020-04-07 21:31   ` Bret Barkelew
  0 siblings, 0 replies; 10+ messages in thread
From: Bret Barkelew @ 2020-04-07 21:31 UTC (permalink / raw)
  To: devel@edk2.groups.io, shenglei.zhang@intel.com; +Cc: Bob Feng, Liming Gao

[-- Attachment #1: Type: text/plain, Size: 8573 bytes --]

Reviewed-by: Bret Barkelew <bret.barkelew@microsoft.com>

- Bret

________________________________
From: devel@edk2.groups.io <devel@edk2.groups.io> on behalf of Zhang, Shenglei via groups.io <shenglei.zhang=intel.com@groups.io>
Sent: Monday, April 6, 2020 11:47:37 PM
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Bob Feng <bob.c.feng@intel.com>; Liming Gao <liming.gao@intel.com>
Subject: [EXTERNAL] [edk2-devel] [PATCH] BaseTools/WindowsVsToolChain.py: Update toolchain plugin

REF: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2659&amp;data=02%7C01%7CBret.Barkelew%40microsoft.com%7Cb69f6a990b644ab252d708d7dabf94d6%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637218388681928753&amp;sdata=nCRoJjRWBWaeRBkCUsWV7TFwdKGR7770Cq4qFiBkA5U%3D&amp;reserved=0
Allow WindowsVsToolChain Plugin to add libraries and headers
of user defined ARCH for VS2017 and VS2019.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
---
 .../WindowsVsToolChain/WindowsVsToolChain.py  | 73 ++++++++++++++++---
 1 file changed, 62 insertions(+), 11 deletions(-)

diff --git a/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py b/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py
index c9279e1c75b5..0fba2c1b5325 100644
--- a/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py
+++ b/BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py
@@ -13,6 +13,7 @@ import edk2toollib.windows.locate_tools as locate_tools
 from edk2toollib.windows.locate_tools import FindWithVsWhere
 from edk2toolext.environment import shell_environment
 from edk2toolext.environment import version_aggregator
+from edk2toollib.utility_functions import GetHostInfo


 class WindowsVsToolChain(IUefiBuildPlugin):
@@ -26,14 +27,41 @@ class WindowsVsToolChain(IUefiBuildPlugin):
                             "UCRTVersion", "WindowsLibPath", "WindowsSdkBinPath", "WindowsSdkDir", "WindowsSdkVerBinPath",
                             "WindowsSDKVersion", "VCToolsInstallDir", "Path"]

-#
+        #
         # VS2017 - Follow VS2017 where there is potential for many versions of the tools.
         # If a specific version is required then the user must set both env variables:
         # VS150INSTALLPATH:  base install path on system to VC install dir.  Here you will find the VC folder, etc
         # VS150TOOLVER:      version number for the VC compiler tools
         # VS2017_PREFIX:     path to MSVC compiler folder with trailing slash (can be used instead of two vars above)
+        # VS2017_HOST:       set the host architecture to use for host tools, and host libs, etc
         if thebuilder.env.GetValue("TOOL_CHAIN_TAG") == "VS2017":

+            # check to see if host is configured
+            # HostType for VS2017 should be (defined in tools_def):
+            # x86   == 32bit Intel
+            # x64   == 64bit Intel
+            # arm   == 32bit Arm
+            # arm64 == 64bit Arm
+            #
+            HostType = shell_environment.GetEnvironment().get_shell_var("VS2017_HOST")
+            if HostType is not None:
+                HostType = HostType.lower()
+                self.Logger.info(
+                    f"HOST TYPE defined by environment.  Host Type is {HostType}")
+            else:
+                HostInfo = GetHostInfo()
+                if HostInfo.arch == "x86":
+                    if HostInfo.bit == "32":
+                        HostType = "x86"
+                    elif HostInfo.bit == "64":
+                        HostType = "x64"
+                else:
+                    raise NotImplementedError()
+
+            # VS2017_HOST options are not exactly the same as QueryVcVariables. This translates.
+            VC_HOST_ARCH_TRANSLATOR = {
+                "x86": "x86", "x64": "AMD64", "arm": "not supported", "arm64": "not supported"}
+
             # check to see if full path already configured
             if shell_environment.GetEnvironment().get_shell_var("VS2017_PREFIX") != None:
                 self.Logger.info("VS2017_PREFIX is already set.")
@@ -58,16 +86,14 @@ class WindowsVsToolChain(IUefiBuildPlugin):
                                       "Tools", "MSVC", vc_ver)
                 prefix = prefix + os.path.sep
                 shell_environment.GetEnvironment().set_shell_var("VS2017_PREFIX", prefix)
+                shell_environment.GetEnvironment().set_shell_var("VS2017_HOST", HostType)

                 shell_env = shell_environment.GetEnvironment()
                 # Use the tools lib to determine the correct values for the vars that interest us.
                 vs_vars = locate_tools.QueryVcVariables(
-                    interesting_keys, "amd64", vs_version="vs2017")
+                    interesting_keys, VC_HOST_ARCH_TRANSLATOR[HostType], vs_version="vs2017")
                 for (k, v) in vs_vars.items():
-                    if k.upper() == "PATH":
-                        shell_env.insert_path(v)
-                    else:
-                        shell_env.set_shell_var(k, v)
+                    shell_env.set_shell_var(k, v)

             # now confirm it exists
             if not os.path.exists(shell_environment.GetEnvironment().get_shell_var("VS2017_PREFIX")):
@@ -80,8 +106,35 @@ class WindowsVsToolChain(IUefiBuildPlugin):
         # VS160INSTALLPATH:  base install path on system to VC install dir.  Here you will find the VC folder, etc
         # VS160TOOLVER:      version number for the VC compiler tools
         # VS2019_PREFIX:     path to MSVC compiler folder with trailing slash (can be used instead of two vars above)
+        # VS2017_HOST:       set the host architecture to use for host tools, and host libs, etc
         elif thebuilder.env.GetValue("TOOL_CHAIN_TAG") == "VS2019":

+            # check to see if host is configured
+            # HostType for VS2019 should be (defined in tools_def):
+            # x86   == 32bit Intel
+            # x64   == 64bit Intel
+            # arm   == 32bit Arm
+            # arm64 == 64bit Arm
+            #
+            HostType = shell_environment.GetEnvironment().get_shell_var("VS2019_HOST")
+            if HostType is not None:
+                HostType = HostType.lower()
+                self.Logger.info(
+                    f"HOST TYPE defined by environment.  Host Type is {HostType}")
+            else:
+                HostInfo = GetHostInfo()
+                if HostInfo.arch == "x86":
+                    if HostInfo.bit == "32":
+                        HostType = "x86"
+                    elif HostInfo.bit == "64":
+                        HostType = "x64"
+                else:
+                    raise NotImplementedError()
+
+            # VS2019_HOST options are not exactly the same as QueryVcVariables. This translates.
+            VC_HOST_ARCH_TRANSLATOR = {
+                "x86": "x86", "x64": "AMD64", "arm": "not supported", "arm64": "not supported"}
+
             # check to see if full path already configured
             if shell_environment.GetEnvironment().get_shell_var("VS2019_PREFIX") != None:
                 self.Logger.info("VS2019_PREFIX is already set.")
@@ -106,16 +159,14 @@ class WindowsVsToolChain(IUefiBuildPlugin):
                                       "Tools", "MSVC", vc_ver)
                 prefix = prefix + os.path.sep
                 shell_environment.GetEnvironment().set_shell_var("VS2019_PREFIX", prefix)
+                shell_environment.GetEnvironment().set_shell_var("VS2019_HOST", HostType)

                 shell_env = shell_environment.GetEnvironment()
                 # Use the tools lib to determine the correct values for the vars that interest us.
                 vs_vars = locate_tools.QueryVcVariables(
-                    interesting_keys, "amd64", vs_version="vs2019")
+                    interesting_keys, VC_HOST_ARCH_TRANSLATOR[HostType], vs_version="vs2019")
                 for (k, v) in vs_vars.items():
-                    if k.upper() == "PATH":
-                        shell_env.insert_path(v)
-                    else:
-                        shell_env.set_shell_var(k, v)
+                    shell_env.set_shell_var(k, v)

             # now confirm it exists
             if not os.path.exists(shell_environment.GetEnvironment().get_shell_var("VS2019_PREFIX")):
--
2.18.0.windows.1





[-- Attachment #2: Type: text/html, Size: 20298 bytes --]

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [edk2-devel] [PATCH] pip-requirements.txt: Update extensions min version to 0.13.3
  2020-04-07  6:47 [PATCH] pip-requirements.txt: Update extensions min version to 0.13.3 Zhang, Shenglei
                   ` (2 preceding siblings ...)
  2020-04-07  7:52 ` [edk2-devel] [PATCH] pip-requirements.txt: Update extensions min version to 0.13.3 Liming Gao
@ 2020-04-09  3:22 ` Michael Kubacki
  3 siblings, 0 replies; 10+ messages in thread
From: Michael Kubacki @ 2020-04-09  3:22 UTC (permalink / raw)
  To: devel, shenglei.zhang
  Cc: Sean Brogan, Bret Barkelew, Michael D Kinney, Liming Gao

Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>

On 4/6/2020 11:47 PM, Zhang, Shenglei wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2616
> Pytool extensions are locked on 0.12.x but extensions has
> moved to 0.13.x. So update the pip-requirements.txt.
> 
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
> ---
>   pip-requirements.txt | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/pip-requirements.txt b/pip-requirements.txt
> index 6a41a95ec594..574dac43b1a6 100644
> --- a/pip-requirements.txt
> +++ b/pip-requirements.txt
> @@ -9,8 +9,8 @@
>   # https://pypi.org/project/pip/
>   # https://pip.pypa.io/en/stable/user_guide/#requirements-files
>   # https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format
> -#
> +# https://www.python.org/dev/peps/pep-0440/#version-specifiers
>   ##
>   
>   edk2-pytool-library==0.10.*
> -edk2-pytool-extensions==0.12.*
> +edk2-pytool-extensions~=0.13.3
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [edk2-devel] [PATCH] .azurepiplines/pr-gate-steps.yml: Update python to 3.8.x for ci build
  2020-04-07  6:47 ` [PATCH] .azurepiplines/pr-gate-steps.yml: Update python to 3.8.x for ci build Zhang, Shenglei
  2020-04-07  7:52   ` [edk2-devel] " Liming Gao
@ 2020-04-09  5:13   ` Michael Kubacki
  1 sibling, 0 replies; 10+ messages in thread
From: Michael Kubacki @ 2020-04-09  5:13 UTC (permalink / raw)
  To: devel, shenglei.zhang
  Cc: Sean Brogan, Bret Barkelew, Michael D Kinney, Liming Gao

Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>

On 4/6/2020 11:47 PM, Zhang, Shenglei wrote:
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2617
> Update edk2 build and test ci to use Python 3.8.x
> 
> Cc: Sean Brogan <sean.brogan@microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
> ---
>   .azurepipelines/templates/pr-gate-steps.yml | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/.azurepipelines/templates/pr-gate-steps.yml b/.azurepipelines/templates/pr-gate-steps.yml
> index a969661dea15..8c4ad4e2efe6 100644
> --- a/.azurepipelines/templates/pr-gate-steps.yml
> +++ b/.azurepipelines/templates/pr-gate-steps.yml
> @@ -20,7 +20,7 @@ steps:
>   
>   - task: UsePythonVersion@0
>     inputs:
> -    versionSpec: '3.7.x'
> +    versionSpec: '3.8.x'
>       architecture: 'x64'
>   
>   - script: pip install -r pip-requirements.txt --upgrade
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-04-09  5:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-07  6:47 [PATCH] pip-requirements.txt: Update extensions min version to 0.13.3 Zhang, Shenglei
2020-04-07  6:47 ` [PATCH] .azurepiplines/pr-gate-steps.yml: Update python to 3.8.x for ci build Zhang, Shenglei
2020-04-07  7:52   ` [edk2-devel] " Liming Gao
2020-04-07 21:23     ` Bret Barkelew
2020-04-09  5:13   ` Michael Kubacki
2020-04-07  6:47 ` [PATCH] BaseTools/WindowsVsToolChain.py: Update toolchain plugin Zhang, Shenglei
2020-04-07 21:31   ` [EXTERNAL] [edk2-devel] " Bret Barkelew
2020-04-07  7:52 ` [edk2-devel] [PATCH] pip-requirements.txt: Update extensions min version to 0.13.3 Liming Gao
2020-04-07 21:24   ` Bret Barkelew
2020-04-09  3:22 ` Michael Kubacki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox