Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions BaseTools/Plugin/WindowsVsToolChain/WindowsVsToolChain.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def do_pre_build(self, thebuilder):
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, VC_HOST_ARCH_TRANSLATOR[HostType], vs_version="vs2017")
interesting_keys, VC_HOST_ARCH_TRANSLATOR[HostType], vs_version="vs2017", vc_version=vc_ver)
for (k, v) in vs_vars.items():
shell_env.set_shell_var(k, v)

Expand Down Expand Up @@ -167,7 +167,7 @@ def do_pre_build(self, thebuilder):
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, VC_HOST_ARCH_TRANSLATOR[HostType], vs_version="vs2019")
interesting_keys, VC_HOST_ARCH_TRANSLATOR[HostType], vs_version="vs2019", vc_version=vc_ver)
for (k, v) in vs_vars.items():
shell_env.set_shell_var(k, v)

Expand Down Expand Up @@ -247,7 +247,7 @@ def do_pre_build(self, thebuilder):
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, VC_HOST_ARCH_TRANSLATOR[HostType], vs_version="VS2022")
interesting_keys, VC_HOST_ARCH_TRANSLATOR[HostType], vs_version="VS2022", vc_version=vc_ver)
for (k, v) in vs_vars.items():
shell_env.set_shell_var(k, v)

Expand Down Expand Up @@ -373,6 +373,10 @@ def _get_vc_version(self, path, varname):
self.Logger.critical(
"Failed to find VC tools. Might need to check for VS install")
return vc_ver
vc_ver = os.listdir(p2)[-1].strip() # get last in list

dirs = os.listdir(p2)
if len(dirs) > 1:
logging.warning(f"Multiple VC versions found: [{', '.join(dirs)}]. Using {dirs[-1]}")
vc_ver = dirs[-1].strip() # get last in list
self.Logger.debug("Found VC Tool version is %s" % vc_ver)
return vc_ver
2 changes: 1 addition & 1 deletion pip-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# https://www.python.org/dev/peps/pep-0440/#version-specifiers
##

edk2-pytool-library~=0.22.5 # MU_CHANGE
edk2-pytool-library~=0.23.1 # MU_CHANGE
edk2-pytool-extensions~=0.28.3 # MU_CHANGE
antlr4-python3-runtime==4.13.2
lcov-cobertura==2.1.1
Expand Down
Loading