Skip to content

Commit d3300bf

Browse files
ahornbyfacebook-github-bot
authored andcommitted
getdeps: update github windows runner and internal CI to VS 2022
Summary: X-link: facebookincubator/fizz#163 The github [windows-2019 actions image was retired by github](actions/runner-images#12045), so all jobs on it fail Update to windows-2022 to get them running again windows-2022 has [different tools and versions than windows-2019](actions/runner-images#3949). Notably it moves from Visual Studio 2019 (aka msvc 16.x) to Visual Studio 2022 (aka msvc 17.x), hence the update to buildopts.py discovery In the course of regenerating the github actions I also fixed a couple of issues that stopped regeneration matching repo contents * a few workflows were using workflow_dispatch, added support * there were a trailing and double spaces for project_prefix, fixed (use ignore whitespace to remove this from review!) Reviewed By: bigfootjon, yfeldblum Differential Revision: D78019509 fbshipit-source-id: f8b0e9438bfc6b481b4207ad82bc1002e496a2d9
1 parent 388adad commit d3300bf

4 files changed

Lines changed: 47 additions & 21 deletions

File tree

build/fbcode_builder/getdeps.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,8 @@ def get_run_on(self, args):
10151015
if args.cron:
10161016
if args.cron == "never":
10171017
return " {}"
1018+
elif args.cron == "workflow_dispatch":
1019+
return "\n workflow_dispatch"
10181020
else:
10191021
return f"""
10201022
schedule:
@@ -1082,7 +1084,7 @@ def write_job_for_platform(self, platform, args): # noqa: C901
10821084
if args.runs_on:
10831085
runs_on = args.runs_on
10841086
else:
1085-
runs_on = "windows-2019"
1087+
runs_on = "windows-2022"
10861088
# The windows runners are python 3 by default; python2.exe
10871089
# is available if needed.
10881090
py3 = "python"
@@ -1324,7 +1326,7 @@ def write_job_for_platform(self, platform, args): # noqa: C901
13241326
no_deps_arg = "--no-deps "
13251327

13261328
out.write(
1327-
f" run: {getdepscmd}{allow_sys_arg} build {build_type_arg}{tests_arg}{no_deps_arg}--src-dir=. {manifest.name} {project_prefix}\n"
1329+
f" run: {getdepscmd}{allow_sys_arg} build {build_type_arg}{tests_arg}{no_deps_arg}--src-dir=. {manifest.name}{project_prefix}\n"
13281330
)
13291331

13301332
out.write(" - name: Copy artifacts\n")
@@ -1339,7 +1341,7 @@ def write_job_for_platform(self, platform, args): # noqa: C901
13391341

13401342
out.write(
13411343
f" run: {getdepscmd}{allow_sys_arg} fixup-dyn-deps{strip} "
1342-
f"--src-dir=. {manifest.name} _artifacts/{artifacts} {project_prefix} "
1344+
f"--src-dir=. {manifest.name} _artifacts/{artifacts}{project_prefix} "
13431345
f"--final-install-prefix /usr/local\n"
13441346
)
13451347

@@ -1355,7 +1357,7 @@ def write_job_for_platform(self, platform, args): # noqa: C901
13551357

13561358
out.write(" - name: Test %s\n" % manifest.name)
13571359
out.write(
1358-
f" run: {getdepscmd}{allow_sys_arg} test {num_jobs_arg}--src-dir=. {manifest.name} {project_prefix}\n"
1360+
f" run: {getdepscmd}{allow_sys_arg} test {num_jobs_arg}--src-dir=. {manifest.name}{project_prefix}\n"
13591361
)
13601362
if build_opts.free_up_disk and not build_opts.is_windows():
13611363
out.write(" - name: Show disk space at end\n")

build/fbcode_builder/getdeps/buildopts.py

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -147,25 +147,43 @@ def __init__(
147147
# On Windows, the compiler is not available in the PATH by
148148
# default so we need to run the vcvarsall script to populate the
149149
# environment. We use a glob to find some version of this script
150-
# as deployed with Visual Studio 2017. This logic can also
151-
# locate Visual Studio 2019 but note that at the time of writing
152-
# the version of boost in our manifest cannot be built with
153-
# VS 2019, so we're effectively tied to VS 2017 until we upgrade
154-
# the boost dependency.
155-
for year in ["2017", "2019"]:
156-
vcvarsall += glob.glob(
157-
os.path.join(
158-
os.environ["ProgramFiles(x86)"],
159-
"Microsoft Visual Studio",
160-
year,
161-
"*",
162-
"VC",
163-
"Auxiliary",
164-
"Build",
165-
"vcvarsall.bat",
150+
# as deployed with Visual Studio.
151+
if len(vcvarsall) == 0:
152+
# check the 64 bit installs
153+
for year in ["2022"]:
154+
vcvarsall += glob.glob(
155+
os.path.join(
156+
os.environ.get("ProgramFiles", "C:\\Program Files"),
157+
"Microsoft Visual Studio",
158+
year,
159+
"*",
160+
"VC",
161+
"Auxiliary",
162+
"Build",
163+
"vcvarsall.bat",
164+
)
166165
)
166+
167+
# then the 32 bit ones
168+
for year in ["2019", "2017"]:
169+
vcvarsall += glob.glob(
170+
os.path.join(
171+
os.environ["ProgramFiles(x86)"],
172+
"Microsoft Visual Studio",
173+
year,
174+
"*",
175+
"VC",
176+
"Auxiliary",
177+
"Build",
178+
"vcvarsall.bat",
179+
)
180+
)
181+
if len(vcvarsall) == 0:
182+
raise Exception(
183+
"Could not find vcvarsall.bat. Please install Visual Studio."
167184
)
168185
vcvars_path = vcvarsall[0]
186+
print(f"Using vcvarsall.bat from {vcvars_path}", file=sys.stderr)
169187

170188
self.vcvars_path = vcvars_path
171189

build/fbcode_builder/getdeps/dyndeps.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,12 @@ def find_dumpbin(self) -> str:
176176
# Looking for dumpbin in the following hardcoded paths.
177177
# The registry option to find the install dir doesn't work anymore.
178178
globs = [
179+
(
180+
"C:/Program Files/"
181+
"Microsoft Visual Studio/"
182+
"*/*/VC/Tools/"
183+
"MSVC/*/bin/Hostx64/x64/dumpbin.exe"
184+
),
179185
(
180186
"C:/Program Files (x86)/"
181187
"Microsoft Visual Studio/"

build/fbcode_builder/manifests/boost

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,4 @@ toolset=clang
113113
cxxflags="-DBOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT=0"
114114

115115
[b2.args.all(os=windows,fb=on)]
116-
toolset=msvc-14.2
116+
toolset=msvc-14.3

0 commit comments

Comments
 (0)