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:
committed by
Facebook Github Bot
parent
e75eeb1d20
commit
023cd12795
@@ -729,7 +729,13 @@ def parse_args():
|
|||||||
"--facebook-internal",
|
"--facebook-internal",
|
||||||
help="Setup the build context as an FB internal build",
|
help="Setup the build context as an FB internal build",
|
||||||
action="store_true",
|
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(
|
ap = argparse.ArgumentParser(
|
||||||
|
@@ -154,7 +154,7 @@ class BuildOptions(object):
|
|||||||
def is_linux(self):
|
def is_linux(self):
|
||||||
return self.host_type.is_linux()
|
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. """
|
""" Create a manifest ContextGenerator for the specified target platform. """
|
||||||
if host_tuple is None:
|
if host_tuple is None:
|
||||||
host_type = self.host_type
|
host_type = self.host_type
|
||||||
@@ -163,6 +163,12 @@ class BuildOptions(object):
|
|||||||
else:
|
else:
|
||||||
host_type = HostType.from_tuple_string(host_tuple)
|
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(
|
return ContextGenerator(
|
||||||
{
|
{
|
||||||
"os": host_type.ostype,
|
"os": host_type.ostype,
|
||||||
|
Reference in New Issue
Block a user