-
Notifications
You must be signed in to change notification settings - Fork 892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustup suggest executing "source ...", but this command is absent in dash #3415
Comments
It is true that Perhaps we should make this less programmatic and instead say something like 'you need to source the environment file . Some common ways to do this are '. ' and 'source ', ...' and then we can add more for zsh and ion and all the other shells that are out there. |
@safinaskar After some research I found two heredoc strings that look suspicious. Could you please confirm whether they are the suggestions that you were seeing? Lines 218 to 231 in bd08d35
Lines 246 to 258 in bd08d35
|
@rami3l . I just executed
|
@safinaskar Thanks! I'm looking at the right place then. Should be an easy fix... |
@rbtcollins Personally I use That being said, I have the same concern as yours: the dot will be easily overlooked by beginners who don't know
|
When https://sh.rustup.rs link will be updated? I want to test whether this bug is fixed |
@safinaskar Hi! The change is in the Rust part of |
New version of rustc just released, but when I run |
@safinaskar The version of Rust (currently 1.73.0) has nothing to do with the version of FWIW, if you want to see what has been changed, you can see for yourself directly at https://github.com/rust-lang/rustup/pull/3445/files. |
Update: The prompt has again been polished with #3506. |
@rami3l, thanks a lot for all this work! Unfortunately, I don't like this patch. I think many users don't know that in Debian /bin/sh is symlink to dash. They see that default login shell is bash, so they may assume that Back to my original use case: Docker. Consider some typical user. He sees rustup output from your latest patch. He will think: "Okay, what shell I have? bash or dash?" He will spawn fresh debian docker container (using At this point you may say: "Okay, how to verify this?" Start fresh debian container using So, everything is very complex, so I think rustup output should give as little choice as possible. Ideally one command to use in all cases. Or at least all POSIX-compatible shells, such as bash and dash, should use same command. I propose this text:
(I will possibly fill bug report to dash asking them to implement |
I just found that dash upstream author said ( https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=211391 ) "It's a bashism so it will never be implemented" in 2003 |
@safinaskar I understand your concerns, but I wrote these messages mostly with another kind of users in mind: those who want to try out Rust for a new kind of programming experience. I have already asked myself dozens of times why I have to put the Also, for the more advanced users that somehow cannot use the official |
Reminder:
Yes, it is. But it works, if you source an env file and then execute payload in the same line:
What you mean when you say that bash is not sh? You mean that bash is not POSIX-compatible? This is not true. bash is POSIX-compatible (for practical purposes, I'm not sure that it absolutely compatible). Or you mean that sh points to dash in debian? Then logical order is wrong. "Debian chose dash as system shell because sh points to dash" is wrong, "sh points to dash, because debian chose dash as system shell" is right. Actually, debian chose dash as system shell in the hope that this will make boot times smaller (you can google for this). It seems boot times actually got smaller, but this broke everything (and systemd made boot times even smaller anyway), so this was very bad technical decision. Or you mean that dash implements nothing on top of POSIX? As well as I remember this is not true: dash has a small amount of extensions on top of POSIX. I can search for them in web.
These differences are not relevant for our case, because we specify absolute path here, not relative
bash indeed executes in "more POSIX mode". I. e. when normal bash behavior and POSIX behavior differ, then POSIX behavior is chosen. But nearly all bash extensions (such as
This sounds laughable. You imply that POSIX specification is small, understandable and easy to implement exactly. And that there exist shell (or even many shells) that implement POSIX spec exactly, no more and no less. Or at least some shell can be run (if needed) in fully POSIX compatible mode, no more and no less. All this is wrong. I'm not aware of any shell, which precisely implements POSIX. As I said above, dash is very similar to exact POSIX set of features, yet, as I But okay, if you still think that current rustup output is correct, then let it be |
@safinaskar Thanks for your detailed explanation. I did some more research on this topic and I sincerely apologize for my very inaccurate previous reply in the late AM. I have changed my mind thanks to your clarification and now wish to make I'll let you know once this is done, and let's see what we can do more together to make As always, thank you so much for this issue and all your comments. |
@safinaskar How about the following: This is usually done by running one of the following (note the leading DOT):
v------------------------------------------------------------------/
. "{cargo_home}/env" # For sh/bash/zsh/ash/dash/pdksh
source "{cargo_home}/env.fish" # For fish We definitely don't want |
I don't think adding the arrow makes it easier to understand. Just calling it out in the text seems like a nice touch, though. |
@djc Thanks! I'll remove the arrow line then. |
Thanks a lot for all your work! Yes, I like this text |
@safinaskar The PR has been made: #3509. Please feel free to review these changes so we can make sure that it reaches your expectations before it gets merged! |
Problem
Command
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
in the end suggest running commandsource "$HOME/.cargo/env"
. But there is no commandsource
in dash (this is Debian's default shell). So, please fix your suggestion to.
instead ofsource
.I copied this
source "$HOME/.cargo/env"
from rustup output and pasted to my dockerfile. And docker build failed, because of this problemSteps
.
Possible Solution(s)
No response
Notes
No response
Rustup version
.
Installed toolchains
.
The text was updated successfully, but these errors were encountered: