mirror of
https://github.com/dtolnay/rust-toolchain.git
synced 2026-11-29 14:50:42 +08:00
Compare commits
7
Commits
0f870b6bab
...
stable
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39008827e6 | ||
|
|
df2a88e9fe | ||
|
|
245fd7ab06 | ||
|
|
683b588c48 | ||
|
|
e2a55d2ffb | ||
|
|
6af9a09a9f | ||
|
|
83d06109b7 |
@@ -43,18 +43,3 @@ jobs:
|
|||||||
if: matrix.rust == 'nightly' || matrix.rust == 'beta' || matrix.rust == 'stable'
|
if: matrix.rust == 'nightly' || matrix.rust == 'beta' || matrix.rust == 'stable'
|
||||||
- run: cargo check
|
- run: cargo check
|
||||||
if: matrix.rust == 'nightly' || matrix.rust == 'beta' || matrix.rust == 'stable'
|
if: matrix.rust == 'nightly' || matrix.rust == 'beta' || matrix.rust == 'stable'
|
||||||
|
|
||||||
non-host:
|
|
||||||
name: Non-host toolchain on Windows
|
|
||||||
runs-on: windows-latest
|
|
||||||
timeout-minutes: 45
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v7
|
|
||||||
- uses: ./
|
|
||||||
with:
|
|
||||||
toolchain: stable-i686-pc-windows-msvc
|
|
||||||
- name: Check the active toolchain and compiler host
|
|
||||||
run: |
|
|
||||||
test "$(rustup show active-toolchain)" = "stable-i686-pc-windows-msvc (default)"
|
|
||||||
rustc --version --verbose | grep -Fx 'host: i686-pc-windows-msvc'
|
|
||||||
shell: bash
|
|
||||||
|
|||||||
+31
-21
@@ -8,7 +8,8 @@ branding:
|
|||||||
inputs:
|
inputs:
|
||||||
toolchain:
|
toolchain:
|
||||||
description: Rust toolchain specification -- see https://rust-lang.github.io/rustup/concepts/toolchains.html#toolchain-specification
|
description: Rust toolchain specification -- see https://rust-lang.github.io/rustup/concepts/toolchains.html#toolchain-specification
|
||||||
required: true
|
required: false
|
||||||
|
default: stable
|
||||||
targets:
|
targets:
|
||||||
description: Comma-separated list of target triples to install for this toolchain
|
description: Comma-separated list of target triples to install for this toolchain
|
||||||
required: false
|
required: false
|
||||||
@@ -48,23 +49,14 @@ runs:
|
|||||||
elif [[ $toolchain =~ ^1\.[0-9]+$ ]]; then
|
elif [[ $toolchain =~ ^1\.[0-9]+$ ]]; then
|
||||||
echo "toolchain=1.$((i=${toolchain#1.}, c=($(date +%s)/60/60/24-16569)/7/6, i+9*i*(10*i<=c)+90*i*(100*i<=c)))" >> $GITHUB_OUTPUT
|
echo "toolchain=1.$((i=${toolchain#1.}, c=($(date +%s)/60/60/24-16569)/7/6, i+9*i*(10*i<=c)+90*i*(100*i<=c)))" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
echo "toolchain=$toolchain" >> $GITHUB_OUTPUT
|
delimiter=EOF
|
||||||
|
while [[ $toolchain == *$delimiter* ]]; do delimiter+=_; done
|
||||||
|
printf 'toolchain<<%s\n%s\n%s\n' "$delimiter" "$toolchain" "$delimiter" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
env:
|
env:
|
||||||
toolchain: ${{inputs.toolchain}}
|
toolchain: ${{inputs.toolchain}}
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- id: flags
|
|
||||||
name: Construct rustup command line
|
|
||||||
run: |
|
|
||||||
echo "targets=$(for t in ${targets//,/ }; do echo -n ' --target' $t; done)" >> $GITHUB_OUTPUT
|
|
||||||
echo "components=$(for c in ${components//,/ }; do echo -n ' --component' $c; done)" >> $GITHUB_OUTPUT
|
|
||||||
echo "downgrade=${{steps.parse.outputs.toolchain == 'nightly' && inputs.components && ' --allow-downgrade' || ''}}" >> $GITHUB_OUTPUT
|
|
||||||
env:
|
|
||||||
targets: ${{inputs.targets || inputs.target || ''}}
|
|
||||||
components: ${{inputs.components}}
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Set $CARGO_HOME
|
- name: Set $CARGO_HOME
|
||||||
run: echo CARGO_HOME=${CARGO_HOME:-"${{runner.os == 'Windows' && '$USERPROFILE\.cargo' || '$HOME/.cargo'}}"} >> $GITHUB_ENV
|
run: echo CARGO_HOME=${CARGO_HOME:-"${{runner.os == 'Windows' && '$USERPROFILE\.cargo' || '$HOME/.cargo'}}"} >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -90,10 +82,15 @@ runs:
|
|||||||
|
|
||||||
- name: rustup toolchain install ${{steps.parse.outputs.toolchain}}
|
- name: rustup toolchain install ${{steps.parse.outputs.toolchain}}
|
||||||
run: |
|
run: |
|
||||||
|
set -f # split targets and components on commas and whitespace, without glob expansion
|
||||||
|
flags=()
|
||||||
|
for t in ${targets//,/ }; do flags+=(--target "$t"); done
|
||||||
|
for c in ${components//,/ }; do flags+=(--component "$c"); done
|
||||||
|
if [[ $toolchain == nightly && -n $components ]]; then flags+=(--allow-downgrade); fi
|
||||||
log=$(mktemp)
|
log=$(mktemp)
|
||||||
trap 'rm -f "$log"' EXIT
|
trap 'rm -f "$log"' EXIT
|
||||||
for attempt in 1 2 3 4 5; do
|
for attempt in 1 2 3 4 5; do
|
||||||
if rustup toolchain install ${{steps.parse.outputs.toolchain}}${{steps.flags.outputs.targets}}${{steps.flags.outputs.components}} --profile minimal${{steps.flags.outputs.downgrade}} --no-self-update --force-non-host 2>&1 | tee "$log"; then
|
if rustup toolchain install "$toolchain" "${flags[@]}" --profile minimal --no-self-update --force-non-host 2>&1 | tee "$log"; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
status=$?
|
status=$?
|
||||||
@@ -106,20 +103,27 @@ runs:
|
|||||||
sleep 30
|
sleep 30
|
||||||
done
|
done
|
||||||
env:
|
env:
|
||||||
|
toolchain: ${{steps.parse.outputs.toolchain}}
|
||||||
|
targets: ${{inputs.targets || inputs.target || ''}}
|
||||||
|
components: ${{inputs.components}}
|
||||||
RUSTUP_PERMIT_COPY_RENAME: 1
|
RUSTUP_PERMIT_COPY_RENAME: 1
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: rustup default ${{steps.parse.outputs.toolchain}}
|
- name: rustup default ${{steps.parse.outputs.toolchain}}
|
||||||
run: rustup default ${{steps.parse.outputs.toolchain}} --force-non-host
|
run: rustup default "$toolchain" --force-non-host
|
||||||
|
env:
|
||||||
|
toolchain: ${{steps.parse.outputs.toolchain}}
|
||||||
shell: bash
|
shell: bash
|
||||||
continue-on-error: true # https://github.com/dtolnay/rust-toolchain/issues/127
|
continue-on-error: true # https://github.com/dtolnay/rust-toolchain/issues/127
|
||||||
|
|
||||||
- id: rustc-version
|
- id: rustc-version
|
||||||
name: Create cachekey
|
name: Create cachekey
|
||||||
run: |
|
run: |
|
||||||
DATE=$(rustc +${{steps.parse.outputs.toolchain}} --version --verbose | sed -ne 's/^commit-date: \(20[0-9][0-9]\)-\([01][0-9]\)-\([0-3][0-9]\)$/\1\2\3/p')
|
DATE=$(rustc +"$toolchain" --version --verbose | sed -ne 's/^commit-date: \(20[0-9][0-9]\)-\([01][0-9]\)-\([0-3][0-9]\)$/\1\2\3/p')
|
||||||
HASH=$(rustc +${{steps.parse.outputs.toolchain}} --version --verbose | sed -ne 's/^commit-hash: //p')
|
HASH=$(rustc +"$toolchain" --version --verbose | sed -ne 's/^commit-hash: //p')
|
||||||
echo "cachekey=$(echo $DATE$HASH | head -c12)" >> $GITHUB_OUTPUT
|
echo "cachekey=$(echo $DATE$HASH | head -c12)" >> $GITHUB_OUTPUT
|
||||||
|
env:
|
||||||
|
toolchain: ${{steps.parse.outputs.toolchain}}
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Disable incremental compilation
|
- name: Disable incremental compilation
|
||||||
@@ -140,24 +144,30 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
# implemented in 1.66, stabilized in 1.68, made default in 1.70
|
# implemented in 1.66, stabilized in 1.68, made default in 1.70
|
||||||
if [ -z "${CARGO_REGISTRIES_CRATES_IO_PROTOCOL+set}" -o -f "${{runner.temp}}"/.implicit_cargo_registries_crates_io_protocol ]; then
|
if [ -z "${CARGO_REGISTRIES_CRATES_IO_PROTOCOL+set}" -o -f "${{runner.temp}}"/.implicit_cargo_registries_crates_io_protocol ]; then
|
||||||
if rustc +${{steps.parse.outputs.toolchain}} --version --verbose | grep -q '^release: 1\.6[89]\.'; then
|
if rustc +"$toolchain" --version --verbose | grep -q '^release: 1\.6[89]\.'; then
|
||||||
touch "${{runner.temp}}"/.implicit_cargo_registries_crates_io_protocol || true
|
touch "${{runner.temp}}"/.implicit_cargo_registries_crates_io_protocol || true
|
||||||
echo CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse >> $GITHUB_ENV
|
echo CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse >> $GITHUB_ENV
|
||||||
elif rustc +${{steps.parse.outputs.toolchain}} --version --verbose | grep -q '^release: 1\.6[67]\.'; then
|
elif rustc +"$toolchain" --version --verbose | grep -q '^release: 1\.6[67]\.'; then
|
||||||
touch "${{runner.temp}}"/.implicit_cargo_registries_crates_io_protocol || true
|
touch "${{runner.temp}}"/.implicit_cargo_registries_crates_io_protocol || true
|
||||||
echo CARGO_REGISTRIES_CRATES_IO_PROTOCOL=git >> $GITHUB_ENV
|
echo CARGO_REGISTRIES_CRATES_IO_PROTOCOL=git >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
env:
|
||||||
|
toolchain: ${{steps.parse.outputs.toolchain}}
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Work around spurious network errors in curl 8.0
|
- name: Work around spurious network errors in curl 8.0
|
||||||
run: |
|
run: |
|
||||||
# https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/timeout.20investigation
|
# https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/timeout.20investigation
|
||||||
if rustc +${{steps.parse.outputs.toolchain}} --version --verbose | grep -q '^release: 1\.7[01]\.'; then
|
if rustc +"$toolchain" --version --verbose | grep -q '^release: 1\.7[01]\.'; then
|
||||||
echo CARGO_HTTP_MULTIPLEXING=false >> $GITHUB_ENV
|
echo CARGO_HTTP_MULTIPLEXING=false >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
|
env:
|
||||||
|
toolchain: ${{steps.parse.outputs.toolchain}}
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: rustc +${{steps.parse.outputs.toolchain}} --version --verbose
|
- name: rustc +${{steps.parse.outputs.toolchain}} --version --verbose
|
||||||
run: rustc +${{steps.parse.outputs.toolchain}} --version --verbose
|
run: rustc +"$toolchain" --version --verbose
|
||||||
|
env:
|
||||||
|
toolchain: ${{steps.parse.outputs.toolchain}}
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ patch_releases=(
|
|||||||
1.12.1 1.15.1 1.22.1 1.24.1 1.26.1 1.26.2 1.27.1 1.27.2 1.29.1 1.29.2 1.30.1
|
1.12.1 1.15.1 1.22.1 1.24.1 1.26.1 1.26.2 1.27.1 1.27.2 1.29.1 1.29.2 1.30.1
|
||||||
1.31.1 1.34.1 1.34.2 1.41.1 1.43.1 1.44.1 1.45.1 1.45.2 1.52.1 1.56.1 1.58.1
|
1.31.1 1.34.1 1.34.2 1.41.1 1.43.1 1.44.1 1.45.1 1.45.2 1.52.1 1.56.1 1.58.1
|
||||||
1.62.1 1.66.1 1.67.1 1.68.1 1.68.2 1.71.1 1.72.1 1.74.1 1.77.1 1.77.2 1.80.1
|
1.62.1 1.66.1 1.67.1 1.68.1 1.68.2 1.71.1 1.72.1 1.74.1 1.77.1 1.77.2 1.80.1
|
||||||
1.84.1 1.85.1 1.91.1 1.93.1 1.94.1 1.96.1 1.97.1 1.98.1
|
1.84.1 1.85.1 1.91.1 1.93.1 1.94.1 1.96.1 1.97.1 1.98.1 1.99.1
|
||||||
)
|
)
|
||||||
|
|
||||||
releases() {
|
releases() {
|
||||||
|
|||||||
Reference in New Issue
Block a user