This reverts commit ba352e00ba.
Reason for revert: Unfortunately this breaks this command when run
from a normal cmd.exe prompt:
autoninja ..\..\base\win\access_token.cc^^
The escaping of ^^ as it passes through batch files is very finicky, but important.
Original change's description:
> Update autoninja.bat to work with other shells.
>
> Other shells, such as TCC, have subtle differences in how batch files are processed. This will not break cmd.exe compatibility.
>
> Without the "call" command, running a nested batch file should, according to CMD.exe "rules", cancel the current batch file and run the new one. However, the 'FOR /f "usebackq"' command will call the batch file and return. One could argue for both approaches, however, adding the "call" command doesn't seem to affect cmd.exe and fixes the other shell.
>
> There is a similar issue with the "do" (in the FOR command) block and the use of the '&' separator. The '%a' variable isn't expanded, but adding the '()' block works in both instances.
>
> Bug: 1351817
> Change-Id: Idd685a64404ea950b71e1f3cc0f5d1e3bf13b8b6
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3824199
> Commit-Queue: Allen Bauer <kylixrd@chromium.org>
> Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Bug: 1351817
Change-Id: I9d204a3369c468664c0cff247ed1a53065dfebfd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3829729
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
ListOwners returns all OWNERS for a file, which is undesirable in cases
when only direct OWNERS are needed.
Bug: 1351212, 1351519
Change-Id: I693b6645c780aa589e8ab24d0b58691f4aeb30f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3823299
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Other shells, such as TCC, have subtle differences in how batch files are processed. This will not break cmd.exe compatibility.
Without the "call" command, running a nested batch file should, according to CMD.exe "rules", cancel the current batch file and run the new one. However, the 'FOR /f "usebackq"' command will call the batch file and return. One could argue for both approaches, however, adding the "call" command doesn't seem to affect cmd.exe and fixes the other shell.
There is a similar issue with the "do" (in the FOR command) block and the use of the '&' separator. The '%a' variable isn't expanded, but adding the '()' block works in both instances.
Bug: 1351817
Change-Id: Idd685a64404ea950b71e1f3cc0f5d1e3bf13b8b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3824199
Commit-Queue: Allen Bauer <kylixrd@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Pylint uses parallelism to improve performance, but high startup costs
means that this only makes sense if there are lots of files to be
processed. So, a while ago a change was made such that if there are
fewer than ten files to be analyzed then no parallelism is used.
Our Pylint wrapper also has a hack where it does one type of check in
serial mode, because that is the only time it is reliable. This
requires running Pylint twice, which is expensive.
If there are a small enough number of files to analyze then we will be
doing serial analysis anyway, so there is no need to do two separate
runs. In this test case:
git cl presubmit -v --files tools\code_coverage\create_js_source_maps\test\create_js_source_maps_test.py
the cost of Pylint is dropped roughly in half, from six seconds to
three seconds, by eliminating one of the three-second runs.
Bug: 1309977
Change-Id: I2e5e96a86d1d76b127f481af7478d807c042b609
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3812436
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
This update is per http://crrev.com/1031130 where OSS licensing
requested removal of "All rights reserved" from new files.
Change-Id: I52a9deab99539ea90403798606c7bbeb261df994
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3811744
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Auto-Submit: Robert Liao <robliao@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
code-owners should have been enabled for most hosts that depot_tools
supports by now. Remove our own implementation and rely on code-owners.
Change-Id: Iaf0d3db65b2e5063b67d42b92188c4ec51d2cd9a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3783475
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Recent gerrit issues made it obvious that "git cl presubmit" relies on
gerrit much more than most people would expect (the expectation is zero
for many people). This makes presubmits flaky or much slower under poor
network conditions, and it means that the presubmit step may drastically
underestimate how long it takes to run because of a
cl.FetchDescription() that may occur outside of the timed portion of the
presubmits.
This change wraps more network-touching steps in try/except blocks, to
make them robust. It also gets them to check for the existence of a
PRESUBMIT_SKIP_NETWORK environment variable. And, it prints the elapsed
time to get the CL description if this is inordinately long.
Bug: 1350227
Change-Id: I7954fd50e928fd24975a4f61a316cb280542ebbd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3813095
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
The try/except was added for one specific situation but the 'except' portion accepts a wide range of errors. This results in confusing logs and nothing clearly states what actually caused the error.
Bug: 1349905, 1350210
Change-Id: Ia86c71b0b77658992fca5d3de215e659ccd90d96
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3810798
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
This reverts commit a2267932e6.
Reason for revert: this version has an issue with led edit-recipe-bundle https://crbug.com/1350060
Original change's description:
> Update led to the current version.
>
> This will pull in the change that allows for "led edit-cr-crl" to accept
> URLs in the form output by "git cl issue": URLs that do not contain the
> gerrit project.
>
> Bug: 1348269
> Change-Id: Icb360686c9ca1548636e755bc9a611351d78d2f7
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3807651
> Commit-Queue: Garrett Beaty <gbeaty@google.com>
> Reviewed-by: Chan Li <chanli@chromium.org>
Bug: 1348269
Change-Id: Idad964cf47b0cbc7174201add38ab8799c1ae9b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3812817
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Junji Watanabe <jwata@google.com>
In case of PartitionAlloc project in Chromium, there is a case that
it's useful to declare 'noparent' in the DEPS due to the situation
that a sub directory is exported to a standalone git project.
//base/allocator/partition_allocator/ (sub directory) is exported to
https://chromium.googlesource.com/chromium/src/base/allocator/partition_allocator.git
Change-Id: Ic51b6cd3928002962f25620b4d8797bed7802d1e
Bug: chromium:1151236
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3802719
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
This will pull in the change that allows for "led edit-cr-crl" to accept
URLs in the form output by "git cl issue": URLs that do not contain the
gerrit project.
Bug: 1348269
Change-Id: Icb360686c9ca1548636e755bc9a611351d78d2f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3807651
Commit-Queue: Garrett Beaty <gbeaty@google.com>
Reviewed-by: Chan Li <chanli@chromium.org>
Once this is rolled out, we will no longer need to bootstrap python(3)
in the vpython wrapper, only vpython itself.
Bug: 1318617
Change-Id: If11b81f19d1d15eda74aae94ddc95c2997148c8e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3760318
Reviewed-by: Chenlin Fan <fancl@chromium.org>
Commit-Queue: Brian Ryner <bryner@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Change crrev.com/c/3788227 fixed one instance of errors being treated as
warnings when running "git cl presubmit" with the --upload option. This
is undesirable when testing "git cl presubmit" with --all or --files,
because it makes the errors harder to find. This change fixes four
more newly discovered instances of this behavior.
That is, this change makes it so that pylint issues and other serious
problems will be reported as errors when running:
git cl presubmit --force --all --upload
This will make the pylint errors that this command triggers easier to
find and fix:
git cl presubmit --force --upload --files mojo\public\tools\bindings\*.py
This change does _not_ turn cpplint warnings into errors, even though
they are errors when running non-upload presubmits. That is because
there are several directories that only run cpplint on upload and these
directories have many errors and there is no short-term path to changing
this.
Bug: 1309977
Change-Id: If49f820fc6894dcd1d9aaaf4d932b04f79922bc5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3791744
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Jesse McKenna <jessemckenna@google.com>
Includes this change:
85ebd26fca
This changes the generation of location_filters from location_regexp
in some cases.
Bug: 1171945
Change-Id: I233281adb2edd62771f47ccb941fa99ade628f75
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3799232
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Contains commits:
7979d954927af292bd5a57dd398a9791cc43099c Use the full paths of bundled interpreters.
ededcc9ee88d285f6c1ea6154b0c61da5cc6fd6a Provide a way to pass in the full python executable path.
376c57dec286030d5321b4aeffbbc26dd297d28c Add a test that inheritable file handles are passed through to Python.
Bug: 1318617
Change-Id: Ib163c6b8d88667dcec5afe975006586d13b2b2f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3787826
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Brian Ryner <bryner@google.com>
Applying a command on a value usually mean to call `cmd value`. Hence
it seemed important to me to clarify that the current working
directory is changed.
Tested:
* Entered `gclient recurse --help` and checked the new message appear.
* Entered both examples in the terminal and checked the output.
Thanks to sdefresne for his help understanding recurse.
Change-Id: I729efc2014ed3cf90112cc89875a283d58ce8af0
Fixed: 1345272
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3769966
Reviewed-by: Arthur Milchior <arthurmilchior@google.com>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Arthur Milchior <arthurmilchior@google.com>
When upload presubmits are being run then GetUnitTests would treat
errors as warnings, so as to not stop developers from uploading their
changes. This makes sense when patches are being manually uploaded, but
doesn't make sense when running a "git cl presubmit --all --upload" bot.
This behavior caused nine failures (but not all failures) to be missed
when doing these tests.
This change makes these failures errors when testing with --all
--upload, but leaves them as warnings for other --upload purposes.
Bug: 1309977
Change-Id: Ibf149475e4cdee10bbbbc86fd0ab668b7a679089
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3788227
Reviewed-by: Jesse McKenna <jessemckenna@google.com>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
We want people to use specific pylint-$VER wrappers now to get stable
behavior and make it easier to roll updates. This one is just a link
to pylint-1.5 which uses Python 2. Anyone still linting Python 2 code
should be using pylint-1.5 explicitly.
Let's drop this to get it out of $PATH for developers who want pylint
from their host system to "just work".
Change-Id: I14411db7cddd0ecce40a370366c21f496166fe1d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3780302
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Brian Ryner <bryner@google.com>
Although many things are private, the existence of Chrome is not.
This change has precedent, c.f. 04d16a561 for infra_internal.
Bug: None
Change-Id: I6fb9719a44c2e5f5cc492bacb442d9554b0d4480
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3779641
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Thiago Perrotta <tperrotta@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
When investigating presubmits it is sometimes handy to get stacks in
order to understand where a presubmit is being called from. In one
recent investigation to see why CheckOwners was being called multiple
times the traceback just said:
File "c:\src\depot_tools\presubmit_support.py", line 1646, in _run_check_function
result = eval(function_name + '(*__args)', context)
File "<string>", line 1, in <module>
File "PRESUBMIT.py", line 251, in CheckChangeOnUpload
That's not very helpful because Chromium has 288 files named
PRESUBMIT.py. This change just uses the actual presubmit path as the
filename parameter to compile instead of a hard-coded string, which
means that "PRESUBMIT.py" is replaced with the full path in the
tracebacks.
Bug: 1309977
Change-Id: Icacfae4399444cb24e9cfb07475b90099e2e18d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3776955
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Currently, `git cl help baseurl` fails as it tries to execute the
subcommand, completely bypassing the help.
Parse the arguments early so that the help command runs cleanly for
baseurl.
Fixed: 1345909
Change-Id: Icad7aca6cdc7c9938e91a421cb72e08433a30fd4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3776942
Auto-Submit: Thiago Perrotta <tperrotta@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>