Procházet zdrojové kódy

Revert "Delete vpython, leaving only vpython3."

This reverts commit db0dcbbe7c7587500f5299186f5a559286e42a4f.

Reason for revert: `gclient sync` no longer works on my local checkout with this change due to the error `No such file or directory: 'vpython'.`.

Original change's description:
> Delete vpython, leaving only vpython3.
>
> Bug: 1376538
> Change-Id: Ia7795f75fd05db63f155c5feffcc43822fb45bb1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5187892
> Reviewed-by: Mike Frysinger <vapier@chromium.org>
> Commit-Queue: Brian Ryner <bryner@google.com>
> Reviewed-by: George Engelbrecht <engeg@google.com>
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
> Reviewed-by: Chenlin Fan <fancl@chromium.org>

Bug: 1376538
Change-Id: I7c32eea1f8ae07644ab81a35213de5c68c64dfb6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5260042
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Andy Perelson <ajp@chromium.org>
Commit-Queue: Brian Ryner <bryner@google.com>
Reviewed-by: Brian Ryner <bryner@google.com>
Rupert Wiser před 1 rokem
rodič
revize
af6eabff53
8 změnil soubory, kde provedl 178 přidání a 37 odebrání
  1. 76 0
      .vpython
  2. 1 1
      cipd_manifest.txt
  3. 30 30
      cipd_manifest.versions
  4. 1 1
      gn.py
  5. 4 4
      presubmit_canned_checks.py
  6. 1 1
      presubmit_support.py
  7. 56 0
      vpython
  8. 9 0
      vpython.bat

+ 76 - 0
.vpython

@@ -0,0 +1,76 @@
+python_version: "2.7"
+
+# The default set of platforms vpython checks for does not yet include mac-arm64.
+# Setting `verify_pep425_tag` to the list of platforms we explicitly must support
+# allows us to ensure that vpython specs stay mac-arm64-friendly
+verify_pep425_tag: [
+    {python: "cp27", abi: "cp27mu", platform: "manylinux1_x86_64"},
+    {python: "cp27", abi: "cp27mu", platform: "linux_arm64"},
+    {python: "cp27", abi: "cp27mu", platform: "linux_armv6l"},
+
+    {python: "cp27", abi: "cp27m", platform: "macosx_10_10_intel"},
+    {python: "cp27", abi: "cp27m", platform: "macosx_11_0_arm64"},
+
+    {python: "cp27", abi: "cp27m", platform: "win32"},
+    {python: "cp27", abi: "cp27m", platform: "win_amd64"}
+]
+
+# Used by:
+#   auth.py
+#   gerrit_util.py
+#   git_cl.py
+#   my_activity.py
+#   TODO(crbug.com/1002153): Add ninjalog_uploader.py
+wheel: <
+  name: "infra/python/wheels/httplib2-py2_py3"
+  version: "version:0.10.3"
+>
+
+# Used by:
+#    presubmit_support.py
+wheel: <
+  name: "infra/python/wheels/requests-py2_py3"
+  version: "version:2.13.0"
+>
+
+# Used by:
+#   my_activity.py
+wheel: <
+  name: "infra/python/wheels/python-dateutil-py2_py3"
+  version: "version:2.7.3"
+>
+wheel: <
+  name: "infra/python/wheels/six-py2_py3"
+  version: "version:1.10.0"
+>
+
+# Used by:
+#   tests/auth_test.py
+#   tests/detect_host_arch_test.py
+#   tests/gclient_scm_test.py
+#   tests/gclient_test.py
+#   tests/gclient_utils_test.py
+#   tests/gerrit_util_test.py
+#   tests/git_cl_test.py
+#   tests/git_footers_test.py
+#   tests/metrics_test.py
+#   tests/presubmit_unittest.py
+#   tests/scm_unittest.py
+#   tests/subprocess2_test.py
+#   tests/watchlists_unittest.py
+wheel: <
+  name: "infra/python/wheels/mock-py2_py3"
+  version: "version:2.0.0"
+>
+wheel <
+  name: "infra/python/wheels/funcsigs-py2_py3"
+  version: "version:1.0.2"
+>
+wheel: <
+  name: "infra/python/wheels/pbr-py2_py3"
+  version: "version:3.0.0"
+>
+wheel: <
+  name: "infra/python/wheels/six-py2_py3"
+  version: "version:1.10.0"
+>

