From 8926865a92aa7f4c69e9c55f8ec973fe57e1eb3d Mon Sep 17 00:00:00 2001 From: Cloud0310 <60375730+Cloud0310@users.noreply.github.com> Date: Sat, 12 Sep 2026 00:05:44 +0800 Subject: [PATCH 1/3] fix(ci): propagate Windows check and clippy failures --- .github/workflows/ci.yaml | 18 ++++++++++++++++++ .../windows-builds-template.yaml | 6 ++++++ 2 files changed, 24 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 25e20528e4..138047f743 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -161,17 +161,23 @@ jobs: run: bash ci/run.bash - name: Run cargo check if: matrix.mode != 'release' + # `bash` on Windows uses Git's Perl, which breaks the OpenSSL build. + shell: pwsh env: TARGET: ${{ matrix.target }} # os-specific code leads to lints escaping if we only run this in one target run: | + # Abort on the first nonzero exit code so a failure isn't masked by the next command. + $PSNativeCommandUseErrorActionPreference = $true cargo check --all --all-targets --features test git ls-files -- '*.rs' | xargs touch - name: Run cargo clippy if: matrix.mode != 'release' && matrix.mingwdir == '' + shell: pwsh env: TARGET: ${{ matrix.target }} run: | + $PSNativeCommandUseErrorActionPreference = $true rustup component add clippy cargo clippy --all-targets --all-features -- -D warnings - name: Upload the built artifact @@ -361,17 +367,23 @@ jobs: run: bash ci/run.bash - name: Run cargo check if: matrix.mode != 'release' + # `bash` on Windows uses Git's Perl, which breaks the OpenSSL build. + shell: pwsh env: TARGET: ${{ matrix.target }} # os-specific code leads to lints escaping if we only run this in one target run: | + # Abort on the first nonzero exit code so a failure isn't masked by the next command. + $PSNativeCommandUseErrorActionPreference = $true cargo check --all --all-targets --features test git ls-files -- '*.rs' | xargs touch - name: Run cargo clippy if: matrix.mode != 'release' && matrix.mingwdir == '' + shell: pwsh env: TARGET: ${{ matrix.target }} run: | + $PSNativeCommandUseErrorActionPreference = $true rustup component add clippy cargo clippy --all-targets --all-features -- -D warnings - name: Upload the built artifact @@ -567,17 +579,23 @@ jobs: run: bash ci/run.bash - name: Run cargo check if: matrix.mode != 'release' + # `bash` on Windows uses Git's Perl, which breaks the OpenSSL build. + shell: pwsh env: TARGET: ${{ matrix.target }} # os-specific code leads to lints escaping if we only run this in one target run: | + # Abort on the first nonzero exit code so a failure isn't masked by the next command. + $PSNativeCommandUseErrorActionPreference = $true cargo check --all --all-targets --features test git ls-files -- '*.rs' | xargs touch - name: Run cargo clippy if: matrix.mode != 'release' && matrix.mingwdir == '' + shell: pwsh env: TARGET: ${{ matrix.target }} run: | + $PSNativeCommandUseErrorActionPreference = $true rustup component add clippy cargo clippy --all-targets --all-features -- -D warnings - name: Upload the built artifact diff --git a/ci/actions-templates/windows-builds-template.yaml b/ci/actions-templates/windows-builds-template.yaml index 2b4c9773b9..e009e7ab69 100644 --- a/ci/actions-templates/windows-builds-template.yaml +++ b/ci/actions-templates/windows-builds-template.yaml @@ -152,17 +152,23 @@ jobs: # skip-main skip-pr skip-stable run: bash ci/run.bash - name: Run cargo check if: matrix.mode != 'release' + # `bash` on Windows uses Git's Perl, which breaks the OpenSSL build. + shell: pwsh env: TARGET: ${{ matrix.target }} # os-specific code leads to lints escaping if we only run this in one target run: | + # Abort on the first nonzero exit code so a failure isn't masked by the next command. + $PSNativeCommandUseErrorActionPreference = $true cargo check --all --all-targets --features test git ls-files -- '*.rs' | xargs touch - name: Run cargo clippy if: matrix.mode != 'release' && matrix.mingwdir == '' + shell: pwsh env: TARGET: ${{ matrix.target }} run: | + $PSNativeCommandUseErrorActionPreference = $true rustup component add clippy cargo clippy --all-targets --all-features -- -D warnings - name: Upload the built artifact From 846bce5e379361b9674dfcc0dd01b6a656d53115 Mon Sep 17 00:00:00 2001 From: Cloud0310 <60375730+Cloud0310@users.noreply.github.com> Date: Sat, 12 Sep 2026 13:44:01 +0800 Subject: [PATCH 2/3] refactor(ci): replace xargs touch with native PowerShell Update tracked Rust source timestamps with ForEach-Object and Get-Item, removing the dependency on xargs and touch in Windows jobs. --- .github/workflows/ci.yaml | 12 +++++++++--- ci/actions-templates/windows-builds-template.yaml | 4 +++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 138047f743..423e432ac0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -170,7 +170,9 @@ jobs: # Abort on the first nonzero exit code so a failure isn't masked by the next command. $PSNativeCommandUseErrorActionPreference = $true cargo check --all --all-targets --features test - git ls-files -- '*.rs' | xargs touch + git -c core.quotePath=false ls-files -- '*.rs' | ForEach-Object { + (Get-Item -LiteralPath $_).LastWriteTime = Get-Date + } - name: Run cargo clippy if: matrix.mode != 'release' && matrix.mingwdir == '' shell: pwsh @@ -376,7 +378,9 @@ jobs: # Abort on the first nonzero exit code so a failure isn't masked by the next command. $PSNativeCommandUseErrorActionPreference = $true cargo check --all --all-targets --features test - git ls-files -- '*.rs' | xargs touch + git -c core.quotePath=false ls-files -- '*.rs' | ForEach-Object { + (Get-Item -LiteralPath $_).LastWriteTime = Get-Date + } - name: Run cargo clippy if: matrix.mode != 'release' && matrix.mingwdir == '' shell: pwsh @@ -588,7 +592,9 @@ jobs: # Abort on the first nonzero exit code so a failure isn't masked by the next command. $PSNativeCommandUseErrorActionPreference = $true cargo check --all --all-targets --features test - git ls-files -- '*.rs' | xargs touch + git -c core.quotePath=false ls-files -- '*.rs' | ForEach-Object { + (Get-Item -LiteralPath $_).LastWriteTime = Get-Date + } - name: Run cargo clippy if: matrix.mode != 'release' && matrix.mingwdir == '' shell: pwsh diff --git a/ci/actions-templates/windows-builds-template.yaml b/ci/actions-templates/windows-builds-template.yaml index e009e7ab69..a845c08696 100644 --- a/ci/actions-templates/windows-builds-template.yaml +++ b/ci/actions-templates/windows-builds-template.yaml @@ -161,7 +161,9 @@ jobs: # skip-main skip-pr skip-stable # Abort on the first nonzero exit code so a failure isn't masked by the next command. $PSNativeCommandUseErrorActionPreference = $true cargo check --all --all-targets --features test - git ls-files -- '*.rs' | xargs touch + git -c core.quotePath=false ls-files -- '*.rs' | ForEach-Object { + (Get-Item -LiteralPath $_).LastWriteTime = Get-Date + } - name: Run cargo clippy if: matrix.mode != 'release' && matrix.mingwdir == '' shell: pwsh From b3fc074c0ad970d696c5725e9b4e8c094e984b29 Mon Sep 17 00:00:00 2001 From: Cloud0310 <60375730+Cloud0310@users.noreply.github.com> Date: Sat, 12 Sep 2026 13:44:00 +0800 Subject: [PATCH 3/3] refactor(ci): use Powershell 7 solely for Windows actions Use a shared pwsh shell with native command failure propagation for Windows jobs, retaining Bash overrides where required. --- .github/workflows/ci.yaml | 48 +++++-------------- .../windows-builds-template.yaml | 16 ++----- 2 files changed, 16 insertions(+), 48 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 423e432ac0..83fc314107 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,6 +23,10 @@ jobs: build-windows-pr: # job-name skip-main skip-stable runs-on: ${{ matrix.os || 'windows-latest' }} if: ${{ contains(fromJSON('["pull_request", "merge_group"]'), github.event_name) }} # skip-main skip-stable + defaults: + run: + # Keep Git's Perl out of the OpenSSL build and stop on native command failures. + shell: pwsh -Command $ErrorActionPreference='stop'; $PSNativeCommandUseErrorActionPreference=$true; & '{0}' env: RUSTFLAGS: -Ctarget-feature=+crt-static RUST_MIN_STACK: 16777216 @@ -73,7 +77,6 @@ jobs: run: | New-Item "${env:USERPROFILE}\.cargo\registry" -ItemType Directory -Force New-Item "${env:USERPROFILE}\.cargo\git" -ItemType Directory -Force - shell: powershell - name: Install NASM # Building `aws-lc-rs` for Windows MSVC depends on `NASM`. # See: https://aws.github.io/aws-lc-rs/requirements/windows.html @@ -85,7 +88,6 @@ jobs: with: architecture: ${{ matrix.arch }} - name: Install llvm-mingw - shell: powershell if: matrix.llvm_mingw_version != '' run: | $version = "${{ matrix.llvm_mingw_version }}" @@ -106,7 +108,6 @@ jobs: "CC_${targetEnvUpper}=${{ matrix.gcc }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 "CARGO_TARGET_${targetEnvUpper}_LINKER=${{ matrix.gcc }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 - name: Verify mingw gcc installation - shell: powershell if: matrix.gcc != '' run: | Get-Command ${{ matrix.gcc }} @@ -147,10 +148,8 @@ jobs: Invoke-WebRequest "https://win.rustup.rs/${env:RUSTUP_ARCH}" -OutFile rustup-init.exe .\rustup-init.exe -y --default-host=${env:RUSTUP_ARCH}-pc-windows-msvc --profile=minimal del rustup-init.exe - shell: powershell - name: Ensure stable toolchain is up to date run: rustup update stable - shell: bash - name: Install the target run: | rustup target install ${{ matrix.target }} @@ -161,25 +160,19 @@ jobs: run: bash ci/run.bash - name: Run cargo check if: matrix.mode != 'release' - # `bash` on Windows uses Git's Perl, which breaks the OpenSSL build. - shell: pwsh env: TARGET: ${{ matrix.target }} # os-specific code leads to lints escaping if we only run this in one target run: | - # Abort on the first nonzero exit code so a failure isn't masked by the next command. - $PSNativeCommandUseErrorActionPreference = $true cargo check --all --all-targets --features test git -c core.quotePath=false ls-files -- '*.rs' | ForEach-Object { (Get-Item -LiteralPath $_).LastWriteTime = Get-Date } - name: Run cargo clippy if: matrix.mode != 'release' && matrix.mingwdir == '' - shell: pwsh env: TARGET: ${{ matrix.target }} run: | - $PSNativeCommandUseErrorActionPreference = $true rustup component add clippy cargo clippy --all-targets --all-features -- -D warnings - name: Upload the built artifact @@ -199,7 +192,6 @@ jobs: if: github.event_name == 'push' && matrix.mode == 'release' && (github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/main') run: | .\ci\prepare-deploy.ps1 - shell: powershell - name: Deploy build to dev-static dist tree for release team if: github.event_name == 'push' && github.ref == 'refs/heads/stable' && matrix.mode == 'release' run: | @@ -231,6 +223,10 @@ jobs: build-windows-main: # job-name skip-pr skip-stable runs-on: ${{ matrix.os || 'windows-latest' }} if: ${{ github.event_name == 'push' && (github.ref_name == 'main' || startsWith(github.ref_name, 'release/')) }} # skip-pr skip-stable + defaults: + run: + # Keep Git's Perl out of the OpenSSL build and stop on native command failures. + shell: pwsh -Command $ErrorActionPreference='stop'; $PSNativeCommandUseErrorActionPreference=$true; & '{0}' env: RUSTFLAGS: -Ctarget-feature=+crt-static RUST_MIN_STACK: 16777216 @@ -281,7 +277,6 @@ jobs: run: | New-Item "${env:USERPROFILE}\.cargo\registry" -ItemType Directory -Force New-Item "${env:USERPROFILE}\.cargo\git" -ItemType Directory -Force - shell: powershell - name: Install NASM # Building `aws-lc-rs` for Windows MSVC depends on `NASM`. # See: https://aws.github.io/aws-lc-rs/requirements/windows.html @@ -293,7 +288,6 @@ jobs: with: architecture: ${{ matrix.arch }} - name: Install llvm-mingw - shell: powershell if: matrix.llvm_mingw_version != '' run: | $version = "${{ matrix.llvm_mingw_version }}" @@ -314,7 +308,6 @@ jobs: "CC_${targetEnvUpper}=${{ matrix.gcc }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 "CARGO_TARGET_${targetEnvUpper}_LINKER=${{ matrix.gcc }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 - name: Verify mingw gcc installation - shell: powershell if: matrix.gcc != '' run: | Get-Command ${{ matrix.gcc }} @@ -355,10 +348,8 @@ jobs: Invoke-WebRequest "https://win.rustup.rs/${env:RUSTUP_ARCH}" -OutFile rustup-init.exe .\rustup-init.exe -y --default-host=${env:RUSTUP_ARCH}-pc-windows-msvc --profile=minimal del rustup-init.exe - shell: powershell - name: Ensure stable toolchain is up to date run: rustup update stable - shell: bash - name: Install the target run: | rustup target install ${{ matrix.target }} @@ -369,25 +360,19 @@ jobs: run: bash ci/run.bash - name: Run cargo check if: matrix.mode != 'release' - # `bash` on Windows uses Git's Perl, which breaks the OpenSSL build. - shell: pwsh env: TARGET: ${{ matrix.target }} # os-specific code leads to lints escaping if we only run this in one target run: | - # Abort on the first nonzero exit code so a failure isn't masked by the next command. - $PSNativeCommandUseErrorActionPreference = $true cargo check --all --all-targets --features test git -c core.quotePath=false ls-files -- '*.rs' | ForEach-Object { (Get-Item -LiteralPath $_).LastWriteTime = Get-Date } - name: Run cargo clippy if: matrix.mode != 'release' && matrix.mingwdir == '' - shell: pwsh env: TARGET: ${{ matrix.target }} run: | - $PSNativeCommandUseErrorActionPreference = $true rustup component add clippy cargo clippy --all-targets --all-features -- -D warnings - name: Upload the built artifact @@ -407,7 +392,6 @@ jobs: if: github.event_name == 'push' && matrix.mode == 'release' && (github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/main') run: | .\ci\prepare-deploy.ps1 - shell: powershell - name: Deploy build to dev-static dist tree for release team if: github.event_name == 'push' && github.ref == 'refs/heads/stable' && matrix.mode == 'release' run: | @@ -439,6 +423,10 @@ jobs: build-windows-stable: # job-name skip-main skip-pr runs-on: ${{ matrix.os || 'windows-latest' }} if: ${{ github.event_name == 'push' && github.ref_name == 'stable' || contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }} # skip-pr skip-main + defaults: + run: + # Keep Git's Perl out of the OpenSSL build and stop on native command failures. + shell: pwsh -Command $ErrorActionPreference='stop'; $PSNativeCommandUseErrorActionPreference=$true; & '{0}' env: RUSTFLAGS: -Ctarget-feature=+crt-static RUST_MIN_STACK: 16777216 @@ -495,7 +483,6 @@ jobs: run: | New-Item "${env:USERPROFILE}\.cargo\registry" -ItemType Directory -Force New-Item "${env:USERPROFILE}\.cargo\git" -ItemType Directory -Force - shell: powershell - name: Install NASM # Building `aws-lc-rs` for Windows MSVC depends on `NASM`. # See: https://aws.github.io/aws-lc-rs/requirements/windows.html @@ -507,7 +494,6 @@ jobs: with: architecture: ${{ matrix.arch }} - name: Install llvm-mingw - shell: powershell if: matrix.llvm_mingw_version != '' run: | $version = "${{ matrix.llvm_mingw_version }}" @@ -528,7 +514,6 @@ jobs: "CC_${targetEnvUpper}=${{ matrix.gcc }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 "CARGO_TARGET_${targetEnvUpper}_LINKER=${{ matrix.gcc }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 - name: Verify mingw gcc installation - shell: powershell if: matrix.gcc != '' run: | Get-Command ${{ matrix.gcc }} @@ -569,10 +554,8 @@ jobs: Invoke-WebRequest "https://win.rustup.rs/${env:RUSTUP_ARCH}" -OutFile rustup-init.exe .\rustup-init.exe -y --default-host=${env:RUSTUP_ARCH}-pc-windows-msvc --profile=minimal del rustup-init.exe - shell: powershell - name: Ensure stable toolchain is up to date run: rustup update stable - shell: bash - name: Install the target run: | rustup target install ${{ matrix.target }} @@ -583,25 +566,19 @@ jobs: run: bash ci/run.bash - name: Run cargo check if: matrix.mode != 'release' - # `bash` on Windows uses Git's Perl, which breaks the OpenSSL build. - shell: pwsh env: TARGET: ${{ matrix.target }} # os-specific code leads to lints escaping if we only run this in one target run: | - # Abort on the first nonzero exit code so a failure isn't masked by the next command. - $PSNativeCommandUseErrorActionPreference = $true cargo check --all --all-targets --features test git -c core.quotePath=false ls-files -- '*.rs' | ForEach-Object { (Get-Item -LiteralPath $_).LastWriteTime = Get-Date } - name: Run cargo clippy if: matrix.mode != 'release' && matrix.mingwdir == '' - shell: pwsh env: TARGET: ${{ matrix.target }} run: | - $PSNativeCommandUseErrorActionPreference = $true rustup component add clippy cargo clippy --all-targets --all-features -- -D warnings - name: Upload the built artifact @@ -621,7 +598,6 @@ jobs: if: github.event_name == 'push' && matrix.mode == 'release' && (github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/main') run: | .\ci\prepare-deploy.ps1 - shell: powershell - name: Deploy build to dev-static dist tree for release team if: github.event_name == 'push' && github.ref == 'refs/heads/stable' && matrix.mode == 'release' run: | diff --git a/ci/actions-templates/windows-builds-template.yaml b/ci/actions-templates/windows-builds-template.yaml index a845c08696..387e17b80a 100644 --- a/ci/actions-templates/windows-builds-template.yaml +++ b/ci/actions-templates/windows-builds-template.yaml @@ -8,6 +8,10 @@ jobs: # skip-main skip-pr skip-stable if: ${{ contains(fromJSON('["pull_request", "merge_group"]'), github.event_name) }} # skip-main skip-stable if: ${{ github.event_name == 'push' && (github.ref_name == 'main' || startsWith(github.ref_name, 'release/')) }} # skip-pr skip-stable if: ${{ github.event_name == 'push' && github.ref_name == 'stable' || contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }} # skip-pr skip-main + defaults: + run: + # Keep Git's Perl out of the OpenSSL build and stop on native command failures. + shell: pwsh -Command $ErrorActionPreference='stop'; $PSNativeCommandUseErrorActionPreference=$true; & '{0}' env: RUSTFLAGS: -Ctarget-feature=+crt-static RUST_MIN_STACK: 16777216 @@ -64,7 +68,6 @@ jobs: # skip-main skip-pr skip-stable run: | New-Item "${env:USERPROFILE}\.cargo\registry" -ItemType Directory -Force New-Item "${env:USERPROFILE}\.cargo\git" -ItemType Directory -Force - shell: powershell - name: Install NASM # Building `aws-lc-rs` for Windows MSVC depends on `NASM`. # See: https://aws.github.io/aws-lc-rs/requirements/windows.html @@ -76,7 +79,6 @@ jobs: # skip-main skip-pr skip-stable with: architecture: ${{ matrix.arch }} - name: Install llvm-mingw - shell: powershell if: matrix.llvm_mingw_version != '' run: | $version = "${{ matrix.llvm_mingw_version }}" @@ -97,7 +99,6 @@ jobs: # skip-main skip-pr skip-stable "CC_${targetEnvUpper}=${{ matrix.gcc }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 "CARGO_TARGET_${targetEnvUpper}_LINKER=${{ matrix.gcc }}" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 - name: Verify mingw gcc installation - shell: powershell if: matrix.gcc != '' run: | Get-Command ${{ matrix.gcc }} @@ -138,10 +139,8 @@ jobs: # skip-main skip-pr skip-stable Invoke-WebRequest "https://win.rustup.rs/${env:RUSTUP_ARCH}" -OutFile rustup-init.exe .\rustup-init.exe -y --default-host=${env:RUSTUP_ARCH}-pc-windows-msvc --profile=minimal del rustup-init.exe - shell: powershell - name: Ensure stable toolchain is up to date run: rustup update stable - shell: bash - name: Install the target run: | rustup target install ${{ matrix.target }} @@ -152,25 +151,19 @@ jobs: # skip-main skip-pr skip-stable run: bash ci/run.bash - name: Run cargo check if: matrix.mode != 'release' - # `bash` on Windows uses Git's Perl, which breaks the OpenSSL build. - shell: pwsh env: TARGET: ${{ matrix.target }} # os-specific code leads to lints escaping if we only run this in one target run: | - # Abort on the first nonzero exit code so a failure isn't masked by the next command. - $PSNativeCommandUseErrorActionPreference = $true cargo check --all --all-targets --features test git -c core.quotePath=false ls-files -- '*.rs' | ForEach-Object { (Get-Item -LiteralPath $_).LastWriteTime = Get-Date } - name: Run cargo clippy if: matrix.mode != 'release' && matrix.mingwdir == '' - shell: pwsh env: TARGET: ${{ matrix.target }} run: | - $PSNativeCommandUseErrorActionPreference = $true rustup component add clippy cargo clippy --all-targets --all-features -- -D warnings - name: Upload the built artifact @@ -190,7 +183,6 @@ jobs: # skip-main skip-pr skip-stable if: github.event_name == 'push' && matrix.mode == 'release' && (github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/main') run: | .\ci\prepare-deploy.ps1 - shell: powershell - name: Deploy build to dev-static dist tree for release team if: github.event_name == 'push' && github.ref == 'refs/heads/stable' && matrix.mode == 'release' run: |