In order to facilitate removing uses of api.path.checkout_dir from
downstream repos, this change adds a custom return type for
bot_update.ensure_checkout. Now instead of a standard step result, an
object of Result will be returned. Result records the relevant paths
(directory where the checkout was performed, the repo that was checked
out and the repo that was patched, if any). This provides the caller
the ability to work in any of these directories without using
api.path.checkout_dir and without requiring boilerplate to construct
the paths. It also includes some attributes that provide details from
within the json output to abstract that out.
Bug: 329113288, 339472834
Change-Id: I2ec6db635c5b799bdb65d4e9364e7d99aae4159e
Recipe-Manual-Change: build
Recipe-Manual-Change: build_limited
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5523194
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Garrett Beaty <gbeaty@google.com>
Currently overriding test data for bot_update requires specifying the
json output and in some cases the corresponding retcode. It's easy to
set the json output to values that wouldn't match the build inputs. This
change adds module test data for bot_update to have the bot_update fail
to checkout or fail the patch without having to manually specify the
json output as well. It also adds module test data for controlling
whether there are commit positions in the output properties.
The fail_patch property of the bot_update module was removed since it
was only used by tests to force the patch failure codepath and now the
fail_patch module test data can be used instead.
Change-Id: I03f61c2ff95c2561b746efbaae8e35b520027a2b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5518044
Reviewed-by: Scott Lee <ddoman@chromium.org>
Auto-Submit: Garrett Beaty <gbeaty@google.com>
Commit-Queue: Scott Lee <ddoman@chromium.org>
The downstream use has been switched to set patch_root instead so the
root parameter is no longer necessary.
Change-Id: Id0b20265550daa7e93af0ebf717d48db56164037
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5514209
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Garrett Beaty <gbeaty@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
In production, if there is no patch, then the bot_update output will
have the value for the patch_root key set to null and the patch_failure
key will only be set if there was a patch failure. This updates the
output_json test API method so that the json matches this behavior. The patch_root parameter was added that will be used to set the
patch_root key. The root parameter is preserved for now until a
downstream use passing the argument by keyword can be updated.
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: build_limited
Recipe-Nontrivial-Roll: chrome_release
Recipe-Nontrivial-Roll: chromiumos
Recipe-Nontrivial-Roll: infra
Change-Id: I0c34a41ff18bce2900a2f176ff992e6d147abbd4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5506838
Commit-Queue: Garrett Beaty <gbeaty@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Replace uses of '[START_DIR]' and '[CACHE]' in comments with
api.path.start_dir and api.path.cache_dir. This doesn't actually keep
anything from breaking, but it ensures the comments stay correct.
Change-Id: I4087925a29e3e9a4cb47e044733ab6109cb659bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5492788
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Rob Mohr <mohrr@google.com>
Use Path.joinpath() or the / operator instead of Path.join().
Eventually, config_types.Path will be replaced with pathlib.Path, which
doesn't have a join() method. In general, if the substitution was simple
the / operator was used. Otherwise, '.join(' was replaced with
'.joinpath('.
Change-Id: Iff2eb0abd9fdb0d3b3bca281c7c5436f932a5380
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5483206
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Rob Mohr <mohrr@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
config_types.Path will soon be replaced with pathlib.Path and
pathlib.Path doesn't have a join() method.
Bug: 329113288
Change-Id: I81bf607ffb41d84928af0eea06be78540b9912d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5467697
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Auto-Submit: Rob Mohr <mohrr@google.com>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
The summary markdown assumes there's errors when there might not be.
Recipe-Nontrivial-Roll: build
Bug: 330512874
Change-Id: I4941bd0551f5bb64adec7a85bbaeb64c20e230b9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5427700
Auto-Submit: Gavin Mak <gavinmak@google.com>
Reviewed-by: Louis Romero <lpromero@google.com>
Commit-Queue: Louis Romero <lpromero@google.com>
Some downstream repos rely on the 'current platform' detection and
would like to mock it in their tests. Give a real API for doing this
instead of having downstream recipes key on the internal step name
here.
R=athom, jeffyoon@google.com, whesse
Change-Id: If9d049c568c70cac9ddee1c06f2bd04ac4f572a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5428682
Reviewed-by: Alexander Thomas <athom@google.com>
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
According to https://en.wikipedia.org/wiki/Xcode:
- macOS 13.0 is the minimum macOS version supported by
14E222b and 14E300c
- So we point 13.0 to the latest one, which is 14E300c
- macOS 13.5 is the minimum macOS version supported by
15A240d, 15A507, 15C65, and 15C500b
- So we point it to the latest one, which is 15C500b
- macOS 14.0 is the minimum macOS version supported by
15E5204a (which looks like a typo of 15e204a according
to xcodereleases.com and //infra/config/targets/mixins.star)
- There will surely be more versions that support back
to 14.0 but this is the only one for now. So we point
it 15e204a.
This should hopefully give us C++20 support on macOS 13 and up,
like we see in the Chromium waterfall.
Bug: chromium: 40284755
Change-Id: I2049aa3c4b32990dbedbd95e9ec35cceaa1ca3a3
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: build_limited
Recipe-Nontrivial-Roll: build
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5425635
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: danakj <danakj@chromium.org>
Since macOS 11, the underlying python `platform.mac_vers()` call
that mac_release is populated from returns "10.16" on all versions
of macOS.
Switch this to just shell out to `sw_vers` to pick up the current
platform version instead.
Non-trivial downstream rolls are because `api.platform.mac_release`
no longer mocks the version of the SDK installed... however it would
be better to set this by just using the explicit sdk_version property.
R=yueshe@google.com
Bug: 331252586
Recipe-Nontrivial-Roll: build_limited
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: build
Change-Id: I41a27383f67db4835ba84b7a47813884879818cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5394351
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Yue She <yueshe@google.com>
The current code appends "--depth 1" as a single parameter.
Change-Id: I87cf34ffc45d0d9ce49453a7449b82e526989924
Recipe-Nontrivial-Roll: infra
Recipe-Nontrivial-Roll: build
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5105224
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
It can be used to reduce the size of payloads to download in git fetch
operations.
Change-Id: I631af18bee01eaa829d3d4755a57935690a99a85
Bug: 1508826
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5091760
Commit-Queue: Scott Lee <ddoman@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
python3 is the only supported version of python in depot_tools.
Remove py2 support from files including:
* cpplint.py
* subprocess2.py
* many tests and testing_support files
Bug: 1475402
Change-Id: I67a98188bc13c4dc119e6158a37bd236bfd6ea70
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4824474
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Scott Lee <ddoman@chromium.org>
This is a reland of commit 5819c303f0
Original change's description:
> Drop py2 support in recipe modules
>
> python3 is the only supported version of python in depot_tools.
>
> Bug: 1475402
> Change-Id: I479de09a0c34b438aced35e4ced58a5972108132
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4808518
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
> Commit-Queue: Gavin Mak <gavinmak@google.com>
Bug: 1475402
Change-Id: Ie4e6612a95511026b7602837f8dd3030bcf3ef8a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4811285
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
python3 is the only supported version of python in depot_tools.
Bug: 1475402
Change-Id: I479de09a0c34b438aced35e4ced58a5972108132
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4808518
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
It's the only roll that uses use_relative_path = False. Instead of fully
supporting that case, we will ask user to provide prefix that should be
removed when gitlinks are added.
Change-Id: I1e39d0ce145a246e5b69b7cf64e6b9471bcb1aea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4794721
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Keybo Qian <keybo@google.com>
roll_deps method in gclient recipe_module allow users to pass DEPS file
together with recipes that need to be rolled. It returns a list of files
that need to be edited in addition to the modified DEPS file (replaced
inline).
R=jojwang, keybo
Change-Id: I6987849f0ebacbb063d6f6186af1dba1647550a7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4785897
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Xinan Lin <linxinan@chromium.org>
The chromium-style plugin was replaced last year with cl/495068108.
Change-Id: Ifce7cf5e22f10681ffe743572182d759ae51fed2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4743665
Auto-Submit: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
The recipe engine has a refactor coming up where CONFIG_CTX needs to
be explicitly exported for other modules to extend it. Currently
a handful of modules in the build, build_internal and
release_scripts repos extend the gclient configuration context.
Exporting it like this should have no functional effect, but is just
in preparation for the upcoming refactor.
R=gavinmak
Bug: 1462728
Change-Id: I5871d472f7e28d38eefa9b1e89cfcc804823a1bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4680284
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
This rolls adds support for xcode15 adoption, in case builders using osx recipes want to roll to xcode15 in the future
Recipe-Nontrivial-Roll: build
Recipe-Nontrivial-Roll: infra
Bug: 1457029
Change-Id: I958d1ac03281d5663ff3a0df4f0812bde863df2e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4675569
Reviewed-by: Jeff Yoon <jeffyoon@google.com>
Commit-Queue: Yue She <yueshe@google.com>
The usage of config in the git_cl module is wholly unnecessary - This
CL gives a trivial way to change downstream repos to use a normal method
in place of configs, which will ultimately let us remove config.py from
this module.
Change-Id: Ia02ad110c41fadcd3bada0258ba96cbe70d0e43c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4662591
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
The "upload traces" step is skipped if bot_update times out and is in
the grace_period. Reserve 1 minute to upload traces.
Bug: 1351547, 1456840
Change-Id: Idb191735a07d245575ff4c79375a976750522fa5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4651461
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Since python3.3, the platform value has been changed from linux2 or
linux3 to linux. The bug has stopped bot_update script from emitting
proces tree periodically that will be helpful when debugging.
R=sokcevic
Bug: 1455926
Change-Id: Id6ab4ddf46eaa322a8b5470baa7ba6cc656a6bb3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4654290
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
The blamelist_pins attribute is being set on the json output, which is a
dictionary. This only works right now because json.output currently uses
OrderedDict as the dict type. With removal of support for python2, dict
could be used since its iteration order is insertion order in python3.
This change removes setting the blamelist_pins attribute since its not
used anywhere and it will allow json.output to use plain dict.
Change-Id: Ie19b87d61903774454df2d395acf695eaa39b201
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4617204
Commit-Queue: Garrett Beaty <gbeaty@google.com>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Auto-Submit: Garrett Beaty <gbeaty@google.com>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Switch from Xcode 13.0 to 13.2.1 to update the macOS SDK from 11.3 to
12.1. This is needed for bots that use this receipe, like PDFium Mac
bots, after crrev.com/1154867 made macOS 12 mandatory. This also has the
effect of updating the iOS SDK from 15.0 to 15.2.
Change-Id: I4c91b2c23bd8eaacac6cef6afe71fed3533fd838
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4605813
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Lindsay Pasricha <lindsayw@chromium.org>