+ 1 - 1
cipd_manifest.txt

@@ -36,7 +36,7 @@ $VerifiedPlatform linux-armv6l linux-mips64 linux-mips64le linux-mipsle
 $VerifiedPlatform windows-arm64
 
 # vpython.
-infra/tools/luci/vpython3/${platform} git_revision:0c1a41fa62950eedcaaee58ba7268d3813871e3f
+infra/tools/luci/vpython/${platform} git_revision:0c1a41fa62950eedcaaee58ba7268d3813871e3f
 
 # LUCI editor
 infra/tools/luci/led/${platform} git_revision:2d4970c1db4df5cf1cc11355326729c3f8e37407

+ 30 - 30
cipd_manifest.versions

@@ -385,65 +385,65 @@ infra/tools/luci/lucicfg/windows-arm64
 	git_revision:2030482b389cfda6a33ad0933e9930a31fd464d9
 	raX63RnJo4onr95ttCc3Iw4yEs6MsRueuQfj1JshPq4C
 
-infra/tools/luci/vpython3/linux-386
+infra/tools/luci/vpython/linux-386
 	git_revision:0c1a41fa62950eedcaaee58ba7268d3813871e3f
-	LSv2jnsr-7v4iNnqY-2lMmBB6ZiXyNYY8lURAhZUH0AC
+	5XCEuCpKo96l0GAWvnWB4Uog0AeIrrLBOdf020hgygQC
 
-infra/tools/luci/vpython3/linux-amd64
+infra/tools/luci/vpython/linux-amd64
 	git_revision:0c1a41fa62950eedcaaee58ba7268d3813871e3f
-	ovQwRDoJhNqOV-iyKA8FjywcIA-Gd6vaxMKIKovJ2mAC
+	gFBKqINUZLiOlRuph3Mo60hBjCxH7b2bX_k1YNMsnzMC
 
-infra/tools/luci/vpython3/linux-arm64
+infra/tools/luci/vpython/linux-arm64
 	git_revision:0c1a41fa62950eedcaaee58ba7268d3813871e3f
-	WsoR8xIDVlJzgQHaamyGOPpb22YlX3sbyij2DvjOBQoC
+	KHuy2LO9GIrcL0Ke1cV_esAKwRjN4C5OyQ6nudgGphwC
 
-infra/tools/luci/vpython3/linux-armv6l
+infra/tools/luci/vpython/linux-armv6l
 	git_revision:0c1a41fa62950eedcaaee58ba7268d3813871e3f
-	99in3dAtvzqeHwIwF02MAEfiB-G9iWO53v342Lq4oFYC
+	mQ8bSGK04iiCYuHiMT2s1OUSosLqm1CRWaH9u9VczFQC
 
-infra/tools/luci/vpython3/linux-mips64
+infra/tools/luci/vpython/linux-mips64
 	git_revision:0c1a41fa62950eedcaaee58ba7268d3813871e3f
-	HpevxOS1AcbxWanSSLHQzhZ-sSPUSqnirLmpdeSwsooC
+	w6cB-w0SMWla2sYWa3SnjymPJevF43BJ1Rluaec3HXMC
 
-infra/tools/luci/vpython3/linux-mips64le
+infra/tools/luci/vpython/linux-mips64le
 	git_revision:0c1a41fa62950eedcaaee58ba7268d3813871e3f
-	exAC5qVd221Hlr3pcBqiERuVLMZ0vA1etWI1isTJVNsC
+	RazW56TFJk8EZAzTau1qppjABIoaryE16gjkTo8ljUMC
 
-infra/tools/luci/vpython3/linux-mipsle
+infra/tools/luci/vpython/linux-mipsle
 	git_revision:0c1a41fa62950eedcaaee58ba7268d3813871e3f
-	63XWHf_tz8JZXTP-XZkz5FejfvsIHJeN1C4wmUzyu4AC
+	QMZQG8XxzdH11d8YFP2TRPzRBOCV9we5FaM63oI3ZDoC
 
