Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make GOMA state automatic by default #43584

Merged
merged 1 commit into from
Jul 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions tools/gn
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ def buildtools_dir():
def setup_goma(args):
goma_gn_args = {}

# args.goma has three states, True (--goma), False (--no-goma), and
# None (default). In True mode, we force GOMA to be used (and fail
# if we cannot enable it) unless the selected target definitely does
# not support it (in which case we print a warning). In False mode,
# we disable GOMA regardless. In None mode, we enable it if we can
# autodetect a configuration, and otherwise disable it.

# When running in CI, the recipes use their own goma install, and take
# care of starting and stopping the compiler proxy.
running_on_luci = os.environ.get('LUCI_CONTEXT') is not None
Expand All @@ -235,14 +242,16 @@ def setup_goma(args):
if args.target_os == 'wasm' or args.web:
goma_gn_args['use_goma'] = False
goma_gn_args['goma_dir'] = None
print('Disabling GOMA for wasm builds, it is not supported yet.')
elif args.goma and not running_on_luci and os.path.exists(cipd_goma_dir):
if args.goma:
print('Disabling GOMA for wasm builds, it is not supported yet.')
elif args.goma is not False and not running_on_luci and os.path.exists(
cipd_goma_dir):
goma_gn_args['use_goma'] = True
goma_gn_args['goma_dir'] = cipd_goma_dir
elif args.goma and goma_dir and os.path.exists(goma_dir):
elif args.goma is not False and goma_dir and os.path.exists(goma_dir):
goma_gn_args['use_goma'] = True
goma_gn_args['goma_dir'] = goma_dir
elif args.goma and os.path.exists(goma_home_dir):
elif args.goma is not False and os.path.exists(goma_home_dir):
goma_gn_args['use_goma'] = True
goma_gn_args['goma_dir'] = goma_home_dir
elif args.goma:
Expand Down Expand Up @@ -870,7 +879,7 @@ def parse_args(args):
help='Do not build the host-side development artifacts.'
)

parser.add_argument('--goma', default=True, action='store_true')
parser.add_argument('--goma', default=None, action='store_true')
parser.add_argument('--no-goma', dest='goma', action='store_false')
parser.add_argument(
'--xcode-symlinks',
Expand Down