1
0
mirror of https://github.com/facebook/proxygen.git synced 2025-08-05 19:55:47 +03:00

getdeps: automatically detect if a build appears to be Facebook-internal

Summary:
Automatically detect the `--facebook-internal` flag based on the current
repository project name.

Reviewed By: wez

Differential Revision: D18621358

fbshipit-source-id: f2b3018169b151811eec455863a8bfc17667d4d8
This commit is contained in:
Adam Simpkins
2019-11-20 15:59:33 -08:00
committed by Facebook Github Bot
parent e75eeb1d20
commit 023cd12795
2 changed files with 14 additions and 2 deletions

View File

@@ -729,7 +729,13 @@ def parse_args():
"--facebook-internal",
help="Setup the build context as an FB internal build",
action="store_true",
default=False,
default=None,
)
add_common_arg(
"--no-facebook-internal",
help="Perform a non-FB internal build, even when in an fbsource repository",
action="store_false",
dest="facebook_internal",
)
ap = argparse.ArgumentParser(

View File

@@ -154,7 +154,7 @@ class BuildOptions(object):
def is_linux(self):
return self.host_type.is_linux()
def get_context_generator(self, host_tuple=None, facebook_internal=False):
def get_context_generator(self, host_tuple=None, facebook_internal=None):
""" Create a manifest ContextGenerator for the specified target platform. """
if host_tuple is None:
host_type = self.host_type
@@ -163,6 +163,12 @@ class BuildOptions(object):
else:
host_type = HostType.from_tuple_string(host_tuple)
# facebook_internal is an Optional[bool]
# If it is None, default to assuming this is a Facebook-internal build if
# we are running in an fbsource repository.
if facebook_internal is None:
facebook_internal = self.fbsource_dir is not None
return ContextGenerator(
{
"os": host_type.ostype,