pwsh, cmd and powershell interoperability breaks `Get-FileHash` cmdlet
which is used in .cipd_impl.ps1. The issue prevents loading of correct
PowerShell module due to how $PSModulePath is structured in some cases.
With this CL, we always import the compatible module at the beginning
of the script. This ensures Get-FileHash is always available to us
regardless of the PowerShell version being used.
Bug: 1443163
Change-Id: I117e5077239c5371bb392b36b521671095029abf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4506722
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Adam Todd <actodd@google.com>
Auto-Submit: Tushar Singh <tusharvickey1999@gmail.com>
This changes cipd_impl.ps1 to work with "Constrained Language Mode",
just using built in powershell utils. This also now has a
substantially simpler implementation.
A lost feature here is that multiple cipd_impl invocations would
serialize... however this required using System functions which
don't work in Constrained Language Mode. The new impl goes for
an eventually consistent approach; Each invocation of the script
will use a tempfile with a unique name, and will move it into
place after downloading if the file hash matches.
In the cold start &&& higly parallel case, this could cause multiple
downloads, but the eventual state will be consistent.
R=actodd, alexschulze, fancl, vadimsh
Bug: 1442051
Change-Id: I4e7a808eb60654d96fe7f20f36b642e8792b4193
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4507643
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
This actually updates the CIPD client to a version that has
a windows-arm64 build, as well as modifies the bootstrap script
to support multiple possible Windows platforms (which is very
similar to what was done to support mac-arm64 on OSX).
By default windows-amd64 is still used everywhere, even on arm64 OS.
To opt-in into windows-arm64, create a file .cipd_client_platform
under depot_tools directory with a single line "windows-arm64".
The bootstrap script now recognizes this file (if it exists) and
rebootstraps the CIPD client if the platform changes. Since this
check needs to happen on every CIPD invocation, it is done in
the batch file, to avoid hitting relatively heavy Powershell on
the hot path.
Finally, do some minor style cleanup in the powershell script to
make it look more consistent.
CIPD client change log:
9cc9fd49..5252f4fc7/cipd
R=bryner@google.com
Change-Id: I4fe5c4ea5e0b5cbb43e7b8c4702dc9fb0627c056
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4153336
Reviewed-by: Brian Ryner <bryner@google.com>
Commit-Queue: Vadim Shtayura <vadimsh@chromium.org>
Transient network conditions can cause the CIPD client download to fail,
so add a retry to the download.
As part of adding the retry, also extracted the download code to its own
function to ensure the WebClient is disposed promptly.
Bug: 1145741
Change-Id: I66bb5cde7ec4f637dd1161252c2b096af6abb8a8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2519730
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
An external developer reported that gclient sync fails on Windows 8.1
unless TLS 1.2 is explicitly enabled. This allows that security protocol
and prints a more detailed error message on failures.
Change-Id: I07ab832d4f922264a1ee1890f9b71949a313a7ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2480605
Commit-Queue: Anthony Polito <apolito@google.com>
Reviewed-by: Anthony Polito <apolito@google.com>
Having it in %PATH% means that powershell users will accidentally
run 'cipd.ps1' when they should be running 'cipd.bat'; This would
cause them to get requests for input parameters (like the backend URL)
which they have no idea how to supply.
R=agable@chromium.org, nodir@chromium.org, vadimsh@google.com
Bug: 1073529
Change-Id: I62a3bd9e00229a2047293dba1ba480d28f77bf63
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2161645
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>