diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 3a24be139d..932352c0f0 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -114,11 +114,15 @@ runs: if: ${{ inputs.os == 'macOS' || inputs.os == 'Android' }} uses: dtolnay/rust-toolchain@stable - # TODO: Remove once `imports_granularity` rustfmt option is stable. https://rust-lang.github.io/rustfmt/?version=v1.9.0&search=group#imports_granularity - - name: 'Install Nightly Rust toolchain for linting' + # Avoid 'rustup toolchain install nightly'. When a newer nightly is published, it triggers an in-place toolchain + # update whose component swap renames files from /opt/rustup/toolchains/ to /opt/rustup/tmp/. And those land on + # different overlayfs mounts inside the runner container — producing "Invalid cross-device link (os error 18)". + # TODO: Remove once 'imports_granularity' rustfmt option is stable: + # https://rust-lang.github.io/rustfmt/?version=v1.9.0&search=group#imports_granularity + - name: 'Ensure rustfmt is available on the nightly toolchain' if: ${{ inputs.type == 'lint' }} shell: bash - run: rustup toolchain install nightly --component rustfmt + run: rustup component add rustfmt --toolchain nightly - name: 'Install wasm-tools' if: ${{ inputs.type == 'build' }}