This is mostly for Python 3 improvements.
Bug: gerrit:10418
Change-Id: Ice96b8dc5f700015ae6ec53c0e5b86700bcf6532
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1734587
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Alex Klein <saklein@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
- Merge CheckCallAndFilter[AndHeader]
- print_stdout will cause command output to be redirected to sys.stdout.
- Made compatible with Python 3.
Bug: 984182
Change-Id: Ida30e295b872c8c1a1474a376a90aecea924f307
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1727404
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
This reverts commit 602076dcf2.
Reason for revert:
It fails on input 0xe2 0x9c 0x94 which is a utf-8 heavy check mark. Problem is that CheckCallAndFilter is processing output byte by byte, so trying to decode only one of utf-8 bytes in sequence will always fail.
Original change's description:
> depot_tools: Make gclient_utils Python 3 compatible.
>
> Bug: 984182
> Change-Id: Ifb93466dcb7541f46c31c9b298049c425dd150d6
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1715472
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
TBR=tandrii@chromium.org,ehmaldonado@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: 984182
Change-Id: Ieae421acc430a031621db3329223c1da85506e55
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1724730
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
{_resolve_fixed_revisions} resolves every revision property. After a test
failure, we don't want to resolve every revision always.
This CL allows updating a subset of revisions for a new checkout.
R=machenbach@chromium.orgTBR=tandrii@chromium.org
Bug: 950731, 982711
Change-Id: I3cdc5cdb882009886b82557427fdf9b02e860b39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1720929
Commit-Queue: Tamer Tas <tmrts@chromium.org>
Auto-Submit: Tamer Tas <tmrts@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Changed all headers in message to be the size of header 4 tags.
Made sure there is always a new line after code tag(```).
Change-Id: I772941a8bbf0634c9496ec648533110997e23cde
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1702293
Commit-Queue: Debrian Figueroa <debrian@google.com>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
The unicode type doesn't exist in Python 3, because everything's Unicode.
This would resulted in the following error on Python 3:
<Unicode console <stderr>>.write: NameError("name 'unicode' is not defined")
Bug: 942522
Change-Id: I3e90d078df64abcec2c79aa69881deea40ff7d01
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1701401
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Raul Tambre <raul@tambre.ee>
Auto-Submit: Raul Tambre <raul@tambre.ee>
In Python 3 the output of a subprocess is bytes, so they need to be decoded to be used as a string.
This previously caused the following error if there was an existing checkout during a fetch:
Traceback (most recent call last):
File "C:\Google\depot_tools\\fetch.py", line 318, in <module>
sys.exit(main())
File "C:\Google\depot_tools\\fetch.py", line 313, in main
return run(options, spec, root)
File "C:\Google\depot_tools\\fetch.py", line 299, in run
if not options.force and checkout.exists():
File "C:\Google\depot_tools\\fetch.py", line 98, in exists
return (os.path.exists(os.path.join(gclient_root, b'.gclient')) or
File "C:\Program Files\Python38\lib\ntpath.py", line 109, in join
genericpath._check_arg_types('join', path, *paths)
File "C:\Program Files\Python38\lib\genericpath.py", line 151, in _check_arg_types
raise TypeError("Can't mix strings and bytes in path components") from None
TypeError: Can't mix strings and bytes in path components
Bug: 939847
Change-Id: Ibf5b4923268595ba439586d688894f92696ecbb7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1701403
Auto-Submit: Raul Tambre <raul@tambre.ee>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Raul Tambre <raul@tambre.ee>
This causes an error since Python 3.5 due to a regression (https://bugs.python.org/issue32745):
Traceback (most recent call last):
File "C:\Google\depot_tools\metrics.py", line 267, in print_notice_and_exit
yield
File "C:\Google\depot_tools\gclient.py", line 3153, in <module>
sys.exit(main(sys.argv[1:]))
File "C:\Google\depot_tools\gclient.py", line 3136, in main
setup_color.init()
File "C:\Google\depot_tools\setup_color.py", line 70, in init
buf = ctypes.create_string_buffer('\0', 1024)
File "C:\Program Files\Python38\lib\ctypes\__init__.py", line 63, in create_string_buffer
raise TypeError(init)
TypeError: <Unicode console <stderr>>.write: ArgumentError("argument 2: <class 'ValueError'>: embedded null character")
Simply not filling the buffer with NULLs doesn't change the behaviour.
Bug: 942522
Change-Id: I1feb81555e995597b0b70f4aee9151fea755510c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1701402
Auto-Submit: Raul Tambre <raul@tambre.ee>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
CQ will soon start canceling tryjobs it triggered on no-longer-latest
patchsets if these tryjobs won't be re-used. New option can be used by
developers who upload new patchsets but actually care for prior
CQ-triggered tryjobs to complete.
This footer is effectively sticky, unless someone removes it by hand later.
We need to have the footer one way or another to tell the CQ what to do
(and provide a visible audit trail).
We may revisit the stickiness later based on accumulated usage data s.t.
the following uploads remove the footer unless the flag is passed.
Bug: 909895
Test: git cl upload --preserve-tryjobs
Change-Id: Ibbc6e917504c31eab8ab85296b3ecafd3add46df
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1701506
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
Without this we get an ugly stack trace. This is way more
friendly.
Bug: 983006
Change-Id: I5ba871ad71ad43bb48d91697e96473afbfe399a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1697221
Auto-Submit: Eli Ribble <eliribble@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Added headers and code tags
Made sure that when limiting message size, at least part of the message
is seen.
Change-Id: I404e2f7e86907f701332a62fe46334ff437cca03
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1690741
Reviewed-by: Stephen Martinis <martiniss@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Debrian Figueroa <debrian@google.com>
This incorporates a fix to psutil's calculation of
the number of processors on Windows systems with
more than 64 cores.
Windows systems with more than 64 logical
processors divide the processors into groups, with
most applications using only one group, i.e. a
portion of the actual processing power available.
Prior to v5.4.4, psutil only counted the number of
processors in the first processor group. This
resulted in only partial utilization of high-
processing-power systems.
For example, on the 72-core P920, this change has
the following effect:
Before:
> autoninja -C out\nogoma chrome
"c:\src\depot_tools\ninja.exe" -C out\nogoma base -j 38
After:
> autoninja -C out\nogoma chrome
"c:\src\depot_tools\ninja.exe" -C out\nogoma base -j 74
Using this new version of psutil doubles the
number of processors used for building Chrome on
the P920 (when not using goma).
A similar bug exists in ninja.exe, so using
autoninja will be particularly important after
this fix for users of the P920 and other systems
with >64 cores. More fixes will be needed
elsewhere for similar bugs - see crbug.com/980967
for general progress.
Bug: 980270
Change-Id: I8de61a72cf95acf28ef1bcef1b0057b7b1225832
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1686081
Commit-Queue: Jesse McKenna <jessemckenna@google.com>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>