From dd3bccd3a2f280e12ef7e28bd8a4d90ad025d20a Mon Sep 17 00:00:00 2001 From: Cooper Lees Date: Mon, 27 Jul 2020 18:38:32 -0700 Subject: [PATCH] Add new --disallow-system-packages flag to `generate-github-actions` Summary: - Make OpenR build all deps from source until we remove fbzmq as a dep - Allow a project to move it's Open Source CI forward to an alternative version of ubuntu via a new `--ubuntu-version` parameter Reviewed By: wez Differential Revision: D22768987 fbshipit-source-id: 07205efbd0c87a702638cf30b84a2850d064fa8e --- build/fbcode_builder/getdeps.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/build/fbcode_builder/getdeps.py b/build/fbcode_builder/getdeps.py index eef559bb8..f07c67660 100755 --- a/build/fbcode_builder/getdeps.py +++ b/build/fbcode_builder/getdeps.py @@ -758,7 +758,7 @@ class GenerateGitHubActionsCmd(ProjectCmdBase): if build_opts.is_linux(): job_name = "linux" - runs_on = "ubuntu-18.04" + runs_on = f"ubuntu-{args.ubuntu_version}" elif build_opts.is_windows(): # We're targeting the windows-2016 image because it has # Visual Studio 2017 installed, and at the time of writing, @@ -797,7 +797,9 @@ jobs: """ ) - getdeps = f"{py3} build/fbcode_builder/getdeps.py --allow-system-packages" + getdeps = f"{py3} build/fbcode_builder/getdeps.py" + if not args.disallow_system_packages: + getdeps += " --allow-system-packages" out.write(" build:\n") out.write(" runs-on: %s\n" % runs_on) @@ -823,7 +825,7 @@ jobs: # that we want it to use them! out.write(" - name: Fix Git config\n") out.write(" run: git config --system core.longpaths true\n") - else: + elif not args.disallow_system_packages: out.write(" - name: Install system deps\n") out.write( f" run: sudo {getdeps} install-system-deps --recursive {manifest.name}\n" @@ -880,9 +882,18 @@ jobs: ) def setup_project_cmd_parser(self, parser): + parser.add_argument( + "--disallow-system-packages", + help="Disallow satisfying third party deps from installed system packages", + action="store_true", + default=False, + ) parser.add_argument( "--output-dir", help="The directory that will contain the yml files" ) + parser.add_argument( + "--ubuntu-version", default="18.04", help="Version of Ubuntu to use" + ) def get_arg_var_name(args):