rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
96.72k stars 12.5k forks source link

`rustc --version` hangs on WSL 2 while using GitHub Actions #95930

Open mchernyavsky opened 2 years ago

mchernyavsky commented 2 years ago

I have a workflow with the following configuration:

name: test

on:
    push:
    pull_request:

jobs:
    test:
        runs-on: windows-2022
        timeout-minutes: 30

        steps:
            - uses: actions/checkout@v2

            - name: Set up WSL
              uses: Vampire/setup-wsl@v1
              with:
                  distribution: Ubuntu-18.04
                  additional-packages: cargo

            - name: Check environment
              shell: wsl-bash {0}
              run: rustc --version

            - name: Build
              shell: wsl-bash {0}
              run: cargo build

            - name: Test
              shell: wsl-bash {0}
              run: cargo test

            - name: Run
              shell: wsl-bash {0}
              run: cargo run

            - name: Finish check
              run: echo "Check finished successfully!"

It hangs on Check environment step for some reason: https://github.com/mchernyavsky/test-wsl/runs/5969420585

I'm not sure what the problem is, but if I change the environment to windows-2019 everything works just fine: https://github.com/mchernyavsky/test-wsl/actions/runs/2147461891 (windows-2019 uses WSL 1)

Previously I reported this issue to github virtual environments repo and to setup-wsl action repo, but it looks like the problem is in rustc.

Possible related issue -- https://github.com/rust-lang/rust/issues/88753

ehuss commented 2 years ago

A few things you can try:

Doineann commented 2 months ago

Maybe related to rustc --version (or rather the rustup wrapper) doing more than it is supposed to do? https://github.com/rust-lang/rust/issues/127649