1
0
mirror of https://github.com/facebook/proxygen.git synced 2025-08-05 19:55:47 +03:00

getdeps: add --build-type option to build in Debug or RelWithDebInfo mode

Summary:
X-link: https://github.com/facebookincubator/zstrong/pull/653

getdeps: add --build-type option to build in Debug or RelWithDebInfo mode

Adds a --build-type option so one can force RelWithDebInfo or Debug explicity

Default remains RelWithDebInfo for cmake.

cargo default is updated to --release to match cmake more closely, if you don't want release use --build-type Debug.

If you want to run github CI in Debug mode (faster build, but tests will run slower), then can pass --build-type Debug to getdeps.py generate-github-actions

X-link: https://github.com/facebook/sapling/pull/786

Reviewed By: mitrandir77

Differential Revision: D51564770

Pulled By: bigfootjon

fbshipit-source-id: ef30332ca193d9805bce005d12b5dbc9f58fcafc
This commit is contained in:
Alex Hornby
2023-12-19 12:24:39 -08:00
committed by Facebook GitHub Bot
parent 7cdc5c8108
commit f15e30b787
4 changed files with 47 additions and 11 deletions

View File

@@ -814,6 +814,13 @@ class BuildCmd(ProjectCmdBase):
action="store_true",
default=False,
)
parser.add_argument(
"--build-type",
help="Set the build type explicitly. Cmake and cargo builders act on them. Only Debug and RelWithDebInfo widely supported.",
choices=["Debug", "Release", "RelWithDebInfo", "MinSizeRel"],
action="store",
default=None,
)
@cmd("fixup-dyn-deps", "Adjusts dynamic dependencies for packaging purposes")
@@ -1038,6 +1045,10 @@ jobs:
out.write(" - uses: actions/checkout@v4\n")
build_type_arg = ""
if args.build_type:
build_type_arg = f"--build-type {args.build_type} "
if build_opts.free_up_disk:
free_up_disk = "--free-up-disk "
if not build_opts.is_windows():
@@ -1118,7 +1129,7 @@ jobs:
has_same_repo_dep = True
out.write(" - name: Build %s\n" % m.name)
out.write(
f" run: {getdepscmd}{allow_sys_arg} build {src_dir_arg}{free_up_disk}--no-tests {m.name}\n"
f" run: {getdepscmd}{allow_sys_arg} build {build_type_arg}{src_dir_arg}{free_up_disk}--no-tests {m.name}\n"
)
out.write(" - name: Build %s\n" % manifest.name)
@@ -1139,7 +1150,7 @@ jobs:
no_tests_arg = "--no-tests "
out.write(
f" run: {getdepscmd}{allow_sys_arg} build {no_tests_arg}{no_deps_arg}--src-dir=. {manifest.name} {project_prefix}\n"
f" run: {getdepscmd}{allow_sys_arg} build {build_type_arg}{no_tests_arg}{no_deps_arg}--src-dir=. {manifest.name} {project_prefix}\n"
)
out.write(" - name: Copy artifacts\n")
@@ -1225,6 +1236,13 @@ jobs:
action="store_true",
default=False,
)
parser.add_argument(
"--build-type",
help="Set the build type explicitly. Cmake and cargo builders act on them. Only Debug and RelWithDebInfo widely supported.",
choices=["Debug", "Release", "RelWithDebInfo", "MinSizeRel"],
action="store",
default=None,
)
def get_arg_var_name(args):