]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Update WindowsVsToolChain plugin
authorJoey Vagedes <joeyvagedes@microsoft.com>
Thu, 16 Feb 2023 05:54:16 +0000 (05:54 +0000)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 16 Feb 2023 18:54:33 +0000 (18:54 +0000)
This patch updates edk2-pytool-library dependency to v0.14.0, which has
an interface change to FindWithVsWhere. The BaseTools plugin uses this
function, so it is being updated to account for the interface change.

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Joey Vagedes <joeyvagedes@microsoft.com>
Acked-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py
pip-requirements.txt

index 0fba2c1b53253e099689eb21fc9881ea80c8c1ae..615b5ed6d131695f045ff778576a29ed1fa278f7 100644 (file)
@@ -177,15 +177,23 @@ class WindowsVsToolChain(IUefiBuildPlugin):
 \r
     def _get_vs_install_path(self, vs_version, varname):\r
         # check if already specified\r
-        path = shell_environment.GetEnvironment().get_shell_var(varname)\r
+        path = None\r
+        if varname is not None:\r
+            path = shell_environment.GetEnvironment().get_shell_var(varname)\r
+\r
         if(path is None):\r
             # Not specified...find latest\r
-            (rc, path) = FindWithVsWhere(vs_version=vs_version)\r
-            if rc == 0 and path is not None and os.path.exists(path):\r
+            try:\r
+                path = FindWithVsWhere(vs_version=vs_version)\r
+            except (EnvironmentError, ValueError, RuntimeError) as e:\r
+                self.Logger.error(str(e))\r
+                return None\r
+\r
+            if path is not None and os.path.exists(path):\r
                 self.Logger.debug("Found VS instance for %s", vs_version)\r
             else:\r
                 self.Logger.error(\r
-                    "Failed to find VS instance with VsWhere (%d)" % rc)\r
+                    f"VsWhere successfully executed, but could not find VS instance for {vs_version}.")\r
         return path\r
 \r
     def _get_vc_version(self, path, varname):\r
index 4ffcadddd8cf42c3b03d04e1a712c93005d4fa9e..3c3bf921dd832e94893d7ce24280054984546e72 100644 (file)
@@ -12,8 +12,8 @@
 # https://www.python.org/dev/peps/pep-0440/#version-specifiers\r
 ##\r
 \r
-edk2-pytool-library==0.12.1\r
-edk2-pytool-extensions~=0.20.0\r
+edk2-pytool-library==0.14.0\r
+edk2-pytool-extensions~=0.21.8\r
 edk2-basetools==0.1.39\r
 antlr4-python3-runtime==4.7.1\r
 lcov-cobertura==2.0.2\r