Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit e9d426a

Browse files
authored
[goma] USe depot_tools vended goma is present (#22550)
1 parent 027fe50 commit e9d426a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tools/gn

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ def to_gn_args(args):
207207

208208
goma_dir = os.environ.get('GOMA_DIR')
209209
goma_home_dir = os.path.join(os.getenv('HOME', ''), 'goma')
210+
depot_tools_bin_dir = os.path.join(args.depot_tools, '.cipd_bin')
210211

211212
# GOMA has a different default (home) path on gWindows.
212213
if not os.path.exists(goma_home_dir) and sys.platform.startswith(('cygwin', 'win')):
@@ -218,6 +219,9 @@ def to_gn_args(args):
218219
elif args.goma and os.path.exists(goma_home_dir):
219220
gn_args['use_goma'] = True
220221
gn_args['goma_dir'] = goma_home_dir
222+
elif args.goma and os.path.exists(depot_tools_bin_dir):
223+
gn_args['use_goma'] = True
224+
gn_args['goma_dir'] = depot_tools_bin_dir
221225
else:
222226
gn_args['use_goma'] = False
223227
gn_args['goma_dir'] = None
@@ -326,6 +330,9 @@ def parse_args(args):
326330

327331
parser.add_argument('--goma', default=True, action='store_true')
328332
parser.add_argument('--no-goma', dest='goma', action='store_false')
333+
parser.add_argument('--depot-tools', default='~/depot_tools', type=str,
334+
help='Depot tools provides an alternative location for gomacc in ' +
335+
'/path/to/depot_tools/.cipd_bin')
329336

330337
parser.add_argument('--lto', default=True, action='store_true')
331338
parser.add_argument('--no-lto', dest='lto', action='store_false')

0 commit comments

Comments
 (0)