Skip to content

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

Closed
@Noratrieb

Description

@Noratrieb

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions