1
0
mirror of https://github.com/facebook/proxygen.git synced 2025-08-07 07:02:53 +03:00

getdeps: GH actions: strip artifacts before capturing them (#809)

Summary:
On Linux the debug info sections in projects downstream from folly and
thrift are huge due to a lot of C++ template usage.

We build in RelWithDebInfo mode as that is most useful when debugging
locally and because the build times are long, but most casual consumers
of the binaries via GH actions really don't care about debug info,
and this should save ~180MB of size in (for example) the watchman
executables.

Pull Request resolved: https://github.com/facebook/watchman/pull/809
Refs: https://github.com/facebook/watchman/issues/804

Test Plan:
Review the artifact size on the linux build in this PR (see
https://github.com/facebook/watchman/actions/runs/91688952) and confirm that it
is a bit smaller than 180MB; now under 3 MB.

Reviewed By: simpkins

Differential Revision: D21318302

Pulled By: wez

fbshipit-source-id: f78bc5e735dd78771e0604abae64c0a23cf9158d
This commit is contained in:
Wez Furlong
2020-04-29 19:07:20 -07:00
committed by Facebook GitHub Bot
parent f4af31ea85
commit 98b76fab50
3 changed files with 41 additions and 12 deletions

View File

@@ -572,7 +572,9 @@ class FixupDeps(ProjectCmdBase):
install_dirs.append(inst_dir)
if m == manifest:
dep_munger = create_dyn_dep_munger(loader.build_opts, install_dirs)
dep_munger = create_dyn_dep_munger(
loader.build_opts, install_dirs, args.strip
)
dep_munger.process_deps(args.destdir, args.final_install_prefix)
def setup_project_cmd_parser(self, parser):
@@ -580,6 +582,12 @@ class FixupDeps(ProjectCmdBase):
parser.add_argument(
"--final-install-prefix", help=("specify the final installation prefix")
)
parser.add_argument(
"--strip",
action="store_true",
default=False,
help="Strip debug info while processing executables",
)
@cmd("test", "test a given project")
@@ -757,8 +765,17 @@ jobs:
)
out.write(" - name: Copy artifacts\n")
if build_opts.is_linux():
# Strip debug info from the binaries, but only on linux.
# While the `strip` utility is also available on macOS,
# attempting to strip there results in an error.
# The `strip` utility is not available on Windows.
strip = " --strip"
else:
strip = ""
out.write(
f" run: {getdeps} fixup-dyn-deps "
f" run: {getdeps} fixup-dyn-deps{strip} "
f"--src-dir=. {manifest.name} _artifacts/{job_name} {project_prefix} "
f"--final-install-prefix /usr/local\n"
)