Commit Graph

80 Commits (chrome/3987)

Author SHA1 Message Date
Edward Lemur 65f6b45d6d gclient: Assert invokations of gclient succeed when running smoketests.
Bug: 1024683
Change-Id: I01245d34ad1fa1142ce726c80bf5b61567bafe35
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1925038
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lemur e9024d00d2 gclient: Make smoke tests use local dir instead of git daemon.
Running gclient_smoketests times out on windows when using git daemon,
so use a local directory as remote instead.

Bug: 1024683
Change-Id: I6ca506d74de463d914317f176eefbe74996298c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1879723
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
5 years ago
Edward Lesmes e79107e01b gclient_scm: Fix tests on windows
Change-Id: I649bee199e52ecbd66467cfaf850a7a57e2eedf6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1874506
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Marc-Antoine Ruel 8e57b4bc55 python3 improvements
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>
5 years ago
Edward Lemur 26a8b9f356 depot_tools: Make gclient Python3 compatible.
Bug: 984182
Change-Id: Idc38678acbfca9cc6b89d77db28fdc24784f2b7d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1753742
Commit-Queue: Edward Lemur <ehmaldonado@google.com>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
6 years ago
Edward Lemur 9185e4495d depot_tools: Make scm Python 3 compatible.
Bug: 984182
Change-Id: I6165cf889ebd4e074f1f72b29e8d1216337fb04f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1752480
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
6 years ago
Edward Lemur 979fa780ce depot_tools: Make gclient_scm Python 3 compatible.
Bug: 984182
Change-Id: Ib9c5d2762546f29eaca5eae89b0428431067da4a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1753029
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
6 years ago
Raul Tambre 7d1300b89a fake_repos: Fix use of NamedTemporaryFile on Windows
Python doesn't guarantee that the file created by tempfile.NamedTemporaryFile can be opened by multiple programs at once.
This is the case on Windows, so we need to close the temporary PID file and only then pass it to Git.

Bug: 962263
Change-Id: Idf4a36b33ce06d7ab06453c20a690622179aef58
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1608560
Auto-Submit: Raul Tambre <raul@tambre.ee>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Raul Tambre <raul@tambre.ee>
6 years ago
Raul Tambre 1d49bad9f0 fake_repos: Log stderr when Git fails to start
Bug: 962263
Change-Id: I71824bf30ff6d735d07e70e8b1cd054530d8985b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1607844
Auto-Submit: Raul Tambre <raul@tambre.ee>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Raul Tambre <raul@tambre.ee>
6 years ago
Raul Tambre cd862e37ea gclient_scm: Decode Git output centrally for better Python 3 support
This avoids the need to do the decoding everywhere separately.
Also a small fix for filter() no longer returning a list on Py3.

The scripts still work with Python 2.
There are no intended behaviour changes.

Bug: 942522
Change-Id: Id0f5153011b2ef1b64394359087864cd9434e45e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1595685
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Auto-Submit: Raul Tambre <raul@tambre.ee>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
6 years ago
Raul Tambre 80ee78e7fa Convert print statements to Python 3 style
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>
6 years ago
Raphael Kubo da Costa b45f6428f8 fake_repos: Create a new socket for every connection attempt while waiting for a port
connect(2) says stream sockets may only succeed to connect once. This means
if the call to sock.connect() fails it will continue failing for the
entirety of the wait loop, and we will fail to wait for a port to bind even
when it eventually becomes available.

Make sure we create a new socket every time we are about to try to connect
to it.

Change-Id: I16d7dbea3590c5bf7f7240bdefcc5ec0bcd1edb5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1528291
Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Auto-Submit: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
6 years ago
Edward Lemur 5b1fa949bb gclient: Sync CIPD deps before running hooks.
Bug: 882611
Change-Id: I72646544a164f557ea7d53e0ce0f16d663618a98
Reviewed-on: https://chromium-review.googlesource.com/c/1255446
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Edward Lemur 647e1e79eb Reland "gclient: delete unversioned directory before adding cipd dep for the same path"
This is a reland of 67ef3f67e8

We no longer call cipd unconditionally.

