GYP is in hard-maintenance mode :) There are still some users of it. I don't think Crashpad has fully flipped over to GN, and Node.js's ecosystem uses it (so I think the v8 GYP build is still supported).
However, nothing based on Chromium will work with GYP at this point.
I think the sanitizer flags are all set via mb.py at this point, but I am not 100% positive. I am not aware of anything in the Chromium build depending on GYP_DEFINES, though there are a few other open bugs for things that may use GYP_DEFINES in one form or another (hopefully all for legacy reasons): bug 679135 , bug 718157, bug 756686, bug 8262187, at least.
+thakis for clang/update.poy, +brucedawson for vs_toolchain.py.
The recommended way of checking for android from a recipe is to check for TARGET_PLATFORM in the config object, e.g.:
https://cs.chromium.org/chromium/build/scripts/slave/recipe_modules/chromium/api.py?l=591
I would expect the asan code paths to be dead; all of the command line argument formation should be happening src-side via mb.py or the //testing/buildbot configs.
Oh, sorry, I missed that you were asking about update.py; I thought you meant from a recipe from the other part of that comment.
If you're calling from a hook being run as part of DEPS, probably the right way to do it would be to conditionally change the command line based on whether 'checkout_android' was true. You can't tell for sure whether you want to *build* android at that point in time, but if checkout_android is true, the odds are pretty high that you do.
Ah thanks, that sounds like a good approach. Is there a better way to pass a flag for this than having two DEPS entries, one running if checkout_android and the other if ! checkout_android?
You can interpolate the conditions into the command lines, so something like '--checkout-android={checkout-android}'. See some of the cros_ hooks for examples.
I tried that (https://chromium-review.googlesource.com/c/chromium/src/+/1176635) but I'm getting
Traceback (most recent call last):
File "/Users/thakis/src/depot_tools/metrics.py", line 215, in print_notice_and_exit
yield
File "/Users/thakis/src/depot_tools/gclient.py", line 3030, in <module>
sys.exit(main(sys.argv[1:]))
File "/Users/thakis/src/depot_tools/gclient.py", line 3016, in main
return dispatcher.execute(OptionParser(), argv)
File "/Users/thakis/src/depot_tools/subcommand.py", line 252, in execute
return command(parser, args[1:])
File "/Users/thakis/src/depot_tools/gclient.py", line 2714, in CMDrunhooks
return client.RunOnDeps('runhooks', args)
File "/Users/thakis/src/depot_tools/gclient.py", line 1574, in RunOnDeps
patch_refs=patch_refs)
File "/Users/thakis/src/depot_tools/gclient_utils.py", line 1075, in run
self.item.run(*self.args, **self.kwargs)
File "/Users/thakis/src/depot_tools/gclient.py", line 899, in run
self.ParseDepsFile()
File "/Users/thakis/src/depot_tools/gclient.py", line 677, in ParseDepsFile
filepath, self.get_vars())
File "/Users/thakis/src/depot_tools/gclient_eval.py", line 475, in Parse
result = ExecLegacy(content, filename, vars_override)
File "/Users/thakis/src/depot_tools/gclient_eval.py", line 384, in ExecLegacy
return _DeepFormat(local_scope)
File "/Users/thakis/src/depot_tools/gclient_eval.py", line 375, in _DeepFormat
for k, v in node.iteritems()
File "/Users/thakis/src/depot_tools/gclient_eval.py", line 375, in <dictcomp>
for k, v in node.iteritems()
File "/Users/thakis/src/depot_tools/gclient_eval.py", line 378, in _DeepFormat
return [_DeepFormat(elem) for elem in node]
File "/Users/thakis/src/depot_tools/gclient_eval.py", line 375, in _DeepFormat
for k, v in node.iteritems()
File "/Users/thakis/src/depot_tools/gclient_eval.py", line 375, in <dictcomp>
for k, v in node.iteritems()
File "/Users/thakis/src/depot_tools/gclient_eval.py", line 378, in _DeepFormat
return [_DeepFormat(elem) for elem in node]
File "/Users/thakis/src/depot_tools/gclient_eval.py", line 371, in _DeepFormat
return node.format(**vars_dict)
KeyError: 'checkout_android'
when running it on a platform that doesn't have checkout_android set.
Comment 1 by dpranke@chromium.org
, Aug 10