From 1f3b09e73e33ebceb2205a60e7b0b8de0a5e0b7b Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 29 Apr 2025 11:42:31 -0700 Subject: [PATCH 1/6] Download rustup-init.exe to temp dir instead of current dir --- action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index d7b092a..18f8e55 100644 --- a/action.yml +++ b/action.yml @@ -78,8 +78,8 @@ runs: - run: | : install rustup if needed on windows if ! command -v rustup &>/dev/null; then - curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail --remote-name https://static.rust-lang.org/rustup/dist/${{ runner.arch == 'ARM64' && 'aarch64' || 'x86_64' }}-pc-windows-msvc/rustup-init.exe - ./rustup-init.exe --default-toolchain none --no-modify-path -y + curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail https://static.rust-lang.org/rustup/dist/${{ runner.arch == 'ARM64' && 'aarch64' || 'x86_64' }}-pc-windows-msvc/rustup-init.exe --output '${{runner.temp}}\rustup-init.exe' + '${{runner.temp}}\rustup-init.exe' --default-toolchain none --no-modify-path -y echo "$USERPROFILE/.cargo/bin" >> $GITHUB_PATH fi if: runner.os == 'Windows' From 802126c77d87c59c86423d5aae014ef82a599ce8 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 29 Apr 2025 11:58:18 -0700 Subject: [PATCH 2/6] Consistently use backslash directories on Windows --- action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 18f8e55..053c4a0 100644 --- a/action.yml +++ b/action.yml @@ -63,14 +63,14 @@ runs: - run: | : set $CARGO_HOME - echo CARGO_HOME=${CARGO_HOME:-${{runner.os == 'Windows' && '$USERPROFILE' || '$HOME'}}/.cargo} >> $GITHUB_ENV + echo CARGO_HOME=${CARGO_HOME:-'${{runner.os == 'Windows' && '$USERPROFILE\.cargo' || '$HOME/.cargo'}}'} >> $GITHUB_ENV shell: bash - run: | : install rustup if needed if ! command -v rustup &>/dev/null; then curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail https://sh.rustup.rs | sh -s -- --default-toolchain none -y - echo "$CARGO_HOME/bin" >> $GITHUB_PATH + echo '$CARGO_HOME/bin' >> $GITHUB_PATH fi if: runner.os != 'Windows' shell: bash @@ -80,7 +80,7 @@ runs: if ! command -v rustup &>/dev/null; then curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail https://static.rust-lang.org/rustup/dist/${{ runner.arch == 'ARM64' && 'aarch64' || 'x86_64' }}-pc-windows-msvc/rustup-init.exe --output '${{runner.temp}}\rustup-init.exe' '${{runner.temp}}\rustup-init.exe' --default-toolchain none --no-modify-path -y - echo "$USERPROFILE/.cargo/bin" >> $GITHUB_PATH + echo '$USERPROFILE\.cargo\bin' >> $GITHUB_PATH fi if: runner.os == 'Windows' shell: bash From f36efbae07412b50fdfff84f529028c7096ba259 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 29 Apr 2025 12:09:07 -0700 Subject: [PATCH 3/6] Fix GITHUB_PATH --- action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 053c4a0..74519b3 100644 --- a/action.yml +++ b/action.yml @@ -63,14 +63,14 @@ runs: - run: | : set $CARGO_HOME - echo CARGO_HOME=${CARGO_HOME:-'${{runner.os == 'Windows' && '$USERPROFILE\.cargo' || '$HOME/.cargo'}}'} >> $GITHUB_ENV + echo CARGO_HOME=${CARGO_HOME:-"${{runner.os == 'Windows' && '$USERPROFILE\.cargo' || '$HOME/.cargo'}}"} >> $GITHUB_ENV shell: bash - run: | : install rustup if needed if ! command -v rustup &>/dev/null; then curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail https://sh.rustup.rs | sh -s -- --default-toolchain none -y - echo '$CARGO_HOME/bin' >> $GITHUB_PATH + echo "$CARGO_HOME/bin" >> $GITHUB_PATH fi if: runner.os != 'Windows' shell: bash @@ -80,7 +80,7 @@ runs: if ! command -v rustup &>/dev/null; then curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail https://static.rust-lang.org/rustup/dist/${{ runner.arch == 'ARM64' && 'aarch64' || 'x86_64' }}-pc-windows-msvc/rustup-init.exe --output '${{runner.temp}}\rustup-init.exe' '${{runner.temp}}\rustup-init.exe' --default-toolchain none --no-modify-path -y - echo '$USERPROFILE\.cargo\bin' >> $GITHUB_PATH + echo "$USERPROFILE\.cargo\bin" >> $GITHUB_PATH fi if: runner.os == 'Windows' shell: bash From eceb16e78c7dba252604060bc8d089c511dd6b7d Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 29 Apr 2025 12:09:58 -0700 Subject: [PATCH 4/6] Respect pre-existing CARGO_HOME on Windows --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 74519b3..2b76568 100644 --- a/action.yml +++ b/action.yml @@ -80,7 +80,7 @@ runs: if ! command -v rustup &>/dev/null; then curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail https://static.rust-lang.org/rustup/dist/${{ runner.arch == 'ARM64' && 'aarch64' || 'x86_64' }}-pc-windows-msvc/rustup-init.exe --output '${{runner.temp}}\rustup-init.exe' '${{runner.temp}}\rustup-init.exe' --default-toolchain none --no-modify-path -y - echo "$USERPROFILE\.cargo\bin" >> $GITHUB_PATH + echo "$CARGO_HOME\bin" >> $GITHUB_PATH fi if: runner.os == 'Windows' shell: bash From d69c8f6cd52ebafebc5f69693edd9af1181555ab Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 29 Apr 2025 12:07:34 -0700 Subject: [PATCH 5/6] Use rustup.rs advertised download URLs --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 2b76568..5d5cd1c 100644 --- a/action.yml +++ b/action.yml @@ -78,7 +78,7 @@ runs: - run: | : install rustup if needed on windows if ! command -v rustup &>/dev/null; then - curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail https://static.rust-lang.org/rustup/dist/${{ runner.arch == 'ARM64' && 'aarch64' || 'x86_64' }}-pc-windows-msvc/rustup-init.exe --output '${{runner.temp}}\rustup-init.exe' + curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused --location --silent --show-error --fail https://win.rustup.rs/${{runner.arch == 'ARM64' && 'aarch64' || 'x86_64'}} --output '${{runner.temp}}\rustup-init.exe' '${{runner.temp}}\rustup-init.exe' --default-toolchain none --no-modify-path -y echo "$CARGO_HOME\bin" >> $GITHUB_PATH fi From 6ff96e92a9257c99b1465dfa039b4a9eb9acc9dd Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Tue, 29 Apr 2025 12:19:55 -0700 Subject: [PATCH 6/6] Clean up trailing whitespace from PR 145 --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 5d5cd1c..c68a596 100644 --- a/action.yml +++ b/action.yml @@ -84,7 +84,7 @@ runs: fi if: runner.os == 'Windows' shell: bash - + - name: rustup toolchain install ${{steps.parse.outputs.toolchain}} run: rustup toolchain install ${{steps.parse.outputs.toolchain}}${{steps.flags.outputs.targets}}${{steps.flags.outputs.components}} --profile minimal${{steps.flags.outputs.downgrade}} --no-self-update shell: bash