Logs a warning if reading the config fails. Still logs a warning for
recommended settings, so the user can create their global config.
Annoyingly, the exit code is the same for missing config file as it is
for an existing but invalid file.
Bug: b/382395049
Change-Id: I81113ff248f7a5eed2f9fd0303e0e81ae80d7d3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6086756
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Anne Redulla <aredulla@google.com>
In git 2.41, both `list` and `unset` are only options, `--list` and `--unset` respectively. See https://git-scm.com/docs/git-config/2.41.0
These modes are deprecated in later versions; it is recommended to
migrate to the newer syntax, but the old syntax is still supported.
Bug: b/382395049
Change-Id: I9150983084b91279e4f4587a80737e6813937cd6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6083215
Commit-Queue: Anne Redulla <aredulla@google.com>
Reviewed-by: Peter Boström <pbos@chromium.org>
Owners-Override: Anne Redulla <aredulla@google.com>
The Windows global Git config bootstrapping shows a warning if you have
not agreed to depot_tools automatically managing your global Git config.
To silence this warning, a user must either:
(1) explicitly allow to automatic management; or
(2) explicitly deny automatic management.
This CL adds a third way to prevent the warning:
(3) The existing global Git config already has the desired values.
Consequently, depot-tools.gitPostprocessVersion is redundant
and has been removed.
Bug: b/382395049
Change-Id: I18260962ee9647578e61993b191e9f76e99b342b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6072987
Commit-Queue: Anne Redulla <aredulla@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Git has been using version 2 of their wire protocol by default since
2.26, released in 2020. Stop setting it explicitely.
Change-Id: Ibc93a672b41c5a8183bc3200c506006f6e08af94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6070782
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Modifying the system-level Git config may require admin privileges,
depending on where Git was installed.
This CL makes the bootstrap.py script target a user's Git config
at the global level, instead of system level.
Checks the global Git config for postprocess version and explicit
enabling of global config changing. Logs a warning if out of date
and not enabled so the user knows how to agree to global config
changes.
Bug: b/379888465, b/360206460
Change-Id: I9be395b64d5429f85514397918f4a6140dfe2a1a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6034204
Reviewed-by: Allen Li <ayatane@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Anne Redulla <aredulla@google.com>
By default it's false and the bundled git is used.
Bug: b/379888465
Change-Id: I7d3d91da2ade6534d5b80479a050d6f608c16b2e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6033861
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Anne Redulla <aredulla@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Enhanced the function to use a try-catch block around os.path.commonpath
to gracefully handle cases where file paths are located on different drives.
This ensures compatibility and prevents errors related to drive differences.
R=aredulla@google.com, ayatane@chromium.org, sokcevic@chromium.org
Bug: b/360206460
Change-Id: Iee51ba282fd85d211194d8678765a72783727db5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6018123
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
With this change, python2[.bat] will no longer be available in
depot_tools root. vpython continues to work.
Bug: 1376538
Change-Id: Iabe22e4e33d0d79d258068c90128da8de4d3ece1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5170265
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Brian Ryner <bryner@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Leave the recipes/ code at 2 space to match the rest of the recipes
project in other repos.
Reformatted using:
files=( $(
git ls-tree -r --name-only HEAD | \
grep -Ev -e '^(third_party|recipes)/' | \
grep '\.py$';
git grep -l '#!/usr/bin/env.*python' | grep -v '\.py$'
) )
parallel ./yapf -i -- "${files[@]}"
~/chromiumos/chromite/contrib/reflow_overlong_comments "${files[@]}"
The files that still had strings that were too long were manually
reformatted because they were easy and only a few issues.
autoninja.py
clang_format.py
download_from_google_storage.py
fix_encoding.py
gclient_utils.py
git_cache.py
git_common.py
git_map_branches.py
git_reparent_branch.py
gn.py
my_activity.py
owners_finder.py
presubmit_canned_checks.py
reclient_helper.py
reclientreport.py
roll_dep.py
rustfmt.py
siso.py
split_cl.py
subcommand.py
subprocess2.py
swift_format.py
upload_to_google_storage.py
These files still had lines (strings) that were too long, so the pylint
warnings were suppressed with a TODO.
auth.py
gclient.py
gclient_eval.py
gclient_paths.py
gclient_scm.py
gerrit_util.py
git_cl.py
presubmit_canned_checks.py
presubmit_support.py
scm.py
Change-Id: Ia6535c4f2c48d46b589ec1e791dde6c6b2ea858f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4836379
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
This reverts commit 0e8b3107e0.
Reason for revert: wrappers aren't being created in python2-bin, other disruptions
Original change's description:
> Remove py batch wrappers from root dir
>
> This removes python.bat and python3.bat batch wrappers from root of this
> repository. This change brings Windows set up closer to unix.
>
> depot_tools provides batch wrappers in python-bin and python2-bin
> directories and user can opt in to use it by adding them to PATH.
>
> Bug: 777069
> Change-Id: Ie7571a49f940e7a69b6c18779499c39aee94d06a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2742181
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@google.com>
> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Bug: 777069
Change-Id: Ieaadb032249fa5d6eea39668355c0c7de06dfbeb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2747702
Auto-Submit: Dirk Pranke <dpranke@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
This removes python.bat and python3.bat batch wrappers from root of this
repository. This change brings Windows set up closer to unix.
depot_tools provides batch wrappers in python-bin and python2-bin
directories and user can opt in to use it by adding them to PATH.
Bug: 777069
Change-Id: Ie7571a49f940e7a69b6c18779499c39aee94d06a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2742181
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
pythond and python3 are still downloaded from cipd, but python3 is no longer shim'd into
depot_tools on Linux, so is not available on PATH.
Modify PATH in vpython and vpython3 on Linux to point to the python3 download directory,
so that the version downloaded from cipd is used.
Bug: 1017812
Change-Id: I70bc8e7d460f60dcbfa5e141127edecfc2b44744
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1893982
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Anthony Polito <apolito@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
This fixes an error on some Windows installations:
```
fetch webrtc
Traceback (most recent call last):
File "googlesource.com\depot_tools\bootstrap\bootstrap.py", line 365, in <module>
sys.exit(main(sys.argv[1:]))
File "googlesource.com\depot_tools\bootstrap\bootstrap.py", line 324, in main
git_postprocess(template, os.path.join(bootstrap_dir, 'git'))
File "googlesource.com\depot_tools\bootstrap\bootstrap.py", line 264, in git_postprocess
maybe_copy(
File "googlesource.com\depot_tools\bootstrap\bootstrap.py", line 108, in maybe_copy
content = fd.read()
File "googlesource.com\depot_tools\bootstrap-3_8_0b1_chromium_1_bin\python3\bin\lib\encodings\cp1251.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 18734: character maps to <undefined>
```
Bug: None
Change-Id: I43cf7b51879ac9a66c33566536dcdcb4c93e0fc0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1881227
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Don't call ensure_bootstrap from update_depot_tools.
ensure_bootstrap also updates gsutil and all versions of pylint
which is slow, particularly on MinGW.
Original change's description:
> depot_tools: Bootstrap Python 3 on Linux/Mac
>
> This will make it possible for developers to execute depot_tools
> scripts using Python 3 in a known environment.
>
> Bug: 1002153
> Change-Id: I5ff492a49d227c1b5876f49adba020f51a575bdd
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1762664
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Bug: 1002153
Change-Id: Ia7579e440438897ba4a7c65a8b228dcfe7f28c86
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1810040
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This reverts commits 0e85f633c7 and 9d25ad4192.
Reason for revert:
Causes problems for MinGW users.
Original change's description:
> Reland "depot_tools: Bootstrap Python 3 on Linux/Mac"
>
> This is a reland of dbca865e55
>
> Original change's description:
> > depot_tools: Bootstrap Python 3 on Linux/Mac
> >
> > This will make it possible for developers to execute depot_tools
> > scripts using Python 3 in a known environment.
> >
> > Bug: 1002153
> > Change-Id: I5ff492a49d227c1b5876f49adba020f51a575bdd
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1762664
> > Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> > Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> > Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
>
> Bug: 1002153
> Change-Id: I6938a76ffa05366c21f7c56aed3d07ecb2b84443
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1798845
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
TBR=iannucci@chromium.org,dpranke@chromium.org,tandrii@google.com,ehmaldonado@chromium.org
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: 1002153
Change-Id: I3ee87b95b2532ec694d7f4f87cce8cde8ccf86eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1808137
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This is a reland of dbca865e55
Original change's description:
> depot_tools: Bootstrap Python 3 on Linux/Mac
>
> This will make it possible for developers to execute depot_tools
> scripts using Python 3 in a known environment.
>
> Bug: 1002153
> Change-Id: I5ff492a49d227c1b5876f49adba020f51a575bdd
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1762664
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Bug: 1002153
Change-Id: I6938a76ffa05366c21f7c56aed3d07ecb2b84443
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1798845
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This reverts commit dbca865e55.
Reason for revert:
Fails on Mac
$ gclient sync --with_branch_heads
awk: syntax error at source line 1
context is
match($0, >>> /cpython3\/.*version:([.0-9a-zA-Z]+)/, <<<
awk: bailing out at source line 1
Could not extract Python 3 version from manifest.
Original change's description:
> depot_tools: Bootstrap Python 3 on Linux/Mac
>
> This will make it possible for developers to execute depot_tools
> scripts using Python 3 in a known environment.
>
> Bug: 1002153
> Change-Id: I5ff492a49d227c1b5876f49adba020f51a575bdd
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1762664
> Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
TBR=iannucci@chromium.org,dpranke@chromium.org,tandrii@google.com,ehmaldonado@chromium.org
Change-Id: I8e03a9e22655491d0f8e8d214d04ba749c2ab8ab
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1002153
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1797197
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This will make it possible for developers to execute depot_tools
scripts using Python 3 in a known environment.
Bug: 1002153
Change-Id: I5ff492a49d227c1b5876f49adba020f51a575bdd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1762664
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@google.com>
Reason for revert:
This CL over-aggressively removed the Windows bootstrap code used by /gclient.bat, which in turn downloads/installs the Windows toolchain, including Python. Labs can no longer provision Windows bots because of this.
update_depot_tools.bat did more than initialize the virtualenv. It also downloaded and installed Python, Git, and Subversion on Windows systems.
I'm reverting to restore the toolchain so we can create new Windows bots.
Original issue's description:
> Removed virtualenv from depot_tools
>
> This effectively reverts http://crrev.com/1195423002 and
> http://crrev.com/1205873002.
>
> R=pgervais@chromium.org, tandrii@chromium.org
> TBR=pgervais@chromium.org # i wanna get my Fixit credit today :-)
> BUG=542922,503067
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=297491
TBR=pgervais@chromium.org,tandrii@chromium.org,sergiyb@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=542922,503067
Review URL: https://codereview.chromium.org/1431173002 .
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@297493 0039d316-1c4b-4281-b951-d872f2087c98
The activate_end method is used in infra/bootstrap/build_deps.py, which doesn't
pass the value for this parameter.
R=pgervais@chromium.org
BUG=503067
Review URL: https://codereview.chromium.org/1213113002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@295893 0039d316-1c4b-4281-b951-d872f2087c98