Original change's description:
> gclient: delete unversioned directory before adding cipd dep for the same path
>
> Bug: 882611
> Change-Id: I46e41cc9693b90874b5d6569a12ec638eaac1050
> Reviewed-on: https://chromium-review.googlesource.com/1228655
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>

Bug: 882611
Change-Id: I683bfc62bd1eebfec0853583f96f3981c2c6bdf2
Reviewed-on: https://chromium-review.googlesource.com/1232891
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
Andrii Shyshkalov 07b5283a4e Revert "gclient: delete unversioned directory before adding cipd dep for the same path"
This reverts commit 67ef3f67e8.

Reason for revert: might have broken GCE/ccompute fleet.

Original change's description:
> gclient: delete unversioned directory before adding cipd dep for the same path
> 
> Bug: 882611
> Change-Id: I46e41cc9693b90874b5d6569a12ec638eaac1050
> Reviewed-on: https://chromium-review.googlesource.com/1228655
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>

TBR=tandrii@chromium.org,ehmaldonado@chromium.org

Change-Id: Ia2172b1b0d236357edf93dacf57f3bf7d80d5968
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 882611
Reviewed-on: https://chromium-review.googlesource.com/1231699
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Edward Lemur 67ef3f67e8 gclient: delete unversioned directory before adding cipd dep for the same path
Bug: 882611
Change-Id: I46e41cc9693b90874b5d6569a12ec638eaac1050
Reviewed-on: https://chromium-review.googlesource.com/1228655
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Corentin Wallez a68660d0bb gclient: add use_relative_hooks
When a recursive dependency has use_relative_paths it also makes sense
to have the hooks working directory by the dependency's directory.
Otherwise if a hook uses one of the relative dependencies it is impossible
to know which path prefix to use.

However we cannot change the behavior of hooks with use_relative_paths
because it would break existing projects that use_relative_paths but
hardcoded the prefix for hooks. Instead we add a second boolean,
use_relative_hooks that triggers the behavior.

Adds tests for the new behavior and a test for existing interactio
between hooks and recursedeps.

BUG=chromium:875245

Change-Id: Ie4c526baa425ff887b3be54e0feca7c597ededec
Reviewed-on: https://chromium-review.googlesource.com/1213327
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
John Budorick 882c91ed97 Revert "gclient: Add support for the branch:revision format."
This reverts commit d328b47eb1.

Reason for revert: suspect this caused https://bugs.chromium.org/p/chromium/issues/detail?id=863211

Original change's description:
> gclient: Add support for the branch:revision format.
> 
> Bug: 850812, 853032
> Change-Id: I597acbde2b3c229813b7eba8fcba52d5877130b2
> Reviewed-on: https://chromium-review.googlesource.com/1119235
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Aaron Gable <agable@chromium.org>

TBR=agable@chromium.org,tandrii@chromium.org,ehmaldonado@chromium.org

