This reverts commit d69302761b.
Reason for revert: Broke Dart CI
```
gclient.py revinfo --output-json output.json
--filter='https://chrome-infra-packages.appspot.com/dart/dart-sdk/${platform}'
```
No longer returns:
```
{
"sdk/tools/sdks/dart-sdk:dart/dart-sdk/${platform}": {
"rev": "git_revision:7a6514d1377175decd3a886fe4190fbbebddac3a",
"url": "https://chrome-infra-packages.appspot.com/dart/dart-sdk/${platform}"
}
}
```
Bad build:
https://ci.chromium.org/ui/p/dart/builders/ci.sandbox/vm-aot-msan-linux-release-x64/90/overview
Good build:
https://ci.chromium.org/ui/p/dart/builders/ci.sandbox/vm-aot-msan-linux-release-x64/89/overview
Original change's description:
> Reland "resolve CIPD package names in gclient"
>
> This CL relands the below CL with the addition of handling situations where the CIPD package name has a variable=value and does not equate to true. In this case just return the original value in DEPS.
>
> This is a reland of commit 8faa5514ec
>
> Original change's description:
> > resolve CIPD package names in gclient
> >
> > Currently the package names are not resolved in gclient output, see example below.
> >
> > This is part of broader work to improve CIPD output, the next CL will replace 'None'.
> >
> > ```
> > $~ gclient revinfo -a | grep '${platform}\|${arch}'
> >
> > src/buildtools/linux64:gn/gn/linux-${arch}: None
> > src/buildtools/reclient:infra/rbe/client/${platform}: None
> > src/third_party/dawn/third_party/ninja:infra/3pp/tools/ninja/${platform}: None
> > src/third_party/dawn/tools/golang:infra/3pp/tools/go/${platform}: None
> > src/third_party/devtools-frontend-internal/devtools-frontend/third_party/esbuild:infra/3pp/tools/esbuild/${platform}: None
> > src/third_party/devtools-frontend/src/third_party/esbuild:infra/3pp/tools/esbuild/${platform}: None
> > src/third_party/ninja:infra/3pp/tools/ninja/${platform}: None
> > src/tools/luci-go:infra/tools/luci/isolate/${platform}: None
> > src/tools/luci-go:infra/tools/luci/swarming/${platform}: None
> > src/tools/resultdb:infra/tools/result_adapter/${platform}: None
> > ```
> >
> > Bug:b/279097790
> > Change-Id: I21abf2579910e9d79d9ee0dcd018ee761e3d3c1c
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4463983
> > Reviewed-by: Rachael Newitt <renewitt@google.com>
> > Reviewed-by: Gavin Mak <gavinmak@google.com>
> > Commit-Queue: Dan Le Febvre <dlf@google.com>
>
> Bug: b/279097790
> Change-Id: Ib08dac506ce221243c595dde5cb00e8e0d7dc7ed
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4501582
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Dan Le Febvre <dlf@google.com>
Bug: b/279097790
Change-Id: Ibf82354ac5005d9d6279d88aa99c8fb344aa6833
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4518113
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Dan Le Febvre <dlf@google.com>
This CL relands the below CL with the addition of handling situations where the CIPD package name has a variable=value and does not equate to true. In this case just return the original value in DEPS.
This is a reland of commit 8faa5514ec
Original change's description:
> resolve CIPD package names in gclient
>
> Currently the package names are not resolved in gclient output, see example below.
>
> This is part of broader work to improve CIPD output, the next CL will replace 'None'.
>
> ```
> $~ gclient revinfo -a | grep '${platform}\|${arch}'
>
> src/buildtools/linux64:gn/gn/linux-${arch}: None
> src/buildtools/reclient:infra/rbe/client/${platform}: None
> src/third_party/dawn/third_party/ninja:infra/3pp/tools/ninja/${platform}: None
> src/third_party/dawn/tools/golang:infra/3pp/tools/go/${platform}: None
> src/third_party/devtools-frontend-internal/devtools-frontend/third_party/esbuild:infra/3pp/tools/esbuild/${platform}: None
> src/third_party/devtools-frontend/src/third_party/esbuild:infra/3pp/tools/esbuild/${platform}: None
> src/third_party/ninja:infra/3pp/tools/ninja/${platform}: None
> src/tools/luci-go:infra/tools/luci/isolate/${platform}: None
> src/tools/luci-go:infra/tools/luci/swarming/${platform}: None
> src/tools/resultdb:infra/tools/result_adapter/${platform}: None
> ```
>
> Bug:b/279097790
> Change-Id: I21abf2579910e9d79d9ee0dcd018ee761e3d3c1c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4463983
> Reviewed-by: Rachael Newitt <renewitt@google.com>
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Dan Le Febvre <dlf@google.com>
Bug: b/279097790
Change-Id: Ib08dac506ce221243c595dde5cb00e8e0d7dc7ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4501582
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Dan Le Febvre <dlf@google.com>
Currently the package names are not resolved in gclient output, see example below.
This is part of broader work to improve CIPD output, the next CL will replace 'None'.
```
$~ gclient revinfo -a | grep '${platform}\|${arch}'
src/buildtools/linux64:gn/gn/linux-${arch}: None
src/buildtools/reclient:infra/rbe/client/${platform}: None
src/third_party/dawn/third_party/ninja:infra/3pp/tools/ninja/${platform}: None
src/third_party/dawn/tools/golang:infra/3pp/tools/go/${platform}: None
src/third_party/devtools-frontend-internal/devtools-frontend/third_party/esbuild:infra/3pp/tools/esbuild/${platform}: None
src/third_party/devtools-frontend/src/third_party/esbuild:infra/3pp/tools/esbuild/${platform}: None
src/third_party/ninja:infra/3pp/tools/ninja/${platform}: None
src/tools/luci-go:infra/tools/luci/isolate/${platform}: None
src/tools/luci-go:infra/tools/luci/swarming/${platform}: None
src/tools/resultdb:infra/tools/result_adapter/${platform}: None
```
Bug:b/279097790
Change-Id: I21abf2579910e9d79d9ee0dcd018ee761e3d3c1c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4463983
Reviewed-by: Rachael Newitt <renewitt@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Dan Le Febvre <dlf@google.com>
This reverts commit fe5a0b1289.
Reason for revert: gclient sync hangs for several MacOS users.
Original change's description:
> Use default number of cores for gclient jobs
>
> Instead of always setting jobs to 1 for ARM (which includes Mac), use
> number of cores. Some old boards have not worked well with parallel
> sync, but I don't have historical context was going on. My assumption is
> that those boards were single-core.
>
> See: https://codereview.chromium.org/10116033
>
> R=aravindvasudev@google.com
>
> Bug: 1410757
> Change-Id: I0b7e3363375ba719c73d4d7141e6cab34bf7d32f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4198732
> Reviewed-by: Dirk Pranke <dpranke@google.com>
> Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Bug: 1410757, 1427050
Change-Id: Ifde8393de047f63a448dbc1ef49a2f8049f49331
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4383325
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Auto-Submit: Aravind Vasudevan <aravindvasudev@google.com>
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>
Instead of always setting jobs to 1 for ARM (which includes Mac), use
number of cores. Some old boards have not worked well with parallel
sync, but I don't have historical context was going on. My assumption is
that those boards were single-core.
See: https://codereview.chromium.org/10116033R=aravindvasudev@google.com
Bug: 1410757
Change-Id: I0b7e3363375ba719c73d4d7141e6cab34bf7d32f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4198732
Reviewed-by: Dirk Pranke <dpranke@google.com>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Detect the name of unknown operating systems using uname, if available,
since it doesn't append the operating system version.
Change-Id: Idab7bd0db65a8d424ec2fd48f06247405b6649e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4169240
Auto-Submit: Jonas Termansen <sortie@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
When CIPD removes a package, it removes the files. However, it's
possible that those files were checked in beforehand (for example,
https://crrev.com/c/3858186).
bot_update/gclient sync will first run git operations followed by cipd
ensure.
This patch restores any files that may have been deleted after cipd
ensure.
Bug: 1369452
Change-Id: I43ff9553118a20ed250bddc15153f02828847ed3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3928237
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@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>
- Instead of expecting the caller to run `rev-parse HEAD` before
calling gclient, we can just store the latest commit on disk
- this gets around the problem where gclient might git reset to the
base checkout after applying patch-refs, so calling rev-parse
before calling gclient sync might not actually return the latest
commit of the last sync.
- also moving os.environ[PREVIOUS_CUSTOM_VARS] setting to earlier when
we only have the solutions in self.dependencies because all other
dependencies inherit from the solutions so there's no point storing
custom_vars for the rest.
Bug: 1339472
Change-Id: I6a3570f09153bd8087bbe6bdab7ece4949856aae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3750491
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
AFAICT
- the code never reaches this point because we already check should process before adding it to the queue. http://shortn/_PWFae17qw4
- this might be necessary if the value of should_process changes between adding it to the queue and running it. But I don't see that happening anywhere. should_process is only ever set and modified here: http://shortn/_eirozAoIm4 which happens during in the parent's run() before the deps get added to the queue.
The should_process check that happens at the beginning of run() was added here: https://codereview.chromium.org/3124017/diff/2001/gclient.py
The should_process check before a deps gets enqueued was added later here: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/559150/
where several should_process checks were added and I think the author just didn't realize that, while the other methods might need them, run() already had a should_process check.
Alternatively, we could remove the should_process check before enqueue-ing. But that would result in enqueuing things that we currently don't enqueue, even if we ultimately don't do anything with it.
Change-Id: Ib3be61310c09a681988baa75fd562c7596e9e044
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3721600
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
The meta quest browser has an issue with the initial design where the all the dependencies within the same tree are overridden with the solution URL's scheme. This fix updates fetch to add a .gclient entry instead of implicitly overriding the URL's scheme.
Bug: 1336027
Change-Id: Iabe5b9017f6eb9e682a0c721f43dd5f347ffcbfb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3703942
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
This is a reland of commit 6817010e83
Additional Changes:
This reland fixes https://crbug.com/1330995 by stopping gclient from accidentally updating the scheme when one is not present.
Original change's description:
> Update fetch protocol using --protocol-override flag
>
> This CL updates gclient sync to use the protocol of the URL specified in the solutions for cloning all the child dependencies of it.
>
> Bug: chrome-operations:170
> Change-Id: I33588059788b677fbae8c3b434100af5c7979a67
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3631600
> Reviewed-by: Joanna Wang <jojwang@chromium.org>
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Bug: 1330995
Change-Id: I1447a5e884e41d671d8556c35193f1635f2f6936
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3684112
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
This reverts commit 6817010e83.
Reason for revert: Breaks gclient sync for flutter
Original change's description:
> Update fetch protocol using --protocol-override flag
>
> This CL updates gclient sync to use the protocol of the URL specified in the solutions for cloning all the child dependencies of it.
>
> Bug: chrome-operations:170
> Change-Id: I33588059788b677fbae8c3b434100af5c7979a67
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3631600
> Reviewed-by: Joanna Wang <jojwang@chromium.org>
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Bug: chrome-operations:170
Change-Id: I76a49030f48fa266eeea336307e7153b22ded4e9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3684110
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
This CL updates gclient sync to use the protocol of the URL specified in the solutions for cloning all the child dependencies of it.
Bug: chrome-operations:170
Change-Id: I33588059788b677fbae8c3b434100af5c7979a67
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3631600
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
I ran into this error coming from the gclient.py script when I was
trying to run it on a Cygwin setup on Windows:
...
________ running 'vpython.bat -vpython-spec src/.vpython -vpython-tool install' in '/c/Users/circleci/project'
Hook 'vpython.bat -vpython-spec src/.vpython -vpython-tool install' took 34.10 secs
________ running 'vpython3 -vpython-spec src/.vpython3 -vpython-tool install' in '/c/Users/circleci/project'
[E2022-02-17T07:07:56.374746Z 10204 0 annotate.go:273] goroutine 1:
#0 go.chromium.org/luci/vpython/venv/config.go:309 - venv.(*Config).resolvePythonInterpreter()
reason: none of [C:/Users/circleci/project/vendor/depot_tools/bootstrap-2@3_8_10_chromium_23_binpython3bin/python3] matched specification 3.8.0
#1 go.chromium.org/luci/vpython/venv/config.go:153 - venv.(*Config).resolveRuntime()
reason: failed to resolve system Python interpreter
#2 go.chromium.org/luci/vpython/venv/venv.go:143 - venv.With()
reason: failed to resolve python runtime
#3 go.chromium.org/luci/vpython/application/subcommand_install.go:61 - application.(*installCommandRun).Run.func1()
reason: failed to setup the environment
...
Similar to the Windows-only "vpython" -> "vpython.bat" modification, I
added the necessary code to do it for vpython3 too, i.e.,
"vpython3" -> "vpython3.bat", and it fixed the problem for me.
Signed-off-by: Darshan Sen <raisinten@gmail.com>
Change-Id: Iac167ffe61b04a2836b03e620b98ee97b56965e1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3513473
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
This is a reland of fc9a40e3c6
Hopefully the cause of the 2nd revert was fixed in https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3489327
Original change's description:
> Reland "Add support for Gerrit topics in gclient syncs"
>
> This is a reland of 0f13273f1f
>
> Hopefully the cause of the original revert was fixed in https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3480835
>
> Original change's description:
> > Add support for Gerrit topics in gclient syncs
> >
> >
> > If the new flag "--download-topics" is specified with a "--patch-ref" then:
> > * Finds the topic of the Gerrit change.
> > * Finds all open changes in the same repo as the Gerrit change.
> > * Cherrypicks all changes locally.
> >
> > This functionality can be used by developers and bots to apply all changes with the same topic in the checkout to be tested at the same time (similar to how Android's TreeHugger handles topics).
> >
> >
> > Tested by:
> >
> > * Running the new unit test with `python gclient_scm_test.py GerritChangesTest.testDownloadsTopics` from the `tests/` directory.
> >
> > * Running an end-to-end test with `DEPOT_TOOLS_UPDATE=0 gclient sync --patch-ref "skia@d831da5b8ac2d257c5b0cf2ec6645a148f05e662:refs/changes/17/505217/2" --download-topics` in a skia checkout.
> >
> >
> > Bug: chromium:1298922
> > Change-Id: Ieace5e27fbc9c5d0ea90a037bf80a95062c1b164
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3444003
> > Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> > Commit-Queue: Ravi Mistry <rmistry@chromium.org>
>
> Bug: chromium:1298922
> Change-Id: I80747d797234bba06c17ef5c5e85b310281922c4
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3484976
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Commit-Queue: Ravi Mistry <rmistry@chromium.org>
Bug: chromium:1298922
Change-Id: I21d7251bafff808b1144d6e522fa9f384f4541bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3490488
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Ravi Mistry <rmistry@chromium.org>
This reverts commit fc9a40e3c6.
Reason for revert: at least one tryjob if failing:
Gerrit Plugins Tester
Original change's description:
> Reland "Add support for Gerrit topics in gclient syncs"
>
> This is a reland of 0f13273f1f
>
> Hopefully the cause of the original revert was fixed in https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3480835
>
> Original change's description:
> > Add support for Gerrit topics in gclient syncs
> >
> >
> > If the new flag "--download-topics" is specified with a "--patch-ref" then:
> > * Finds the topic of the Gerrit change.
> > * Finds all open changes in the same repo as the Gerrit change.
> > * Cherrypicks all changes locally.
> >
> > This functionality can be used by developers and bots to apply all changes with the same topic in the checkout to be tested at the same time (similar to how Android's TreeHugger handles topics).
> >
> >
> > Tested by:
> >
> > * Running the new unit test with `python gclient_scm_test.py GerritChangesTest.testDownloadsTopics` from the `tests/` directory.
> >
> > * Running an end-to-end test with `DEPOT_TOOLS_UPDATE=0 gclient sync --patch-ref "skia@d831da5b8ac2d257c5b0cf2ec6645a148f05e662:refs/changes/17/505217/2" --download-topics` in a skia checkout.
> >
> >
> > Bug: chromium:1298922
> > Change-Id: Ieace5e27fbc9c5d0ea90a037bf80a95062c1b164
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3444003
> > Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> > Commit-Queue: Ravi Mistry <rmistry@chromium.org>
>
> Bug: chromium:1298922
> Change-Id: I80747d797234bba06c17ef5c5e85b310281922c4
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3484976
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Commit-Queue: Ravi Mistry <rmistry@chromium.org>
Bug: chromium:1298922
Change-Id: I845321941157ab55d026488b7ce59787ba5e57f2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3488245
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
This is a reland of 0f13273f1f
Hopefully the cause of the original revert was fixed in https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3480835
Original change's description:
> Add support for Gerrit topics in gclient syncs
>
>
> If the new flag "--download-topics" is specified with a "--patch-ref" then:
> * Finds the topic of the Gerrit change.
> * Finds all open changes in the same repo as the Gerrit change.
> * Cherrypicks all changes locally.
>
> This functionality can be used by developers and bots to apply all changes with the same topic in the checkout to be tested at the same time (similar to how Android's TreeHugger handles topics).
>
>
> Tested by:
>
> * Running the new unit test with `python gclient_scm_test.py GerritChangesTest.testDownloadsTopics` from the `tests/` directory.
>
> * Running an end-to-end test with `DEPOT_TOOLS_UPDATE=0 gclient sync --patch-ref "skia@d831da5b8ac2d257c5b0cf2ec6645a148f05e662:refs/changes/17/505217/2" --download-topics` in a skia checkout.
>
>
> Bug: chromium:1298922
> Change-Id: Ieace5e27fbc9c5d0ea90a037bf80a95062c1b164
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3444003
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Commit-Queue: Ravi Mistry <rmistry@chromium.org>
Bug: chromium:1298922
Change-Id: I80747d797234bba06c17ef5c5e85b310281922c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3484976
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Ravi Mistry <rmistry@chromium.org>
This reverts commit 0f13273f1f.
Reason for revert: breaks codesearch recipes and autorollers
crbug.com/1298961
Original change's description:
> Add support for Gerrit topics in gclient syncs
>
>
> If the new flag "--download-topics" is specified with a "--patch-ref" then:
> * Finds the topic of the Gerrit change.
> * Finds all open changes in the same repo as the Gerrit change.
> * Cherrypicks all changes locally.
>
> This functionality can be used by developers and bots to apply all changes with the same topic in the checkout to be tested at the same time (similar to how Android's TreeHugger handles topics).
>
>
> Tested by:
>
> * Running the new unit test with `python gclient_scm_test.py GerritChangesTest.testDownloadsTopics` from the `tests/` directory.
>
> * Running an end-to-end test with `DEPOT_TOOLS_UPDATE=0 gclient sync --patch-ref "skia@d831da5b8ac2d257c5b0cf2ec6645a148f05e662:refs/changes/17/505217/2" --download-topics` in a skia checkout.
>
>
> Bug: chromium:1298922
> Change-Id: Ieace5e27fbc9c5d0ea90a037bf80a95062c1b164
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3444003
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Commit-Queue: Ravi Mistry <rmistry@chromium.org>
Bug: chromium:1298922
Bug: chromium:1298961
Change-Id: I88c56cd68372bad09b612de7de1a45f9a0c6c681
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3474793
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
If the new flag "--download-topics" is specified with a "--patch-ref" then:
* Finds the topic of the Gerrit change.
* Finds all open changes in the same repo as the Gerrit change.
* Cherrypicks all changes locally.
This functionality can be used by developers and bots to apply all changes with the same topic in the checkout to be tested at the same time (similar to how Android's TreeHugger handles topics).
Tested by:
* Running the new unit test with `python gclient_scm_test.py GerritChangesTest.testDownloadsTopics` from the `tests/` directory.
* Running an end-to-end test with `DEPOT_TOOLS_UPDATE=0 gclient sync --patch-ref "skia@d831da5b8ac2d257c5b0cf2ec6645a148f05e662:refs/changes/17/505217/2" --download-topics` in a skia checkout.
Bug: chromium:1298922
Change-Id: Ieace5e27fbc9c5d0ea90a037bf80a95062c1b164
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3444003
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Ravi Mistry <rmistry@chromium.org>
This includes a few fixes for specific errors, and disables several new
warnings introduced in this version, in order to allow for an incremental migration.
Bug:1262286
Change-Id: I4b8f8fc521386419a3121bbb07edc8ac83170a94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3413679
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
This reverts commit 22bf605bb6.
Reason for revert: breaks gclient sync
Original change's description:
> Use pylint 2.7 for depot_tools
>
> This includes a few fixes for specific errors, and disables several new
> warnings introduced in this version, in order to allow for an incremental migration.
>
> Bug:1262286
> Change-Id: Ie97d686748c9c952e87718a65f401c5f6f80a5c9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3400616
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Bug: 1262286
Change-Id: Ieb946073c7886c7bf056ce843a5a48e82becf7a5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3413672
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
This includes a few fixes for specific errors, and disables several new
warnings introduced in this version, in order to allow for an incremental migration.
Bug:1262286
Change-Id: Ie97d686748c9c952e87718a65f401c5f6f80a5c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3400616
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Condition evaluation checks are fairly expensive, and turns out we
repeat a lot of checks. All those checks are also done in a single
thread.
With this cache on my workstation, a noop gclient runhooks takes 9.5s.
Without one, it takes 26.2s.
R=gavinmak@google.com
Change-Id: Ie00b7af22cd124d08dd9fd218de77b34bbdfe6ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3309823
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Running gclient validate or gclient flatten outside of gclient root
results in an unhelpful AttributeError stacktrace. This change adds an
error message that lets the user know the client is not confugred.
Bug: 732733
Change-Id: I33b1a08aa394145e238a4939bfd995ec33a8df17
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2624351
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
And merge it in use_relative_paths. In all Chromium repos,
use_relative_hooks is True iff:
- use_relative_paths is True, and
- there is at least one hook
It makes sense that you'd want to use relative hooks if you use relative
paths so this CL merges both flags into use_relative_paths.
Bug: chromium:1107325
Change-Id: I0fe40eba1e1c61be26c812c7ca4329efb72c7f90
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2306795
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
With https://chromium-review.googlesource.com/2279874, gclient started
taking |use_relative_paths| into account when calculating the path to
gclient_args.gni from |gclient_gn_args_file|. This CL introduced an
issue where the calculation depends on the current working directory.
e.g. Running gclient from ~/repo and ~/repo/sub_dir produced different
results for gclient_args.gni.
Fix this by prepending the root path, which is absolute, when
calculating the path to gclient_args.gni.
Bug: chromium:1102833
Change-Id: I970e38352aea77d857e49dc7dca58f21ba8e0331
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2296219
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Without this repos that use the use_relative_paths still need to use
their absolute path for gclient_gn_args_file.
Bug: chromium:1102833
Change-Id: I470096625061a28abf495f4d1035121edbcd581f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2279874
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Running on Python 3 should be a fairly common situation at this
point, so it doesn't seem like we need an explicit warning for it.
Change-Id: Id73ffb89f6da6e7268fd2e5963cf99175a47b5b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2284547
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
This relands c7eed83 with a fix to the way variables are
propagated from parent dependencies into child dependencies.
The original CL description from c7eed83 was:
> gclient's existing functionality for handling variables is
> ambiguous: the value of a variable can either be a string literal
> or an expression fragment. The implementation is required to
> parse a value as an expression, and, if it is legal, treat it
> as an expression instead of a literal. This means that
>
> gclient_gn_args_file = 'src/build/args.gni'
> gclient_gn_args = ['xcode_version']
> vars = {
> 'xcode_version': 'xcode-12'
> }
>
> would cause a problem because gclient would try to parse the
> variable as an expression, and 'xcode' would not be defined.
>
> This patch adds a workaround for this, where you can instead
> use the Str() function to explicitly tell gclient to treat the
> value as a string and not a potential expression.
>
> The above example would be changed to:
>
> gclient_gn_args_file = 'src/build/args.gni'
> gclient_gn_args = ['xcode_version']
> vars = {
> 'xcode_version': Str('xcode-12')
> }
>
> The variable may still be used in every context where it was legal
> to be used before.
>
This reverts commit 84431987dd384c79c84515004d19db67345a1c00.
Bug: 1099242
TBR=ehmaldonado@chromium.org
Change-Id: I047b871df47c367c1f34a3985e5813504e3c5c6f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2274152
Commit-Queue: Dirk Pranke <dpranke@google.com>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
This reverts commit c7eed83f96.
Reason for revert: I'm getting reports of internal iOS checkouts being broken. Reverting while I reproduce / debug it.
Original change's description:
> Add a Str() function to gclient for use in DEPS files.
>
> gclient's existing functionality for handling variables is
> ambiguous: the value of a variable can either be a string literal
> or an expression fragment. The implementation is required to
> parse a value as an expression, and, if it is legal, treat it
> as an expression instead of a literal. This means that
>
> gclient_gn_args_file = 'src/build/args.gni'
> gclient_gn_args = ['xcode_version']
> vars = {
> 'xcode_version': 'xcode-12'
> }
>
> would cause a problem because gclient would try to parse the
> variable as an expression, and 'xcode' would not be defined.
>
> This patch adds a workaround for this, where you can instead
> use the Str() function to explicitly tell gclient to treat the
> value as a string and not a potential expression.
>
> The above example would be changed to:
>
> gclient_gn_args_file = 'src/build/args.gni'
> gclient_gn_args = ['xcode_version']
> vars = {
> 'xcode_version': Str('xcode-12')
> }
>
> The variable may still be used in every context where it was legal
> to be used before.
>
> Bug: 1099242
>
> Change-Id: Ic2a17eea5f7098113bdba0557fe29e1a931a74b8
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2268406
> Reviewed-by: Ben Pastene <bpastene@chromium.org>
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Commit-Queue: Dirk Pranke <dpranke@google.com>
TBR=thakis@chromium.org,dpranke@google.com,ehmaldonado@chromium.org,bpastene@chromium.org,apolito@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com
Change-Id: Iac2b003f32acdbca15a19f821b61423e34b3466c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1099242
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2273978
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Dirk Pranke <dpranke@google.com>
gclient's existing functionality for handling variables is
ambiguous: the value of a variable can either be a string literal
or an expression fragment. The implementation is required to
parse a value as an expression, and, if it is legal, treat it
as an expression instead of a literal. This means that
gclient_gn_args_file = 'src/build/args.gni'
gclient_gn_args = ['xcode_version']
vars = {
'xcode_version': 'xcode-12'
}
would cause a problem because gclient would try to parse the
variable as an expression, and 'xcode' would not be defined.
This patch adds a workaround for this, where you can instead
use the Str() function to explicitly tell gclient to treat the
value as a string and not a potential expression.
The above example would be changed to:
gclient_gn_args_file = 'src/build/args.gni'
gclient_gn_args = ['xcode_version']
vars = {
'xcode_version': Str('xcode-12')
}
The variable may still be used in every context where it was legal
to be used before.
Bug: 1099242
Change-Id: Ic2a17eea5f7098113bdba0557fe29e1a931a74b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2268406
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
This reverts commit 35c62742f9.
Reason for revert: Causing official branch failures: http://shortn/_AGHUiAf5Fu
Original change's description:
> Add GCLIENT_DEP_REF env var for recurse command
>
> The goal of this change is to facilitate analyzing DEPS autorolls https://crrev.com/c/2250928
>
> Change-Id: Icbebd144a85f7e24aa638f93d8c30f3f0aab1e5c
> Bug: 923016
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2239069
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Commit-Queue: Gregory Guterman <guterman@google.com>
TBR=ehmaldonado@chromium.org,guterman@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: 923016
Change-Id: I23ef45c90250441bf02cd956a446c0cf8b0bbcf7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2255567
Auto-Submit: Ben Mason <benmason@chromium.org>
Reviewed-by: Ben Mason <benmason@chromium.org>
Commit-Queue: Ben Mason <benmason@chromium.org>
This is a reland of d3affaa624
Original change's description:
> Use OS level locking in git_cache.py
>
> Without OS level locking it's possible to leave "lock" files on disk
> which will prevent next run to acquire those locks. This can easily
> happen if SIGKIL is issued.
>
> R=apolito@google.com, ehmaldonado@chromium.org
>
> Bug: 1049610
> Change-Id: Id87aa1376b9ea5ff0c2d14f3603636493ed1dd5b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2189333
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Bug: 1049610
Change-Id: I58e65a10f7c779e0de1121ba7167c694996e390c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2211189
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
This reverts commit d3affaa624.
Reason for revert: no attribute ignore_lock
Original change's description:
> Use OS level locking in git_cache.py
>
> Without OS level locking it's possible to leave "lock" files on disk
> which will prevent next run to acquire those locks. This can easily
> happen if SIGKIL is issued.
>
> R=apolito@google.com, ehmaldonado@chromium.org
>
> Bug: 1049610
> Change-Id: Id87aa1376b9ea5ff0c2d14f3603636493ed1dd5b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2189333
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
TBR=iannucci@chromium.org,ehmaldonado@chromium.org,apolito@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com,sokcevic@google.com
Change-Id: Iecc963e0a99d7f59f3f8801e529839346f9fbaf3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1049610
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2211186
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Without OS level locking it's possible to leave "lock" files on disk
which will prevent next run to acquire those locks. This can easily
happen if SIGKIL is issued.
R=apolito@google.com, ehmaldonado@chromium.org
Bug: 1049610
Change-Id: Id87aa1376b9ea5ff0c2d14f3603636493ed1dd5b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2189333
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
This was made by running `codespell` and `scspell`
and then checking the results.
Change-Id: I169fd5b40294f83015075b4a899fbca263821f25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2144602
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Auto-Submit: Quinten Yearsley <qyearsley@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
This fixes an issue on Windows where running `gclient setdep` would convert the DEPS file from LF to CRLF line endings.
From the python 2.7 docs:
" On Windows, 'b' appended to the mode opens the file in binary mode, so there are also modes like 'rb', 'wb', and 'r+b'. Python on Windows makes a distinction between text and binary files; the end-of-line characters in text files are automatically altered slightly when data is read or written. "
- https://docs.python.org/2.7/tutorial/inputoutput.html#reading-and-writing-files
Change-Id: I94183918789a8cdd4aa655db4b3dadfaae23d13a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2067477
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: John Emau <John.Emau@microsoft.com>
Using git daemon for smoke tests times out on Windows.
This CL adds support for local directory URLs to gclient so we can tests
using local directories as remotes instead.
Bug: 1024683
Change-Id: I6dcefa6eb0a93713cf46ea1e4c6b29311ad37565
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1915416
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Also add a better warning if 'gclient sync -D' fails due to a modified file.
I've tested this code via deleting a DEP and running gclient sync -D.
Bug: 981149
Change-Id: I97035ac238d163ccb1684c3ee423c223ed0f6299
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1891830
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Anthony Polito <apolito@google.com>
Ran:
vi $(git grep --name-only iteritems | grep -v third_party)
vi $(git grep --name-only itervalues | grep -v third_party)
vi $(git grep --name-only 'print ' | grep -v third_party)
and edited the files quickly with adhoc macros. Then ran in recipes/:
./recipes.py test train
There was only a small subset of files that had been updated to use
six.iteritems() and six.itervalues(). Since the dataset size that is
being used in gclient is small (pretty much always below 200 items),
it's better to just switch to .items() right away and take the temporary
performance hit, so that we don't need to come back to rewrite the code.
Recipe-Nontrivial-Roll: build
Bug: 984182
Change-Id: I5faf11486b66b0d73c9098ab0f2ce1b15a45c53e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1854900
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Marc-Antoine Ruel <maruel@chromium.org>
An increasing number of Windows developers are "accidentally" ending up
with Python 3 installed on their machine through the Windows Store. If
this version is first in the path then gclient may fail in non-obvious
ways. This adds a python version check to give a clear warning message.
R=vapier@chromium.org
Change-Id: I7a292fba2ab7d059a6149644d0b1fd92d2371dce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1825945
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: 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>
Ran "2to3 -w -n -f print ./" and manually added imports.
Ran "^\s*print " and "\s+print " to find batch/shell scripts, comments and the like with embedded code, and updated them manually.
Also manually added imports to files, which used print as a function, but were missing the import.
The scripts still work with Python 2.
There are no intended behaviour changes.
Bug: 942522
Change-Id: Id777e4d4df4adcdfdab1b18bde89f235ef491b9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1595684
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Auto-Submit: Raul Tambre <raul@tambre.ee>
Previously, gclient will exit if it found a tilde in any element from
PATH. This CL changes that to first check if the path is the actual
depot_tools directory.
Also check for '~', instead of '~/', in case the path looks like
'~user/path/to/depot_tools/.
Bug: 952865
Change-Id: Ied07444e44edb655b5c8837b5e51eeb0dcebba6d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1581419
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Bash and its descendants allow having $PATH entries containing literal tildes,
like:
...:~/depot_tools:...
If the user has their shell configured this way, their shell will be able to
invoke `fetch` and other depot_tools commands, but depot_tools will not in turn
be able to invoke subcommands via popen because popen does not have this
bash-specific behavior when not in shell mode.
This change has gclient detect this configuration problem and error out with a
descriptive error message. Not doing so leads to a puzzling condition where
gclient complains about being unable to find a program that (from the user's
perspective) is in their $PATH and invokable interactively.
It also has 'fetch' suppress its own failure stack trace if it runs gclient and
gclient fails; the 'fetch' stack trace pushes the messages from gclient (which
are actually diagnostic) off the screen.
Bug: chromium:952865
Change-Id: Ibba4d2fccee405aa68392ce141493f1de21ec018
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1573204
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
A previous CL replaced "basestring" with "str", because basestring
does not exist in Python 3. However, this broke Python 2's ability
to interoperate with unicode strings. This CL introduces a workaround
(defining basestring to be equivalent to string, if it doesn't exist
already), and restores the references to basestring. This workaround
can be fixed when we're 100% on Python 3.
It also undoes some unnecessary and harder-to-read formatting changes.
Bug: 942522
Change-Id: I4a31ee46dc048134c2e4832b6c44ea00ce341899
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1572441
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Restore previous behavior and keep emitting a warning when an existing
gclient entry is not longer part of the client. Additionally, suggest
the usage of `gclient sync -D` to automatically remove them.
Change-Id: I62d4662ae4d0886d340230019419b68debffc5ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1483031
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Michael Moss <mmoss@chromium.org>
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
This is no longer supported to make the move to Python 3 easier.
Only some very old/weird user configurations may have this, so this provides a clear actionable error message.
Bug: 942522
Change-Id: I88106089c53d84b19c4f77b7e60fe251082122d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1539957
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Raul Tambre <raul@tambre.ee>
This enables gclient sync and gclient runhooks to run, barring hook script failures.
git cl upload also now works.
The scripts still work with Python 2.
There are no intended behaviour changes.
Bug: 942522
Change-Id: I2ac587b5f803ba7f5bb5e412337ce049f4b1a741
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1524583
Commit-Queue: Raul Tambre <raul@tambre.ee>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
This reverts commit 2d29261e94.
Reason for revert: Both jbudorick and I asked you not to land this today :(.
Original change's description:
> Remove exception for relative CIPD
>
> This seems to no longer be necessary, as relative paths 'just work' for
> CIPD deps now.
>
> Change-Id: I3843548dc74d29af90e0c402f0459dbe60934423
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1529132
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Reviewed-by: John Budorick <jbudorick@chromium.org>
> Commit-Queue: Brandon Tolsch <btolsch@chromium.org>
TBR=dpranke@chromium.org,jbudorick@chromium.org,btolsch@chromium.org
Change-Id: I1d9a771ef34dae0dec15499d7cf28e4ba5daf2ff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1531193
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
This seems to no longer be necessary, as relative paths 'just work' for
CIPD deps now.
Change-Id: I3843548dc74d29af90e0c402f0459dbe60934423
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1529132
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: John Budorick <jbudorick@chromium.org>
Commit-Queue: Brandon Tolsch <btolsch@chromium.org>
gclient_utils.py is a kitchen sink and is for that reason expensive
to import. Move the comparatively cheap and simple path routines
to a new gclient_paths module and use that in gn.py, clang_format.py,
dart_format.py.
(To be able to move FindGclientRoot() to gclient_paths.py,
make it use io.open() instead of FileRead(). FileRead() tries
to paper over invalid utf-8, but that was added for presubmits,
not for .gclient files, so this is hopefully fine.)
Cuts gn.py overhead in half (on my Windows laptop from 0.6s to 0.25s,
still high; on my Mac laptop from 0.1s to 0.05s), and probably helps
the other two too.
Completely remove PathDifference() since it's unused.
Bug: 939959
Change-Id: I6a70f6e4c16062b622fb2df8778e8a598d4cc956
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1512058
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
This CL shows bit more detail of value collision.
Change-Id: I612f1a80cf160e7eebb2b48f0ddd1b8f9aaa81b1
Reviewed-on: https://chromium-review.googlesource.com/c/1475265
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This makes 'checkout_chromeos' conditions visible to '--deps=all'
processing.
R=ehmaldonado@google.com
Bug: 928829
Change-Id: I1fe3d73117203d549c7039f7621eecadd3ac344e
Reviewed-on: https://chromium-review.googlesource.com/c/1454849
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>