mirror of
https://github.com/facebook/proxygen.git
synced 2025-08-08 18:02:05 +03:00
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
This commit is contained in:
committed by
Facebook Github Bot
parent
710ddeb891
commit
4725faf983
@@ -207,6 +207,12 @@ def build_argparser():
|
|||||||
"(default=number of cpu cores)"
|
"(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(
|
ap = argparse.ArgumentParser(
|
||||||
description="Get and build dependencies and projects", parents=[common_args]
|
description="Get and build dependencies and projects", parents=[common_args]
|
||||||
|
@@ -30,7 +30,13 @@ def containing_repo_type(path):
|
|||||||
|
|
||||||
class BuildOptions(object):
|
class BuildOptions(object):
|
||||||
def __init__(
|
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,
|
""" fbcode_builder_dir - the path to either the in-fbsource fbcode_builder dir,
|
||||||
or for shipit-transformed repos, the build dir that
|
or for shipit-transformed repos, the build dir that
|
||||||
@@ -42,6 +48,7 @@ class BuildOptions(object):
|
|||||||
for builds outside of FB
|
for builds outside of FB
|
||||||
install_dir - where the project will ultimately be installed
|
install_dir - where the project will ultimately be installed
|
||||||
num_jobs - the level of concurrency to use while building
|
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:
|
if not num_jobs:
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
@@ -71,6 +78,7 @@ class BuildOptions(object):
|
|||||||
self.install_dir = install_dir
|
self.install_dir = install_dir
|
||||||
self.fbcode_builder_dir = fbcode_builder_dir
|
self.fbcode_builder_dir = fbcode_builder_dir
|
||||||
self.host_type = host_type
|
self.host_type = host_type
|
||||||
|
self.use_shipit = use_shipit
|
||||||
|
|
||||||
def is_darwin(self):
|
def is_darwin(self):
|
||||||
return self.host_type.is_darwin()
|
return self.host_type.is_darwin()
|
||||||
@@ -223,4 +231,5 @@ def setup_build_options(args, host_type=None):
|
|||||||
host_type,
|
host_type,
|
||||||
install_dir=args.install_prefix,
|
install_dir=args.install_prefix,
|
||||||
num_jobs=args.num_jobs,
|
num_jobs=args.num_jobs,
|
||||||
|
use_shipit=args.use_shipit,
|
||||||
)
|
)
|
||||||
|
@@ -272,9 +272,15 @@ class ManifestParser(object):
|
|||||||
return d
|
return d
|
||||||
|
|
||||||
def create_fetcher(self, build_options, ctx):
|
def create_fetcher(self, build_options, ctx):
|
||||||
# TODO: add a build_option flag to force using ShipitTransformerFetcher
|
use_real_shipit = (
|
||||||
# instead of this in CI environments
|
ShipitTransformerFetcher.available() and build_options.use_shipit
|
||||||
if self.fbsource_path and build_options.fbsource_dir and self.shipit_project:
|
)
|
||||||
|
if (
|
||||||
|
not use_real_shipit
|
||||||
|
and self.fbsource_path
|
||||||
|
and build_options.fbsource_dir
|
||||||
|
and self.shipit_project
|
||||||
|
):
|
||||||
return SimpleShipitTransformerFetcher(build_options, self)
|
return SimpleShipitTransformerFetcher(build_options, self)
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
Reference in New Issue
Block a user