-infra/tools/luci/vpython3/linux-ppc64
+infra/tools/luci/vpython/linux-ppc64
 	git_revision:0c1a41fa62950eedcaaee58ba7268d3813871e3f
-	4TDNfR1iO2d8Mpebe-ionhGhttE8ynOLQXtYQ20yoSMC
+	c7cyFyzoPItwI86hvB7ACZ16jtBV-v1Pq5gQk_teq5cC
 
-infra/tools/luci/vpython3/linux-ppc64le
+infra/tools/luci/vpython/linux-ppc64le
 	git_revision:0c1a41fa62950eedcaaee58ba7268d3813871e3f
-	Pk7m7LyigjgNX0iBqflIUan5eDdRRqr_3imS2i94tmsC
+	HWdIhJ0mDYFzpyIZqYGM9NgBtV7dTzoCUMaPEA9gvy4C
 
-infra/tools/luci/vpython3/linux-riscv64
+infra/tools/luci/vpython/linux-riscv64
 	git_revision:0c1a41fa62950eedcaaee58ba7268d3813871e3f
-	dLLb1rYCVIWgsPoyfT5REVspsSqySTBTX5ZK2vFrc_0C
+	e9qGcT3OxmsubATYdd-fxaxc3sEmdc-GKgYWS_twFnMC
 
-infra/tools/luci/vpython3/linux-s390x
+infra/tools/luci/vpython/linux-s390x
 	git_revision:0c1a41fa62950eedcaaee58ba7268d3813871e3f
-	VDNw9r3hA4B2PCki0MtNvIzLfgr0WkT2O8G3g7zXelgC
+	q3latzYdJnhbPnze0sij4bLShocNICeNGYJ7FR1272kC
 
-infra/tools/luci/vpython3/mac-amd64
+infra/tools/luci/vpython/mac-amd64
 	git_revision:0c1a41fa62950eedcaaee58ba7268d3813871e3f
-	qUCWlve2bacyVNcoN-S21GKpkdPRxP2kZP4ygP6gMLoC
+	mlSOx-jy8Ntrh98cOZTcgQN6RrWXm5tBxKWDxhxrNVwC
 
-infra/tools/luci/vpython3/mac-arm64
+infra/tools/luci/vpython/mac-arm64
 	git_revision:0c1a41fa62950eedcaaee58ba7268d3813871e3f
-	YPPISxeZPIZRSLolAuJo8SqomP4bWT2yw-jWdcy8Y_wC
+	DgWwOCjBqH9Nc2LRLFbTZ9JTwHlwcwT7esanwSCbBAAC
 
-infra/tools/luci/vpython3/windows-amd64
+infra/tools/luci/vpython/windows-amd64
 	git_revision:0c1a41fa62950eedcaaee58ba7268d3813871e3f
-	jUkfILL7JKj_4n84BaPvMBOkok-Iu9_hgMFLkEif50QC
+	oluqkEWDxYtHzDCkIUl9840g6Ix8qBncMVmtu8yOplkC
 
-infra/tools/luci/vpython3/windows-arm64
+infra/tools/luci/vpython/windows-arm64
 	git_revision:0c1a41fa62950eedcaaee58ba7268d3813871e3f
-	EZ2JiY1_lNSKS-Lb_z9Iev_mKkJFekhQC0h2-DY8DwEC
+	yTXSPAek0nBC9yzj06d7DtQZIbNV9EKCEakVxSmHAIYC
 
 infra/tools/mac_toolchain/mac-amd64
 	git_revision:05fe195bf77656743f3daa99d463a794260b429b

+ 1 - 1
gn.py

@@ -55,7 +55,7 @@ def main(args):
     # Invocations of `python` from GN should never inherit the gn.py's own
     # VirtualEnv. This also helps to ensure that generated ninja files do not
     # reference python.exe from the VirtualEnv generated from depot_tools' own
-    # .vpython3 file (or lack thereof), but instead reference the default python
+    # .vpython file (or lack thereof), but instead reference the default python
     # from the PATH.
     PruneVirtualEnv()
 

+ 4 - 4
presubmit_canned_checks.py

