Skip to content

Rustup-init fails when fish is installed but without config files generated #3706

@4310V343k

Description

@4310V343k

Problem

I launched a GitHub Codespace, ran curl https://sh.rustup.rs -sSf | sh, got error: could not amend shell profile: '/home/codespace/.config/fish/conf.d/rustup.fish': could not write rcfile file: '/home/codespace/.config/fish/conf.d/rustup.fish': No such file or directory (os error 2)

Even though fish is installed in the codespace, its config is not pre-generated and the default shell is bash.
As I understood after 5 minutes of scrolling the code, rustup only checks if the shell's binary exists, not if the config files exist
This doesn't happen with other shells since their config files are typically located in the home folder

Steps

  1. Ensure fish is on PATH
  2. Ensure fish's config directory doesn't exist
  3. Run rustup with default settings (with modify PATH variable)

Possible Solution(s)

No response

Notes

Looks like conf.d directory is not created automatically even after running fish

Rustup version

Rustup did not install, but

@4310V343k ➜ /tmp/tmp.MNjnDjzYbe $ ./rustup-init -V
rustup-init 1.27.0 (bbb9276d2 2024-03-08)

Installed toolchains

Rustup did not install

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-shellNot really OS-related, but shell-specificbug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions