rustup
rustup copied to clipboard
Add support for tcsh shell
Problem
On FreeBSD, rustup will generate a .cargo/env that is sourced in .profile. There are two issues here.
- tcsh does not source .profile on run, it sources .login
- Manually sourcing .cargo/env will give a syntax error that too many arguments were given to
case
Steps
- Install FreeBSD on a fresh machine with tcsh as the set shell (I used a VM)
- Install rustup using the given directions on the website
- You can either try to source .cargo/env or exit and reenter the shell
- Try running any rustup commands
Possible Solution(s)
- Modify .cargo/env to not use BASH specific extensions (I wouldn't quite know what specific syntax you should be using)
- Add sourcing .cargo/env to .login if present,
Notes
No response
Rustup version
Rustup 1.26.0
Installed toolchains
rustc 1.71.0
rustup scatters a bunch of entries to source the env file, because we don't know what shell the user will be using (it may not be the one they installed with). We have some code that represents this and I don't think we have tcsh support - if you'd like to add that that would be great.
AFAIK tcsh isn't even POSIX, so supporting that falls into the same category as supporting fish, meaning that:
- The
sourcesuggestion is incorrect anyway (even worse than #3415) because theenvfile cannot be read bytcsh, which is more or less expected. - We need to add special cases one by one for each non-POSIX shell in the ideal case scenario, similar to what is done in #3108.
@rustbot claim
Hi @rami3l, @rbtcollins- I opened #4459
I was lurking this repo looking for a potential way to contribute to one of my favorite tools of my favorite language. This is my first PR of really any OSS project.
I hope I didn't step on any toes, I tried to stick as close to the original issue at hand as possible.
Let me know if perhaps there were any guidelines or procedures I should have followed first before opening this PR, or even if I did something completely wrong implementation wise. I'm eager to learn as much as I can before continuing to attempt to contribute elsewhere.
Thanks so much in advance.