@@ -1355,8 +1355,8 @@ def GetPylint(input_api,
         kwargs = {'env': env}
         if input_api.platform == 'win32':
             # On Windows, scripts on the current directory take precedence over
-            # PATH. When `pylint.bat` calls `vpython3`, it will execute the
-            # `vpython3` of the depot_tools under test instead of the one in the
+            # PATH. When `pylint.bat` calls `vpython`, it will execute the
+            # `vpython` of the depot_tools under test instead of the one in the
             # bot. As a workaround, we run the tests from the parent directory
             # instead.
             cwd = input_api.change.RepositoryRoot()
@@ -2079,8 +2079,8 @@ def CheckVPythonSpec(input_api, output_api, file_filter=None):
         output_api: Bag of output related interfaces.
         file_filter: Custom function that takes a path (relative to client root) and
             returns boolean, which is used to filter files for which to apply the
-            verification to. Defaults to any path ending with .vpython(3), which captures
-            both global .vpython(3) and <script>.vpython(3) files.
+            verification to. Defaults to any path ending with .vpython, which captures
+            both global .vpython and <script>.vpython files.
 
     Returns:
         A list of input_api.Command objects containing verification commands.

+ 1 - 1
presubmit_support.py

@@ -195,7 +195,7 @@ class ThreadPool(object):
 
         # On Windows, scripts on the current directory take precedence over
         # PATH, so that when testing depot_tools on Windows, calling
-        # `vpython3.bat` will execute the copy of vpython of the depot_tools
+        # `vpython.bat` will execute the copy of vpython of the depot_tools
         # under test instead of the one in the bot. As a workaround, we run the
         # tests from the parent directory instead.
         if (cmd[0] == vpython and 'cwd' in test.kwargs

+ 56 - 0
vpython

@@ -0,0 +1,56 @@
+#!/usr/bin/env bash
+
+# Copyright 2018 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# See revert instructions in cipd_manifest.txt
+
+if [[ $VPYTHON_BYPASS == "manually managed python not supported by chrome operations" ]]
+then
+  NEWARGS=()
+  while [[ $# -gt 0 ]]
+  do
+    case "$1" in
+      -vpython-tool*) # these tools all do something vpython related and quit
+        exit 0
+        ;;
+      -vpython*=*) # delete any vpython-specific flag (w/ attached argument)
+        shift
+        ;;
+      -vpython*) # delete any vpython-specific flag (w/ separate argument)
+        shift
+        shift
+        ;;
+      --)     # stop parsing
+        NEWARGS+=( "$@" )
+        break
+        ;;
+      *)      # regular arg
+        NEWARGS+=( "$1" )
+        shift
+        ;;
+    esac
+  done
+  exec "python" "${NEWARGS[@]}"
+fi
+
+# Export for other depot_tools scripts to re-use.
+export DEPOT_TOOLS_DIR="${DEPOT_TOOLS_DIR:-$(dirname "$0")}"
+export DEPOT_TOOLS_UNAME_S="${DEPOT_TOOLS_UNAME_S:-$(uname -s | tr '[:upper:]' '[:lower:]')}"
+
+source "${DEPOT_TOOLS_DIR}/cipd_bin_setup.sh"
+cipd_bin_setup &> /dev/null
+
+# Don't pass this to the Python script as it might turn around and run commands
+# in other depot_tools dirs.
+base_dir="${DEPOT_TOOLS_DIR}"
+unset DEPOT_TOOLS_DIR
+case "${DEPOT_TOOLS_UNAME_S}" in
+mingw*|cygwin*)
+  cmd.exe //c $0.bat "$@"
+  ;;
+*)
+  exec "${base_dir}/.cipd_bin/vpython" "$@"
+  ;;
+esac

+ 9 - 0
vpython.bat

@@ -0,0 +1,9 @@
+@echo off
+:: Copyright 2017 The Chromium Authors. All rights reserved.
+:: Use of this source code is governed by a BSD-style license that can be
+:: found in the LICENSE file.
+
+:: See revert instructions in cipd_manifest.txt
+
+call "%~dp0\cipd_bin_setup.bat" > nul 2>&1
+"%~dp0\.cipd_bin\vpython.exe" %*