Commit 2fbf3798 authored by Wez Furlong's avatar Wez Furlong Committed by Facebook Github Bot

fbcode_builder: getdeps: add flag to use the real shipit

Summary:
This fixes a TODO; in our CI environment we want to use the
real shipit, so we'll use this flag to make that happen.

Reviewed By: simpkins

Differential Revision: D14695576

fbshipit-source-id: 64ee72c210e2472d295dcbd39c86549273b68452
parent 9b351f60
......@@ -207,6 +207,12 @@ def build_argparser():
"(default=number of cpu cores)"
),
)
common_args.add_argument(
"--use-shipit",
help="use the real ShipIt instead of the simple shipit transformer",
action="store_true",
default=False,
)
ap = argparse.ArgumentParser(
description="Get and build dependencies and projects", parents=[common_args]
......
......@@ -30,7 +30,13 @@ def containing_repo_type(path):
class BuildOptions(object):
def __init__(
self, fbcode_builder_dir, scratch_dir, host_type, install_dir=None, num_jobs=0
self,
fbcode_builder_dir,
scratch_dir,
host_type,
install_dir=None,
num_jobs=0,
use_shipit=False,
):
""" fbcode_builder_dir - the path to either the in-fbsource fbcode_builder dir,
or for shipit-transformed repos, the build dir that
......@@ -42,6 +48,7 @@ class BuildOptions(object):
for builds outside of FB
install_dir - where the project will ultimately be installed
num_jobs - the level of concurrency to use while building
use_shipit - use real shipit instead of the simple shipit transformer
"""
if not num_jobs:
import multiprocessing
......@@ -71,6 +78,7 @@ class BuildOptions(object):
self.install_dir = install_dir
self.fbcode_builder_dir = fbcode_builder_dir
self.host_type = host_type
self.use_shipit = use_shipit
def is_darwin(self):
return self.host_type.is_darwin()
......@@ -223,4 +231,5 @@ def setup_build_options(args, host_type=None):
host_type,
install_dir=args.install_prefix,
num_jobs=args.num_jobs,
use_shipit=args.use_shipit,
)
......@@ -272,9 +272,15 @@ class ManifestParser(object):
return d
def create_fetcher(self, build_options, ctx):
# TODO: add a build_option flag to force using ShipitTransformerFetcher
# instead of this in CI environments
if self.fbsource_path and build_options.fbsource_dir and self.shipit_project:
use_real_shipit = (
ShipitTransformerFetcher.available() and build_options.use_shipit
)
if (
not use_real_shipit
and self.fbsource_path
and build_options.fbsource_dir
and self.shipit_project
):
return SimpleShipitTransformerFetcher(build_options, self)
if (
......
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