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

allow getdeps github actions to free up disk

Summary:
X-link: https://github.com/facebookincubator/velox/pull/6927

allow getdeps github actions to free up disk

Allow getdeps to free up some disk from the runner and intermediate build steps as some runs (notably the linux eden and mononoke ones) are hitting disk space limits

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

Reviewed By: sggutier

Differential Revision: D49875256

Pulled By: genevievehelsel

fbshipit-source-id: b85b6b2f11857670915b64f47d3c0abd4ca8ca31
This commit is contained in:
Alex Hornby
2023-10-06 21:20:06 -07:00
committed by Facebook GitHub Bot
parent bb7ff7f245
commit 0ad429a261
3 changed files with 43 additions and 1 deletions

View File

@@ -136,6 +136,16 @@ class BuilderBase(object):
self._prepare(install_dirs=install_dirs, reconfigure=reconfigure)
self._build(install_dirs=install_dirs, reconfigure=reconfigure)
if self.build_opts.free_up_disk:
# don't clean --src-dir=. case as user may want to build again or run tests on the build
if self.src_dir.startswith(self.build_opts.scratch_dir) and os.path.isdir(
self.build_dir
):
if os.path.islink(self.build_dir):
os.remove(self.build_dir)
else:
shutil.rmtree(self.build_dir)
# On Windows, emit a wrapper script that can be used to run build artifacts
# directly from the build directory, without installing them. On Windows $PATH
# needs to be updated to include all of the directories containing the runtime