Change-Id: I1e4c00b83a2840cc5a87621469da866dad58a20c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 850812, 853032
Reviewed-on: https://chromium-review.googlesource.com/1135893
Reviewed-by: John Budorick <jbudorick@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
7 years ago
Edward Lemur d328b47eb1 gclient: Add support for the branch:revision format.
Bug: 850812, 853032
Change-Id: I597acbde2b3c229813b7eba8fcba52d5877130b2
Reviewed-on: https://chromium-review.googlesource.com/1119235
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
7 years ago
Edward Lemur d64781e17a gclient_scm: Fetch refs/changes/* when syncing.
When a git mirror is configured, it fetches only refs/heads/*,
and possibly branch-heads and tags, but not refs/changes.

When gclient attempts to sync refs/changes/* from a mirror,
it fails, since the mirror has no such objects.

See for example [1], where the DEPS entry for builtools was
modified to sync to a CL, but all the bots failed to sync to it.

This change modifies gclient to always fetch refs/changes/*
directly from the repo, even when a mirror is configured.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/1119098/6

Bug: 858894

Change-Id: I71bb313e4325a81b2985db1d00c70a8844dc7c22
Reviewed-on: https://chromium-review.googlesource.com/1119525
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
7 years ago
John Budorick c35aba51d3 gclient: escape cipd variables when flattening DEPS.
crrev.com/c/1097623 broke the official bots because the cipd variable
escaping present in the normal DEPS file wasn't present in the flattened
DEPS file.

Change-Id: Iaae8b95a9d8c5ce0ed80071169e731a24e98b4c4
Reviewed-on: https://chromium-review.googlesource.com/1112935
Commit-Queue: John Budorick <jbudorick@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
7 years ago
Edward Lemur 7ccf2f0c21 gclient: Report what dependencies were not processed.
Report the dependencies that were not synced, due to their, or their parent's
condition evaluating to False.

Bug: 853010
Change-Id: I375703a1b91e3c3e31e444b0df1c95ecae17b6ba
Reviewed-on: https://chromium-review.googlesource.com/1111113
Reviewed-by: Michael Moss <mmoss@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
Andrii Shyshkalov 690d8d437b Revert "gclient_scm: Use cherry-picking instead of rebasing."
This reverts commit c912114140.

Reason for revert: broke patch application on infra/config https://crbug.com/853032

Original change's description:
> gclient_scm: Use cherry-picking instead of rebasing.
> 
> We have a problem when in this situation, we checkout |patch| and rebase it on
> top of |base|, thus including an |extra commit| that we shouldn't.
> 
> o master
> |
> . o patch
> |/
> o extra commit
> |
> o base (what gclient synced src at)
> 
> This does merge-base between |patch| and |master|, and cherry-picks only the
> changes belonging to the patch.
> 
> Bug: 850812
> Change-Id: Id09ae1682e53b69ed49b2fb649310de6a6a8a29e
> Reviewed-on: https://chromium-review.googlesource.com/1098228
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Aaron Gable <agable@chromium.org>

TBR=agable@chromium.org,ehmaldonado@chromium.org

Change-Id: Ib3feeee2f44f5441713383f1dbf08db16fae4717
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 850812, 853032
Reviewed-on: https://chromium-review.googlesource.com/1101977
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
7 years ago
Edward Lemur c912114140 gclient_scm: Use cherry-picking instead of rebasing.
We have a problem when in this situation, we checkout |patch| and rebase it on
top of |base|, thus including an |extra commit| that we shouldn't.

o master
|
. o patch
|/
o extra commit
|
o base (what gclient synced src at)

This does merge-base between |patch| and |master|, and cherry-picks only the
changes belonging to the patch.

Bug: 850812
Change-Id: Id09ae1682e53b69ed49b2fb649310de6a6a8a29e
Reviewed-on: https://chromium-review.googlesource.com/1098228
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
7 years ago
Edward Lemur efe4f897c2 gclient: Add a test to make sure we're syncing CIPD dependencies.
Bug: 849374
Change-Id: I5654ed65843c6dae6b7dbee10a40aa35e16803dc
Reviewed-on: https://chromium-review.googlesource.com/1087390
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
7 years ago
Edward Lemur e7273d2501 Reland "gclient: Get rid of parsed_url."
This is a reland of e877b1776a

Original change's description:
> gclient: Get rid of parsed_url.
>
> There is no reason I can see to set parsed_url so late.
> Also, the tests are misleading, since relative URLs don't behave the way
> the tests led you to believe.
>
> Bug: 839925
> Change-Id: I08d92b7b7847bdc406f003d4a4139d968cc662b1
> Reviewed-on: https://chromium-review.googlesource.com/1047797
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>

TBR=agable@chromium.org

Bug: 839925
Change-Id: I9200ec5fbe7289022e9754f0c78676dc931fcaeb
Reviewed-on: https://chromium-review.googlesource.com/1054567
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: John Budorick <jbudorick@chromium.org>
7 years ago
John Budorick 2191308678 Revert "gclient: Get rid of parsed_url."
Suspected of breaking the world.

This reverts commit e877b1776a.

TBR=ehmaldonado@chromium.org,tandrii@chromium.org
Bug: 841936
Change-Id: Iad2b55a2235d8d0b1a3d7681cbd577f795cb89dd
Reviewed-on: https://chromium-review.googlesource.com/1054440
Reviewed-by: John Budorick <jbudorick@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
7 years ago
Edward Lemur e877b1776a gclient: Get rid of parsed_url.
There is no reason I can see to set parsed_url so late.
Also, the tests are misleading, since relative URLs don't behave the way
the tests led you to believe.

Bug: 839925
Change-Id: I08d92b7b7847bdc406f003d4a4139d968cc662b1
Reviewed-on: https://chromium-review.googlesource.com/1047797
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
7 years ago
Michael Moss 848c86e3e8 Make 'gclient_gn_args*' handling consistent between sync and flatten.
Previously, 'gclient sync' would process "gn_args" settings in any
recursed DEPS files, potentially producing multiple output files or
conflicting output files, but 'gclient flatten' would only ever include
one set of "gn_args" settings in the flattened output, and only if they
occurred in the top-level DEPS file.

This makes 'gclient sync' and 'gclient flatten' more consistent by
restricting them both to a single instance of those setting, and
requiring those setting to be defined either in the top-level DEPS file,
or in a recursedeps file specificed by the new 'gclient_gn_args_from'
setting.

R=dpranke@google.com, ehmaldonado@google.com

Bug: 825063
Change-Id: If90d952e47367c50b36daade16a26b29aec0c9db
Reviewed-on: https://chromium-review.googlesource.com/1039870
Reviewed-by: Michael Moss <mmoss@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Michael Moss <mmoss@chromium.org>
7 years ago
Michael Moss da55cdc03c Apply parent vars to recursedeps.
This fixes an issue where cumulative conditions would fail to evaluate
if the recursed DEP (or custom_var overrides) didn't happen to redeclare
all the variables used by the parent conditions.

TBR=dpranke@google.com, ehmaldonado@google.com

Bug: 825063
Change-Id: Icb53f04928f914dfacc2c3035d01be103d9f8247
Reviewed-on: https://chromium-review.googlesource.com/1000836
Commit-Queue: Michael Moss <mmoss@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Michael Moss <mmoss@chromium.org>
7 years ago
Michael Moss 012013ee59 Add tests and fixes for |None| url values in deps entries.
This is useful for processing purely "local" DEPS files, with a command-line like:
  gclient revinfo --output-json /tmp/out \
    --spec 'solutions=[{"name": ".", "deps_file": "myDEPS", "url": None}]'

This is specifically to fix the "revinfo --output-json" case, but it
also cleans up some errors in the 'flattening' test cases. Note that
None values already work when using 'revinfo' with stdout output, it's
just the json output that complains.

BUG=825063

Change-Id: If5f69ba51cb9d0aa0f2b48a2f9b4ed8706b4c738
Reviewed-on: https://chromium-review.googlesource.com/989022
Commit-Queue: Michael Moss <mmoss@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
7 years ago
Edward Lesmes c621b21ad4 gclient sync: Add support to apply gerrit refs.
Mimics bot_update's functionality to apply gerrit refs in gclient
via --gerrit-ref flags.
When the patch fails to apply, gclient sync will return exit code 2.

The idea is to move this logic from bot_update to gclient sync to
deal when patches for projects like ANGLE are tried on Chromium bots.
This way the patch is applied before recursively parsing and syncing
ANGLE’s DEPS.chromium file, which doesn't currently happen.

Bug: 643346

Change-Id: I7e2018b3c393a5ac9852b8c3611f906977eeeb18
Reviewed-on: https://chromium-review.googlesource.com/961605
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
7 years ago
John Budorick 64e33cba17 Fix gclient flattening of CIPD deps.
Bug: 813460
Change-Id: Ie52a20dcdf5cb60ab47b787dcfa05aa8a712a727
Reviewed-on: https://chromium-review.googlesource.com/926709
Reviewed-by: Michael Moss <mmoss@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: John Budorick <jbudorick@chromium.org>
7 years ago
Michael Moss 42d02c27c1 Make flattened recursedeps inherit parent conditionals.
BUG=783607
R=agable@google.com, dpranke@google.com

Change-Id: I6989203a9e560930cc53254c566275a30d3bead3
Reviewed-on: https://chromium-review.googlesource.com/902168
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Michael Moss <mmoss@chromium.org>
7 years ago
Dirk Pranke 9f20d02085 Do not write gclient_gn_args_file too early.
Previously, gclient would attempt to write an args file after
a dependency was checked out, but before any sub-dependencies
had been checked out. If the args file path pointed at something
inside a sub-dependency, this wouldn't work, because the directory
might not yet exist. This most obviously happened for buildspec
clobber builds.

The fix is to wait until after the sub-dependencies have been
checked out to write the file.

R=phajdan.jr@chromium.org, mmoss@chromium.org
BUG=773933

Change-Id: I0cf4564204f7dabd9f843dc7904db7050fcc0d23
Reviewed-on: https://chromium-review.googlesource.com/714644
Reviewed-by: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
7 years ago
Paweł Hajdan, Jr e0214743cb gclient: add support for native boolean variables
Bug: 570091
Change-Id: I195f5f798d9869f385437db4e0bc5f4c5d4853ae
Reviewed-on: https://chromium-review.googlesource.com/687496
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
8 years ago
Paweł Hajdan, Jr ecf53fecd6 gclient flatten: emit conditions for hooks
Bug: 661382
Change-Id: I0e74273a5e00b4f3cf1d5c22ce0944dc2fa6f31e
Reviewed-on: https://chromium-review.googlesource.com/692934
Reviewed-by: Michael Moss <mmoss@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
8 years ago
Paweł Hajdan, Jr b495bf5017 gclient: evaluate variables before passing them to GN
This helps make sure they have proper types (e.g. True
instead of "True" for booleans).

Also see https://chromium-review.googlesource.com/c/chromium/src/+/681854
for context.

Bug: 756688, 570091
Change-Id: I1e4d26df724e8e94cc3daba361191856f80a1b2c
Reviewed-on: https://chromium-review.googlesource.com/681705
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
8 years ago
Paweł Hajdan, Jr 63b8c2a7e9 gclient: fetch arbitrary refs
Bug: 624178
Change-Id: I7ffbf58441e8762630c3beec642108bcc671aae6
Reviewed-on: https://chromium-review.googlesource.com/647848
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
8 years ago
Paweł Hajdan, Jr adae2a62f7 gclient flatten: correctness fixes for OS-specific recursedeps
We need to pass OS info to recursively called _flatten_dep.
Regular deps entries in OS-specific DEPS file recursed into
need to be marked as OS-specific in the flattened file.

Bug: 570091
Change-Id: If3055b84143d8a52d10d8753113893b5054b4d07
Reviewed-on: https://chromium-review.googlesource.com/621046
Reviewed-by: Michael Moss <mmoss@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
8 years ago
Paweł Hajdan, Jr c69b32e1ea gclient flatten: parse DEPS file for deps_os recursedeps
Bug: 570091
Change-Id: I773b74b042233efa2a525f5f47e920468b7fea4a
Reviewed-on: https://chromium-review.googlesource.com/618930
Reviewed-by: Michael Moss <mmoss@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
8 years ago
Paweł Hajdan, Jr de86ab35fb gclient flatten: also preserve variables in deps_os entries
This is the same change as in https://chromium-review.googlesource.com/c/586594
applied to _DepsOsToLines.

Bug: 570091
Change-Id: I06a4dc3a9b6dbb001a15b1d7b88fef12cf6c6aaa
Reviewed-on: https://chromium-review.googlesource.com/609980
Reviewed-by: Emma Söderberg <emso@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
8 years ago
Paweł Hajdan, Jr 11eb715369 gclient flatten: do not add deps_os entries to deps, even with recursedeps
Bug: 570091
Change-Id: I8e67d617c2738459634aabbffd22135ee5d27cc4
Reviewed-on: https://chromium-review.googlesource.com/609065
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
8 years ago
Paweł Hajdan, Jr e2deb1efa2 gclient flatten: do not recurse into deps that should not be recursed
This finally makes the code structure seem right as well: there's just
one method (_flatten_dep), with a simpler control flow.

Also added a regression test.

Bug: 570091
Change-Id: I22ac7a3af0429a7ffd874b4b1715c0f6c72e0006
Reviewed-on: https://chromium-review.googlesource.com/608241
Reviewed-by: Michael Moss <mmoss@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
8 years ago
Paweł Hajdan, Jr b0ad16ee41 gclient flatten: do not recurse into deps not in recursedeps
Nice side-effect of this change is simplifying the code.

Also added regression test coverage.

Bug: 570091
Change-Id: I470e9efc319632f997b02d210483988c17a7d3c8
Reviewed-on: https://chromium-review.googlesource.com/600369
Reviewed-by: Michael Moss <mmoss@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
8 years ago
Paweł Hajdan, Jr fc6196b306 gclient flatten: preserve variable placeholders (reland #1)
This is an exact reland of https://chromium-review.googlesource.com/583617 .

One of the main use cases is making it clear which revision hashes
need to be changed together. The way it's usually done is one variable
referenced several times. With this CL, we preserve the references
from original DEPS, as opposed to evaluating them and losing some info.

This CL actually makes Var() emit a variable placeholder
instead of its value, and adds support for these placeholders
to gclient.

One of possible next steps might be to deprecate Var().

Bug: 570091, 748486
Change-Id: Id47e3771b7163149a4cd427b84f84ece52772f34
Reviewed-on: https://chromium-review.googlesource.com/586594
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
8 years ago
Paweł Hajdan Jr. 393ba066ef Revert "gclient flatten: preserve variable placeholders"
This reverts commit e79ddeaabf.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=748486

Original change's description:
> gclient flatten: preserve variable placeholders
> 
> One of the main use cases is making it clear which revision hashes
> need to be changed together. The way it's usually done is one variable
> referenced several times. With this CL, we preserve the references
> from original DEPS, as opposed to evaluating them and losing some info.
> 
> This CL actually makes Var() emit a variable placeholder
> instead of its value, and adds support for these placeholders
> to gclient.
> 
> One of possible next steps might be to deprecate Var().
> 
> Bug: 570091
> Change-Id: I9b13a691b5203cc284c33a59438720e31c9ebf7a
> Reviewed-on: https://chromium-review.googlesource.com/583617
> Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>

TBR=phajdan.jr@chromium.org,dpranke@chromium.org

Change-Id: If9c52ebfa78aba8041ce797ff842d09952d0e2ce
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 570091, 748486
Reviewed-on: https://chromium-review.googlesource.com/584907
Reviewed-by: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
8 years ago
Paweł Hajdan, Jr e79ddeaabf gclient flatten: preserve variable placeholders
One of the main use cases is making it clear which revision hashes
need to be changed together. The way it's usually done is one variable
referenced several times. With this CL, we preserve the references
from original DEPS, as opposed to evaluating them and losing some info.

This CL actually makes Var() emit a variable placeholder
instead of its value, and adds support for these placeholders
to gclient.

One of possible next steps might be to deprecate Var().

Bug: 570091
Change-Id: I9b13a691b5203cc284c33a59438720e31c9ebf7a
Reviewed-on: https://chromium-review.googlesource.com/583617
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
8 years ago
Paweł Hajdan, Jr 357415cb11 gclient flatten: fix a bug with some recursedeps not being processed
Added a regression test. Simplified some logic - if we don't add os-specific
deps and hooks to |dependencies|, we don't need to keep separate original values.

Bug: 570091
Change-Id: I5bdd0b6a66df6b3a2b99d0ad9c6e54ee7114f09b
Reviewed-on: https://chromium-review.googlesource.com/581687
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Michael Moss <mmoss@chromium.org>
8 years ago
Paweł Hajdan, Jr c6846aa200 gclient flatten: fix a bug with deps_os getting omitted for recursed deps
Bug: 570091
Change-Id: I4fac33ca683ff2011fa7307d5175592f3d9e258e
Reviewed-on: https://chromium-review.googlesource.com/560171
Reviewed-by: Michael Moss <mmoss@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
8 years ago