Forráskód Böngészése

enable fetch and gclient to run on z/OS part 1

See https://issues.chromium.org/issues/323790693#comment12 for the manual steps still required.

R=gavinmak@google.com

Bug: 323790693
Change-Id: Id0ac2d8a6027cbb5e0554574471c160d5fae807c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5277474
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Gaby Baghdadi 1 éve
szülő
commit
9d64acedea
6 módosított fájl, 13 hozzáadás és 2 törlés
  1. 6 0
      cipd
  2. 2 0
      detect_host_arch.py
  3. 1 0
      download_from_google_storage.py
  4. 2 0
      gclient.py
  5. 1 1
      gclient_utils.py
  6. 1 1
      gsutil.py

+ 6 - 0
cipd

@@ -6,6 +6,12 @@
 
 
 set -e -o pipefail
 set -e -o pipefail
 
 
+# Run custom-built cipd client. This is useful when cipd is not available upstream
+# (i.e. unsupported platform).
+if [ ! -z "${CUSTOM_CIPD_CLIENT}" ]; then
+  exec "${CUSTOM_CIPD_CLIENT}" "${@}"
+fi
+
 # Export for other depot_tools scripts to re-use.
 # Export for other depot_tools scripts to re-use.
 export DEPOT_TOOLS_DIR="${DEPOT_TOOLS_DIR:-$(dirname "${BASH_SOURCE[0]}")}"
 export DEPOT_TOOLS_DIR="${DEPOT_TOOLS_DIR:-$(dirname "${BASH_SOURCE[0]}")}"
 export DEPOT_TOOLS_UNAME_S="${DEPOT_TOOLS_UNAME_S:-$(uname -s | tr '[:upper:]' '[:lower:]')}"
 export DEPOT_TOOLS_UNAME_S="${DEPOT_TOOLS_UNAME_S:-$(uname -s | tr '[:upper:]' '[:lower:]')}"

+ 2 - 0
detect_host_arch.py

@@ -34,6 +34,8 @@ def HostArch():
         host_arch = 's390'
         host_arch = 's390'
     elif host_arch.startswith('riscv'):
     elif host_arch.startswith('riscv'):
         host_arch = 'riscv64'
         host_arch = 'riscv64'
+    elif platform.system() == 'OS/390':
+        host_arch = 's390x'
 
 
     if host_arch == 'arm64':
     if host_arch == 'arm64':
         host_platform = platform.architecture()
         host_platform = platform.architecture()

+ 1 - 0
download_from_google_storage.py

@@ -35,6 +35,7 @@ PLATFORM_MAPPING = {
     'win32': 'win',
     'win32': 'win',
     'aix6': 'aix',
     'aix6': 'aix',
     'aix7': 'aix',
     'aix7': 'aix',
+    'zos': 'zos',
 }
 }
 
 
 
 

+ 2 - 0
gclient.py

@@ -1536,6 +1536,7 @@ _PLATFORM_MAPPING = {
     'linux': 'linux',
     'linux': 'linux',
     'win32': 'win',
     'win32': 'win',
     'aix6': 'aix',
     'aix6': 'aix',
+    'zos': 'zos',
 }
 }
 
 
 
 
@@ -1624,6 +1625,7 @@ class GClient(GitDependency):
         "ios": "ios",
         "ios": "ios",
         "fuchsia": "fuchsia",
         "fuchsia": "fuchsia",
         "chromeos": "chromeos",
         "chromeos": "chromeos",
+        "zos": "zos",
     }
     }
 
 
     DEFAULT_CLIENT_FILE_TEXT = ("""\
     DEFAULT_CLIENT_FILE_TEXT = ("""\

+ 1 - 1
gclient_utils.py

@@ -632,7 +632,7 @@ def CheckCallAndFilter(args,
         # subprocess when filtering its output. This makes the subproc believe
         # subprocess when filtering its output. This makes the subproc believe
         # it was launched from a terminal, which will preserve ANSI color codes.
         # it was launched from a terminal, which will preserve ANSI color codes.
         os_type = GetOperatingSystem()
         os_type = GetOperatingSystem()
-        if sys.stdout.isatty() and os_type != 'win' and os_type != 'aix':
+        if sys.stdout.isatty() and os_type not in ['win', 'aix', 'zos']:
             pipe_reader, pipe_writer = os.openpty()
             pipe_reader, pipe_writer = os.openpty()
         else:
         else:
             pipe_reader, pipe_writer = os.pipe()
             pipe_reader, pipe_writer = os.pipe()

+ 1 - 1
gsutil.py

@@ -37,7 +37,7 @@ LUCI_AUTH_SCOPES = [
 
 
 
 
 # Platforms unsupported by luci-auth.
 # Platforms unsupported by luci-auth.
-LUCI_AUTH_UNSUPPORTED_PLATFORMS = ['aix']
+LUCI_AUTH_UNSUPPORTED_PLATFORMS = ['aix', 'zos']
 
 
 
 
 class InvalidGsutilError(Exception):
 class InvalidGsutilError(Exception):