about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKristofer Rye <kristofer.rye@gmail.com>2020-07-17 08:44:14 -0500
committerKristofer Rye <kristofer.rye@gmail.com>2020-07-17 08:44:14 -0500
commit586629c0b607f34981a893cf856bb35279f58542 (patch)
tree12f52efe17282324176b5153427d426a98cca381
parent49f50780480421e524adf6262a285003d6f8281e (diff)
downloadrust-586629c0b607f34981a893cf856bb35279f58542.tar.gz
rust-586629c0b607f34981a893cf856bb35279f58542.zip
ci: Replace exec-with-shell wrapper with "plain bash"
Also, promote defaults.run.shell from inside only the primary jobs to
the top level.

The src/ci/exec-with-shell.py wrapper script was formerly used to change
out the shell mid-job by intercepting a CI_OVERRIDE_SHELL environment
variable.  Now, instead, we just set `bash` as the global default across
all jobs, and we also delete the exec-with-shell.py script.

Signed-off-by: Kristofer Rye <kristofer.rye@gmail.com>
-rw-r--r--.github/workflows/ci.yml14
-rwxr-xr-xsrc/ci/exec-with-shell.py16
-rw-r--r--src/ci/github-actions/ci.yml19
3 files changed, 5 insertions, 44 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 9cf0f4dbd1e..86de3782000 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -26,7 +26,7 @@ name: CI
       - "**"
 defaults:
   run:
-    shell: "python src/ci/exec-with-shell.py {0}"
+    shell: bash
 jobs:
   pr:
     name: PR
@@ -51,9 +51,6 @@ jobs:
             os: ubuntu-latest-xl
     timeout-minutes: 600
     runs-on: "${{ matrix.os }}"
-    defaults:
-      run:
-        shell: bash
     steps:
       - name: disable git crlf conversion
         run: git config --global core.autocrlf false
@@ -153,9 +150,6 @@ jobs:
             env: {}
     timeout-minutes: 600
     runs-on: "${{ matrix.os }}"
-    defaults:
-      run:
-        shell: bash
     steps:
       - name: disable git crlf conversion
         run: git config --global core.autocrlf false
@@ -473,9 +467,6 @@ jobs:
             os: windows-latest-xl
     timeout-minutes: 600
     runs-on: "${{ matrix.os }}"
-    defaults:
-      run:
-        shell: bash
     steps:
       - name: disable git crlf conversion
         run: git config --global core.autocrlf false
@@ -601,9 +592,6 @@ jobs:
             os: macos-latest
     timeout-minutes: 600
     runs-on: "${{ matrix.os }}"
-    defaults:
-      run:
-        shell: bash
     steps:
       - name: disable git crlf conversion
         run: git config --global core.autocrlf false
diff --git a/src/ci/exec-with-shell.py b/src/ci/exec-with-shell.py
deleted file mode 100755
index 26ce69e33d9..00000000000
--- a/src/ci/exec-with-shell.py
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env python
-# A simple wrapper that forwards the arguments to bash, unless the
-# CI_OVERRIDE_SHELL environment variable is present: in that case the content
-# of that environment variable is used as the shell path.
-
-import os
-import sys
-import subprocess
-
-try:
-    shell = os.environ["CI_OVERRIDE_SHELL"]
-except KeyError:
-    shell = "bash"
-
-res = subprocess.call([shell] + sys.argv[1:])
-sys.exit(res)
diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml
index e8036b8c120..5573d87aa2e 100644
--- a/src/ci/github-actions/ci.yml
+++ b/src/ci/github-actions/ci.yml
@@ -75,9 +75,6 @@ x--expand-yaml-anchors--remove:
   - &base-ci-job
     timeout-minutes: 600
     runs-on: "${{ matrix.os }}"
-    defaults:
-      run:
-        shell: bash
     env: *shared-ci-variables
     steps:
       - name: disable git crlf conversion
@@ -233,18 +230,10 @@ on:
 
 defaults:
   run:
-    # While on Linux and macOS builders it just forwards the arguments to the
-    # system bash, this wrapper allows switching from the host's bash.exe to
-    # the one we install along with MSYS2 mid-build on Windows.
-    #
-    # Once the step to install MSYS2 is executed, the CI_OVERRIDE_SHELL
-    # environment variable is set pointing to our MSYS2's bash.exe. From that
-    # moment the host's bash.exe will not be called anymore.
-    #
-    # This is needed because we can't launch our own bash.exe from the host
-    # bash.exe, as that would load two different cygwin1.dll in memory, causing
-    # "cygwin heap mismatch" errors.
-    shell: python src/ci/exec-with-shell.py {0}
+    # On Linux, macOS, and Windows, use the system-provided bash as the default
+    # shell. (This should only make a difference on Windows, where the default
+    # shell is PowerShell.)
+    shell: bash
 
 jobs:
   pr: