reason: git submodule status command could be slower and output may
not be deterministic depending on the init status and current status
Change-Id: I3c9b8128e6fb230d51eb456234396a557b61c86f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5528758
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
google_java_format.py is a simple wrapper script that finds and
executes the google-java-format binary from Chromium tree.
This CL moves the corresponding function from git_cl.py so that
the logic can be executed without git_cl.py. This is the same strcture
used in git_cl.py for running other language formatters.
- clang_format.py
- swift_format.py
- rustfmt.py
- gn.py
With this patch, google-java-format can be used to run to formatter
a java file in a chromium tree that is located in a non git checkout.
Change-Id: I5f1b845040b28c0a8f15dd2e7c48c83ce2d9df97
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5525851
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Scott Lee <ddoman@chromium.org>
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>
llvm-build GCS dependency needs to place one GCS object based on
platform. We can't have multiple top-level GCS llvm-build dependencies
as the pathname is used as a key.
This extends object property of GCS dependency to have `condition`.
The `condition` field will be AND with the top level condition.
R=jojwang@google.com, kimstephanie@google.com
Change-Id: I06a6281140a8057d598a6eac2b07c7577f0ea86c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5527474
Reviewed-by: Stephanie Kim <kimstephanie@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
So that it can be shared with code other than scm.
Bug: 339231299
Change-Id: Iba68cc7ebba78c8933598d073861290bb0157c40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5529883
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Currently, git cl lint runs git commands to retrieve a list of
the affected files and runs the lint tool against the files.
This CL updates the command line argument interface such that,
if file paths are given in positional arguments, git cl will
just run the lint tool against the given files w/o executing any
git commands.
The intent of this CL is to make git cl lint runnable out of Git
checkouts.
Bug: 324595694
Change-Id: I0a68e33931f84c2441da53bf880a2d18a5526ae4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5454166
Commit-Queue: Scott Lee <ddoman@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
This reverts siso.py in commit 6ed0d7b86c
siso.py doesn't affect `ninja -t commands`
If out dir was built by Ninja, don't build by Siso.
(still allow `siso query` etc)
Bug: b/338414465
Change-Id: I3b317ca40153cee3987390d8b62ac070b6f85243
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5524213
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Auto-Submit: Fumitoshi Ukai <ukai@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>
If out dir was built by siso, don't build by ninja
Bug: b/338414465
Change-Id: I121beaa6c17409cc7a4b4535e158ed89c47cac89
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5514899
Auto-Submit: Fumitoshi Ukai <ukai@google.com>
Commit-Queue: Junji Watanabe <jwata@google.com>
Reviewed-by: Junji Watanabe <jwata@google.com>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Prior to this change, autoninja output was:
```
src/buildtools/reclient/bootstrap --re_proxy=src/buildtools/reclient/reproxy --cfg=src/buildtools/reclient_cfgs/reproxy.cfg
Proxy started successfully.
0.705 s to start reproxy
2.85s loading fs state
2.80s load build.ninja
ninja: no work to do.
7.38s Build Succeeded: 0 steps - 0.00/s
src/buildtools/reclient/bootstrap --shutdown --cfg=src/buildtools/reclient_cfgs/reproxy.cfg
RBE Stats: down 0 B, up 0 B,
0.331 s to stop reproxy
```
Now it's:
```
src/buildtools/reclient/bootstrap --re_proxy=src/buildtools/reclient/reproxy --cfg=src/buildtools/reclient_cfgs/reproxy.cfg
Proxy started successfully.
0.705s to start reproxy
2.85s loading fs state
2.80s load build.ninja
ninja: no work to do.
7.38s Build Succeeded: 0 steps - 0.00/s
src/buildtools/reclient/bootstrap --shutdown --cfg=src/buildtools/reclient_cfgs/reproxy.cfg
RBE Stats: down 0 B, up 0 B,
0.331s to stop reproxy
```
Change-Id: If1c4cd211f29267ed01c14efbe2fe09a1d101287
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5509391
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Auto-Submit: Louis Romero <lpromero@google.com>
This reverts commit 58ff1badf9.
This change also restricts diff only to changes that are submodule related by
utilizing patch diff search.
Original change's description:
> [gclient] Read submodule status information
>
> This allow us to skip sync if we know the state is correct.
>
> R=gavinmak@google.com
>
> Bug: 40283612, 40942309
> Change-Id: I30fd5bfb9ca8ab0f7dcce567e2a5cb4aebdc7b2f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5480172
> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
> Reviewed-by: Gavin Mak <gavinmak@google.com>
Bug: 40283612, 40942309
Change-Id: Iac7ed8c927de1a03a3d60dd50108ddb0b6d96c7e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5513190
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
This makes it so that the output looks like
{"path": {}} instead of {"<path>": {}}
This allows for easier parsing.
Bug: b/328065301
Change-Id: I235e6c28fe82785d3c148c3d81e0770495962d6b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5518843
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Stephanie Kim <kimstephanie@google.com>
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>
Without it, runnign gclient in Cog would fail with error
"AttributeError: 'CogWrapper' object has no attribute 'GetSubmoduleDiff'"
Change-Id: I6a3220f882eb38da9ebc59b6cac67743c41f4c7a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5509813
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Until we fix slow Window builds on developer machine,
It would probably be better to limit remote jobs to 1000.
Bug: b/335525655, b/336481263
Change-Id: I065e19480a27203da2b32ceb19050d0846fbc554
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5482550
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Junji Watanabe <jwata@google.com>
Auto-Submit: Junji Watanabe <jwata@google.com>
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
If a child repository is not cloned, gclient will assume git_dependency
to match parent, which can be incorrect.
R=gavinmak
Change-Id: Icb464524f5dcf2e18ccae1db00c69963ffd9ef02
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5506655
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
The number of revision objects must match the number of current objects
for a given path. The comma separated values for a revision object
must also be in the order of object_name, sha256sum, size_bytes, and
generation.
Example usage:
gclient setdep --revision=src/third_party/js_code_coverage@myobjectname,deadbeef,1223455,9438393984/myobjectname2,deadbefeaef,1223455,9438393984
Resulting diff:
diff --git a/DEPS b/DEPS
index b40bca8cdd89d..c2186185c1db5 100644
--- a/DEPS
+++ b/DEPS
@@ -553,10 +553,10 @@ deps = {
'bucket': 'chromium-nodejs',
'objects': [
{
- 'object_name': 'js_code_coverage/d538975c93eefc7bafd599b50f867e90c1ef17f3',
- 'sha256sum': '646bb00ced0a930b2eb1e4dbcfac18ebbb8f889bb80599e0254d9d6505427914',
- 'size_bytes': 1469185,
- 'generation': 1657780123604338,
+ 'object_name': 'myobjectname',
+ 'sha256sum': 'deadbeef',
+ 'size_bytes': 1223455,
+ 'generation': 9438393984,
},
],
},
Bug: b/324418194
Change-Id: Ibd824f7b51fa88f732c7197e2cc663b58de7479e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5503101
Commit-Queue: Stephanie Kim <kimstephanie@google.com>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
If gsutil is not downloaded, and if gsutil (or
download_from_google_storage) is called concurrently with n>2, it's
possible that those processes are doing the same work. There is also a
critical point where gsutil.py can fail with:
Destination path '/depot_tools_path/external_bin/gsutil/gsutil_4.68/d'
already exists error.
To avoid this problem, use FS locking around code that manipulates with
files.
R=jojwang@google.com
Bug: 338040708
Change-Id: Ib83aaa1e09628f878e512d79f2fa5221c2bcfd37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5502531
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
The check relies on `git ls-tree` which is unavailable for non-git
workspaces.
Bug: 333744051
Change-Id: Ib9151a283c3bf543390f2cf06e0ce213051fb509
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5503095
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Most tarfiles have .getnames() return top level dirs as <top_level_dir_name>
and files as <top_level_dir_name>/filename.txt. But some tarfiles don't
return the top level directories when running .getnames(). Instead we'll
have to parse through each path name to retrieve the top level directories.
Bug: b/337331070, b/337330736
Change-Id: I8c0e05a2c0722c02eda55162bf51b15a9c21e34a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5499051
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Stephanie Kim <kimstephanie@google.com>
Bug: 337720659
Change-Id: I7953bc95c6e8fb1d9ff794935811464a31d804a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5499917
Reviewed-by: Alvin Jia <alvinjia@google.com>
Auto-Submit: Joel Hockey <joelhockey@chromium.org>
Owners-Override: Joel Hockey <joelhockey@chromium.org>
Commit-Queue: Joel Hockey <joelhockey@chromium.org>
Commit-Queue: Alvin Jia <alvinjia@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>