diff --git a/build/fbcode_builder/getdeps.py b/build/fbcode_builder/getdeps.py index 514c3c532..37af80be1 100755 --- a/build/fbcode_builder/getdeps.py +++ b/build/fbcode_builder/getdeps.py @@ -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] diff --git a/build/fbcode_builder/getdeps/buildopts.py b/build/fbcode_builder/getdeps/buildopts.py index 9fbdbcf71..da6cdca08 100644 --- a/build/fbcode_builder/getdeps/buildopts.py +++ b/build/fbcode_builder/getdeps/buildopts.py @@ -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, ) diff --git a/build/fbcode_builder/getdeps/manifest.py b/build/fbcode_builder/getdeps/manifest.py index 494dee253..ece21b5e5 100644 --- a/build/fbcode_builder/getdeps/manifest.py +++ b/build/fbcode_builder/getdeps/manifest.py @@ -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 (