From faa13e42ad8786889f00a8100370da50b925b32c Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 16 Sep 2019 12:55:43 -0700 Subject: [PATCH] getdeps: teach builder how to find vs 2019 Summary: GitHub Actions CI `windows-latest` environment has only VS 2019 installed, so we need to expand our logic to be able to locate it. Note that Boost 1.69 doesn't know how to locate VS 2019 so we are effectively tied to VS 2017 at the moment; the search order in this diff reflects that. (That means that we can't target `windows-latest` on GitHub Actions, but that is really a concern for a later diff in this stack) Reviewed By: simpkins Differential Revision: D17385052 fbshipit-source-id: 9bb0612154f42d425a625406488f39bb4ec3d8ae --- build/fbcode_builder/getdeps/buildopts.py | 31 +++++++++++++---------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/build/fbcode_builder/getdeps/buildopts.py b/build/fbcode_builder/getdeps/buildopts.py index 11d8a6820..4ddf0cb3b 100644 --- a/build/fbcode_builder/getdeps/buildopts.py +++ b/build/fbcode_builder/getdeps/buildopts.py @@ -97,20 +97,25 @@ class BuildOptions(object): # On Windows, the compiler is not available in the PATH by # default so we need to run the vcvarsall script to populate the # environment. We use a glob to find some version of this script - # as deployed with Visual Studio 2017. This logic will need - # updating when we switch to a newer compiler. - vcvarsall = glob.glob( - os.path.join( - os.environ["ProgramFiles(x86)"], - "Microsoft Visual Studio", - "2017", - "*", - "VC", - "Auxiliary", - "Build", - "vcvarsall.bat", + # as deployed with Visual Studio 2017. This logic can also + # locate Visual Studio 2019 but note that at the time of writing + # the version of boost in our manifest cannot be built with + # VS 2019, so we're effectively tied to VS 2017 until we upgrade + # the boost dependency. + vcvarsall = [] + for year in ["2017", "2019"]: + vcvarsall += glob.glob( + os.path.join( + os.environ["ProgramFiles(x86)"], + "Microsoft Visual Studio", + year, + "*", + "VC", + "Auxiliary", + "Build", + "vcvarsall.bat", + ) ) - ) vcvars_path = vcvarsall[0] self.vcvars_path = vcvars_path