DEPS entries all have slashes as their path separators.
If use_relative_path is set to true, .gclient_entries will actually
contain backslashes instead slashes. This is problematic when DEPS
file transitions from using use_relative_path = False to True.
In such case, gclient thinks there are two distinct repositories
and it will delete one with slashes. As this operation is the last
step of gclient sync, it results in affected repositories being
wrongfully removed.
This change forces all deps entries to have slashes regardless of
operating system.
R=gavinmak@google.com
Bug: 1422665
Change-Id: Idb73510d911a260bccf63d24a8d3452998b147f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4348792
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Removes a TODO to remove the patch_text argument and its uses from
get_footers and related methods. The TODO indicated that it was
only used in example code, and thus should be handled another way.
However, it turns out that there is at least one legitimate use of
thus functionality downstream to retrieve footers from CL
descriptions earlier revisions.
Fixed: 1179039
Change-Id: I79996f6053a6769043943de39735b2b5d7ee02ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4283342
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Auto-Submit: Brian Sheedy <bsheedy@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
This change updates banned words flag from 'uploadvalidator~skip' to 'banned-words~skip'.
Bug: None
Change-Id: I2d544171d01e6f61415ba7df03b31e7111226342
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4327604
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
This reverts commit 512fd3bd85.
Reason for revert: breaks some presubmits
https://crbug.com/1421441
Original change's description:
> Extract searching relevat files in utils function
>
> This change introduces lib/ directory which will be used for classes
> that are considered libraries and used by multiple executables.
>
> Change-Id: I3da126778bf5ffdb28d7a3c2b966c85de08ba717
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4289679
> Reviewed-by: Joanna Wang <jojwang@chromium.org>
> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Bug: 1421441
Change-Id: I20e40f452a544a1188a258131a620e2afcd64f13
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4328468
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
This reverts commit e9ece0f581.
Reason for revert: broke infra presubmits:
https://ci.chromium.org/p/infra/builders/try/infra-try-presubmit
Original change's description:
> Reland "Remove Python 2 support for PRESUBMIT.py"
>
> This is a reland of commit 8454fc2458
>
> Original change's description:
> > Remove Python 2 support for PRESUBMIT.py
> >
> > The presubmit system still supports invoking PRESUBMIT.py files using
> > Python 2. This has recently been turned off on the bots so this change
> > removes support more completely.
> >
> > There are still some python3 parameters being passed around - it seemed
> > better to do the simplest possible removal now, with a follow-up change
> > to remove more support code after this has sat for a while.
> >
> > Tests run from PRESUBMIT.py files could still be run using Python 2, but
> > those should also have been addressed already. Removing support for that
> > will be done in a subsequent change.
> >
> > Bug: 1207012
> > Change-Id: Id244d547a04438f83734dba269c3cc180c148b37
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4315183
> > Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> > Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
>
> Bug: 1207012
> Change-Id: If542cac21d8ec8704b28d03fd8407c5c2899ca2c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4317177
> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
> Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Bug: 1207012
Change-Id: Iebf76d9e2580761fc773791bac07439160503c98
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4323198
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
This is a reland of commit 8454fc2458
Original change's description:
> Remove Python 2 support for PRESUBMIT.py
>
> The presubmit system still supports invoking PRESUBMIT.py files using
> Python 2. This has recently been turned off on the bots so this change
> removes support more completely.
>
> There are still some python3 parameters being passed around - it seemed
> better to do the simplest possible removal now, with a follow-up change
> to remove more support code after this has sat for a while.
>
> Tests run from PRESUBMIT.py files could still be run using Python 2, but
> those should also have been addressed already. Removing support for that
> will be done in a subsequent change.
>
> Bug: 1207012
> Change-Id: Id244d547a04438f83734dba269c3cc180c148b37
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4315183
> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Bug: 1207012
Change-Id: If542cac21d8ec8704b28d03fd8407c5c2899ca2c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4317177
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
This reverts commit 8454fc2458.
Reason for revert: post submit hooks failing
https://crbug.com/1422416
Original change's description:
> Remove Python 2 support for PRESUBMIT.py
>
> The presubmit system still supports invoking PRESUBMIT.py files using
> Python 2. This has recently been turned off on the bots so this change
> removes support more completely.
>
> There are still some python3 parameters being passed around - it seemed
> better to do the simplest possible removal now, with a follow-up change
> to remove more support code after this has sat for a while.
>
> Tests run from PRESUBMIT.py files could still be run using Python 2, but
> those should also have been addressed already. Removing support for that
> will be done in a subsequent change.
>
> Bug: 1207012
> Change-Id: Id244d547a04438f83734dba269c3cc180c148b37
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4315183
> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Bug: 1207012
Bug: 1422416
Change-Id: Iaf3102e63ec3c698d0258fac5746dbd92c30edbb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4317176
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
The presubmit system still supports invoking PRESUBMIT.py files using
Python 2. This has recently been turned off on the bots so this change
removes support more completely.
There are still some python3 parameters being passed around - it seemed
better to do the simplest possible removal now, with a follow-up change
to remove more support code after this has sat for a while.
Tests run from PRESUBMIT.py files could still be run using Python 2, but
those should also have been addressed already. Removing support for that
will be done in a subsequent change.
Bug: 1207012
Change-Id: Id244d547a04438f83734dba269c3cc180c148b37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4315183
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
master->main branch migration left the cache in some builders to have its HEAD still pointing to refs/heads/master. This causes bot_update to fail. If in this state, delete the cache and force bootstrap.
Bug: 1418866
Change-Id: Id716a013833d459ee37306d27b369099faf846ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4310522
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
This reverts commit c962e86f7b.
Reason for revert: broke MacOS:
realpath: command not found
Original change's description:
> Resolve symlinks to cipd, vpython3
>
> If we point a symlink at vpython3 (or various other tools), it will try
> to resolve the depot_tools path to wherever that symlink is stored. We
> should instead follow the symlink before determining the path.
>
> Prior art:
>
> * in python, we're doing Path.resolve() in many cases
> * in shell, there's a "$(readlink "$(dirname "$0"))" (man/push_to_gs.sh)
>
> BUG=b:270994985
> TEST=symlink to vpython3 works
>
> Change-Id: Ifee014d2571ccf58d830a2702c8a0ea225dd4821
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4295094
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
> Commit-Queue: Brian Norris <briannorris@chromium.org>
Bug: b:270994985
Change-Id: I69342f3a52153b8cb1ed4366ede5883dfe5ec0b9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4310530
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
If we point a symlink at vpython3 (or various other tools), it will try
to resolve the depot_tools path to wherever that symlink is stored. We
should instead follow the symlink before determining the path.
Prior art:
* in python, we're doing Path.resolve() in many cases
* in shell, there's a "$(readlink "$(dirname "$0"))" (man/push_to_gs.sh)
BUG=b:270994985
TEST=symlink to vpython3 works
Change-Id: Ifee014d2571ccf58d830a2702c8a0ea225dd4821
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4295094
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Brian Norris <briannorris@chromium.org>
An out of date .boto file can prevent Google employees from being able
to download the Chromium toolchain from Google storage. An error message
was added to gsutil.py to help developers diagnose this, but the message
was swallowed by get_toolchain_if_necessary.py. This change prints the
error message, and adds '*' * 80 separators to make it more visible.
An obsolete import is also removed.
Bug: 1414152
Change-Id: I69d5a786672304ed363c291e0a8ef89f8be0f2e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4310059
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
This reverts commit 19794fe91f.
Reason for revert: Doesn't fix the cache.
Original change's description:
> Reset origin/HEAD when it points to master
>
> This change tries resetting origin/HEAD when it points to master and the ref cannot be found. Post master->main migration, some cached repositories seem to point origin/HEAD to master.
>
> Bug: 1418866
> Change-Id: I83942901b105cace4d51deeac7e400f98d200168
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4296441
> Reviewed-by: Fumitoshi Ukai <ukai@google.com>
> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Bug: 1418866
Change-Id: I4c912f8401afb6fb0c2149c277778bdee9fa5d76
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4304240
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Some records include '-p' as a target in the ninja metrics.
Bug: b/270907050
Change-Id: I4040db5793e682eaa48242bc27756c91d05ad320
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4302230
Auto-Submit: Junji Watanabe <jwata@google.com>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
This is required because colons trigger an reproxy bug with named pipes
currently and backslashes are technically invalid for named pipes
https://learn.microsoft.com/en-us/windows/win32/ipc/pipe-names
I considered replacing invalid characters with underscores but that may
just push the problem down the road as it may create overlap between a
directory with underscores and a directory with an invalid charachter
that we replace.
Since windows doesn't treat pipes as files, like linux treats sockets
this naming is arbitrary, it only needs to be consistent and unique
for a given output directory. So md5 is a good solution.
Bug: b/271310759
Change-Id: I45409d7e9dc4cc1d0f056a3de8241ac877e682e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4300857
Commit-Queue: Ben Segall <bentekkie@google.com>
Auto-Submit: Ben Segall <bentekkie@google.com>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
This change introduces lib/ directory which will be used for classes
that are considered libraries and used by multiple executables.
Change-Id: I3da126778bf5ffdb28d7a3c2b966c85de08ba717
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4289679
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Sometimes, users may send very large config files to luci-config service
to validate (e.g chromeos). The GFE has 32 MiB limit. Therefore,
compress the json body and set a custom `application/json-zlib` content
type header that luci-config service is able to recognize.
Bug: 1417047
Change-Id: I61ee50125bab5746f8094d81cab484d70002ac53
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4296563
Commit-Queue: Yuanjun Huang <yuanjunh@google.com>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
When opening a text file it is important to specify encoding='utf-8'
since otherwise the behavior will depend on your system locale. This
change fixes various encoding omissions in PRESUBMIT.py files, found
when presubmits were run when uploading crrev.com/c/4290775.
Bug: 1418846
Change-Id: Ief5f6d6bb749de95bc4071055492e6c9c6b6c56d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4292516
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Chromium has now switched to MSVS2022+SDK22621 toolchain.
We should update some parameters and annotations in the file
to avoid inconsistent situations.
After applying this patch locally, no abnormal situation
is found. We can pack the toolchain normally.
Change-Id: I10ca115a076001efaa2b020251f2e448622598dc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4297895
Auto-Submit: Ho Cheung <uioptt24@gmail.com>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>