Repository: cross-rs/cross
Pull request #926 (2022-07-08 20:41:13)

fix for real
- make env var uppercase


Emilgardis: bors try

going to remove version bump on success
Emilgardis: This i sprobably something we should support, since cargo supports it
bors[bot]: ## try

Build failed:
  * [conclusion](https://github.com/cross-rs/cross/runs/7258222908?check_suite_focus=true)
Emilgardis: bors try
Emilgardis: bors try-

bors try
Emilgardis: bors try
bors[bot]: ## try

Already running a review
Emilgardis: bors try-

bors try
bors[bot]: ## try

Build succeeded:
  * [conclusion](https://github.com/cross-rs/cross/runs/7258854307?check_suite_focus=true)

Patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4f91bcd..0179104 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -307,7 +307,7 @@ jobs:
         run: ./ci/test-cross-image.sh
         env:
           TARGET: 'aarch64-unknown-linux-gnu'
-          IMAGE: 'ghcr.io/cross-rs/cross/aarch64-unknown-linux-gnu:main'
+          IMAGE: 'ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main'
         shell: bash
 
       - name: Login to GitHub Container Registry
@@ -389,7 +389,7 @@ jobs:
       - name: Run Docker-in-Docker Test
         env:
           TARGET: aarch64-unknown-linux-gnu
-          IMAGE: 'ghcr.io/cross-rs/cross/aarch64-unknown-linux-gnu:main'
+          IMAGE: 'ghcr.io/cross-rs/aarch64-unknown-linux-gnu:main'
         run: ./ci/test-docker-in-docker.sh
         shell: bash
 


Test patch:
diff --git a/ci/test-cross-image.sh b/ci/test-cross-image.sh
index a591ba6..9fb57f5 100755
--- a/ci/test-cross-image.sh
+++ b/ci/test-cross-image.sh
@@ -7,10 +7,13 @@ set -eo pipefail
 if [[ -z "${TARGET}" ]]; then
     export TARGET="aarch64-unknown-linux-gnu"
 fi
+# ^^subst is not supported on macOS bash (bash <4)
+# shellcheck disable=SC2155
+export TARGET_UPPER=$(echo "$TARGET" | awk '{print toupper($0)}')
 
 if [[ "${IMAGE}" ]]; then
     # shellcheck disable=SC2140
-    export "CROSS_TARGET_${TARGET//-/_}_IMAGE"="${IMAGE}"
+    export "CROSS_TARGET_${TARGET_UPPER//-/_}_IMAGE"="${IMAGE}"
 fi
 
 if [[ -z "${CROSS_TARGET_CROSS_IMAGE}" ]]; then
@@ -20,7 +23,7 @@ fi
 
 main() {
 
-    docker run --rm -e TARGET -e "CROSS_TARGET_${TARGET//-/_}_IMAGE" \
+    docker run --rm -e TARGET -e "CROSS_TARGET_${TARGET_UPPER//-/_}_IMAGE" \
         -v /var/run/docker.sock:/var/run/docker.sock \
         "${CROSS_TARGET_CROSS_IMAGE}" sh -c '
 #!/usr/bin/env sh
diff --git a/ci/test-docker-in-docker.sh b/ci/test-docker-in-docker.sh
index c9a33c0..f7705c0 100755
--- a/ci/test-docker-in-docker.sh
+++ b/ci/test-docker-in-docker.sh
@@ -9,10 +9,13 @@ set -eo pipefail
 if [[ -z "${TARGET}" ]]; then
     export TARGET="aarch64-unknown-linux-gnu"
 fi
+# ^^subst is not supported on macOS bash (bash <4)
+# shellcheck disable=SC2155
+export TARGET_UPPER=$(echo "$TARGET" | awk '{print toupper($0)}')
 
 if [[ "${IMAGE}" ]]; then
     # shellcheck disable=SC2140
-    export "CROSS_TARGET_${TARGET//-/_}_IMAGE"="${IMAGE}"
+    export "CROSS_TARGET_${TARGET_UPPER//-/_}_IMAGE"="${IMAGE}"
 fi
 
 source=$(dirname "${BASH_SOURCE[0]}")
@@ -23,7 +26,7 @@ main() {
     docker run -v "${home}":"${home}" -w "${home}" \
         --rm -e TARGET -e RUSTFLAGS -e RUST_TEST_THREADS \
         -e LLVM_PROFILE_FILE -e CARGO_INCREMENTAL \
-        -e "CROSS_TARGET_${TARGET//-/_}_IMAGE" \
+        -e "CROSS_TARGET_${TARGET_UPPER//-/_}_IMAGE" \
         -v /var/run/docker.sock:/var/run/docker.sock \
         docker:18.09-dind sh -c '
 #!/usr/bin/env sh