Skip to content

Fails on WSL if wsl is not installed #494

@wmmc88

Description

@wmmc88

Erroneous Behavior

Fails with the following error:

at 11:00:33 AM ❯ topgrade

── 11:00:39 - Self update ──────────────────────────────────────────────────────
Topgrade is up-to-date
WSL failed: 
   0: Command failed: `C:\WINDOWS\system32\wsl.EXE --list -q`

      Stdout:

      Copyright (c) Microsoft Corporation. All rights reserved.

      Usage: wsl.exe [Argument]

      Arguments:

          --install <Options>
              Install Windows Subsystem for Linux features. If no options are specified,
              the recommended features will be installed along with the default distribution.

              To view the default distribution as well as a list of other valid distributions,
              use 'wsl --list --online'.

              Options:
                  --distribution, -d [Argument]
                      Specifies the distribution to be downloaded and installed by name.

                      Arguments:
                          A valid distribution name (not case sensitive).

                      Examples:
                          wsl --install -d Ubuntu
                          wsl --install --distribution Debian

                  --inbox
                      Install the optional Windows feature instead of the version available via the Microsoft Store.

                  --enable-wsl1
                      Enable WSL1 support with the Microsoft Store version.

                  --no-distribution
                      Do not install a distribution (cannot be used with --distribution).

                  --no-launch, -n
                      Do not launch the distribution after install.

                  --web-download
                      Download the most recent version of WSL from the internet instead of the Microsoft Store.

          --list, -l [Options]
              Lists distributions.

              Options:
                  --online, -o
                      Displays a list of available distributions for install with 'wsl --install'.

          --status
              Show the status of Windows Subsystem for Linux.

          --help
              Display usage information.

   1: `C:\WINDOWS\system32\wsl.EXE` failed: exit code: 1

Location:
   src\steps\os\windows.rs:91

Expected Behavior

Since WSL is not installed on my system, it should skip trying to update WSL

Steps to reproduce

On a system without WSL installed, run top grade

Possible Cause (Optional)

Seems like topgrade doesn't realize that i don't have WSL installed, so wouldn't want to update it.

Problem persists without calling from topgrade

  • Yes

Configuration file (Optional)

Additional Details

  • Operation System/Version

Windows 11

  • Installation

cargo binstall topgrade

  • Topgrade version (topgrade -V)
    12.0.0

Verbose Output (topgrade -v)


Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions