Commit bcfad25b authored by Cooper Lees's avatar Cooper Lees Committed by Facebook GitHub Bot

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
parent 1b940536
...@@ -758,7 +758,7 @@ class GenerateGitHubActionsCmd(ProjectCmdBase): ...@@ -758,7 +758,7 @@ class GenerateGitHubActionsCmd(ProjectCmdBase):
if build_opts.is_linux(): if build_opts.is_linux():
job_name = "linux" job_name = "linux"
runs_on = "ubuntu-18.04" runs_on = f"ubuntu-{args.ubuntu_version}"
elif build_opts.is_windows(): elif build_opts.is_windows():
# We're targeting the windows-2016 image because it has # We're targeting the windows-2016 image because it has
# Visual Studio 2017 installed, and at the time of writing, # Visual Studio 2017 installed, and at the time of writing,
...@@ -797,7 +797,9 @@ jobs: ...@@ -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(" build:\n")
out.write(" runs-on: %s\n" % runs_on) out.write(" runs-on: %s\n" % runs_on)
...@@ -823,7 +825,7 @@ jobs: ...@@ -823,7 +825,7 @@ jobs:
# that we want it to use them! # that we want it to use them!
out.write(" - name: Fix Git config\n") out.write(" - name: Fix Git config\n")
out.write(" run: git config --system core.longpaths true\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(" - name: Install system deps\n")
out.write( out.write(
f" run: sudo {getdeps} install-system-deps --recursive {manifest.name}\n" f" run: sudo {getdeps} install-system-deps --recursive {manifest.name}\n"
...@@ -880,9 +882,18 @@ jobs: ...@@ -880,9 +882,18 @@ jobs:
) )
def setup_project_cmd_parser(self, parser): 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( parser.add_argument(
"--output-dir", help="The directory that will contain the yml files" "--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): def get_arg_var_name(args):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment