Skip to content
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-init.sh's solaris/illumos bail doesn't work properly #3388

Closed
Noratrieb opened this issue Jun 21, 2023 · 1 comment · Fixed by #3475
Closed

rustup-init.sh's solaris/illumos bail doesn't work properly #3388

Noratrieb opened this issue Jun 21, 2023 · 1 comment · Fixed by #3475

Comments

@Noratrieb
Copy link
Member

Problem

I tried running rustup-init.sh with sh on a recent install of illumos. Looking at the source code, I expected it to error with a nice error message telling me to use bash instead:

rustup/rustup-init.sh

Lines 11 to 16 in ab81ee3

if [ "$KSH_VERSION" = 'Version JM 93t+ 2010-03-05' ]; then
# The version of ksh93 that ships with many illumos systems does not
# support the "local" extension. Print a message rather than fail in
# subtle ways later on:
echo 'rustup does not work with this ksh93 version; please try bash!' >&2
exit 1

Instead, I got random errors about local not working.

My KSH_VERSION is Version jM 93+ 2012-08-01.
uname -a is SunOS illumos 5.11 illumos-676abcb77c i86pc i386 i86pc

Steps

  1. install a recent install of illumos (I used openindiana OI-hipster-gui-20230502)
  2. run rustup-init.sh

Possible Solution(s)

It seems a like a more robust detection would be to check for SunOS in uname, but I'm not sure how well that works on Solaris and haven't tested it (but I would assume that Solaris has SunOS too since "SunOS" predates "Solaris").

Alternatively, also checking for my version may work too, that version is pretty old too so it seems unlikely to change frequently.

Notes

No response

Rustup version

https://github.com/rust-lang/rustup/blob/ab81ee3c5ec3a41e9eaa35ae3108070adf751775/rustup-init.sh

Installed toolchains

none
@rbtcollins
Copy link
Contributor

If you wanted to propose a fix that works on your machine that would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants