diff --git a/ci/actions-templates/README.md b/ci/actions-templates/README.md index 767bc12315..a6dfed3c65 100644 --- a/ci/actions-templates/README.md +++ b/ci/actions-templates/README.md @@ -46,6 +46,7 @@ system. | arm-unknown-linux-gnueabihf | Yes | Two | No | No | | x86_64-unknown-freebsd | Yes | Two | No | No | | x86_64-unknown-netbsd | Yes | Two | No | No | +| x86_64-unknown-illumos | Yes | Two | No | No | | powerpc-unknown-linux-gnu | Yes | Two | No | No | | powerpc64le-unknown-linux-gnu | Yes | Two | No | No | | mips-unknown-linux-gnu | Yes | Two | No | No | diff --git a/ci/actions-templates/linux-builds-template.yaml b/ci/actions-templates/linux-builds-template.yaml index 7cb65c748f..3f100d4a4c 100644 --- a/ci/actions-templates/linux-builds-template.yaml +++ b/ci/actions-templates/linux-builds-template.yaml @@ -36,6 +36,7 @@ jobs: - arm-unknown-linux-gnueabihf # skip-pr skip-master - x86_64-unknown-freebsd # skip-pr skip-master - x86_64-unknown-netbsd # skip-pr skip-master + - x86_64-unknown-illumos # skip-pr skip-master - powerpc-unknown-linux-gnu # skip-pr skip-master - powerpc64le-unknown-linux-gnu # skip-pr skip-master - mips-unknown-linux-gnu # skip-pr skip-master diff --git a/ci/cloudfront-invalidation.txt b/ci/cloudfront-invalidation.txt index a049c8fe9c..26e3036c0b 100644 --- a/ci/cloudfront-invalidation.txt +++ b/ci/cloudfront-invalidation.txt @@ -53,6 +53,8 @@ rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe.sha256 rustup/dist/x86_64-unknown-freebsd/rustup-init rustup/dist/x86_64-unknown-freebsd/rustup-init.sha256 +rustup/dist/x86_64-unknown-illumos/rustup-init +rustup/dist/x86_64-unknown-illumos/rustup-init.sha256 rustup/dist/x86_64-unknown-linux-gnu/rustup-init rustup/dist/x86_64-unknown-linux-gnu/rustup-init.sha256 rustup/dist/x86_64-unknown-linux-musl/rustup-init diff --git a/ci/docker/x86_64-unknown-illumos/Dockerfile b/ci/docker/x86_64-unknown-illumos/Dockerfile new file mode 100644 index 0000000000..9854bc9f6a --- /dev/null +++ b/ci/docker/x86_64-unknown-illumos/Dockerfile @@ -0,0 +1,7 @@ +FROM rust-x86_64-unknown-illumos + +ENV \ + AR_x86_64_unknown_illumos=x86_64-illumos-ar \ + CC_x86_64_unknown_illumos=x86_64-illumos-gcc \ + CXX_x86_64_unknown_illumos=x86_64-illumos-g++ \ + CARGO_TARGET_X86_64_UNKNOWN_ILLUMOS_LINKER=x86_64-illumos-gcc diff --git a/ci/fetch-rust-docker.bash b/ci/fetch-rust-docker.bash index 630fa77ff8..479adde599 100644 --- a/ci/fetch-rust-docker.bash +++ b/ci/fetch-rust-docker.bash @@ -31,6 +31,7 @@ case "$TARGET" in powerpc64le-unknown-linux-gnu) image=dist-powerpc64le-linux ;; s390x-unknown-linux-gnu) image=dist-s390x-linux ;; x86_64-unknown-freebsd) image=dist-x86_64-freebsd ;; + x86_64-unknown-illumos) image=dist-x86_64-illumos ;; x86_64-unknown-linux-gnu) image=dist-x86_64-linux ;; x86_64-unknown-netbsd) image=dist-x86_64-netbsd ;; riscv64gc-unknown-linux-gnu) image=dist-riscv64-linux ;; diff --git a/doc/src/installation/other.md b/doc/src/installation/other.md index 321dffec6a..784076ea20 100644 --- a/doc/src/installation/other.md +++ b/doc/src/installation/other.md @@ -58,6 +58,7 @@ choice: - [x86_64-pc-windows-gnu](https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-gnu/rustup-init.exe) - [x86_64-pc-windows-msvc](https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe)[^msvc] - [x86_64-unknown-freebsd](https://static.rust-lang.org/rustup/dist/x86_64-unknown-freebsd/rustup-init) +- [x86_64-unknown-illumos](https://static.rust-lang.org/rustup/dist/x86_64-unknown-illumos/rustup-init) - [x86_64-unknown-linux-gnu](https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init) - [x86_64-unknown-linux-musl](https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-musl/rustup-init) - [x86_64-unknown-netbsd](https://static.rust-lang.org/rustup/dist/x86_64-unknown-netbsd/rustup-init) diff --git a/rustup-init.sh b/rustup-init.sh index b4aaebf1f1..a56045f8e7 100755 --- a/rustup-init.sh +++ b/rustup-init.sh @@ -8,6 +8,15 @@ # It runs on Unix shells like {a,ba,da,k,z}sh. It uses the common `local` # extension. Note: Most shells limit `local` to 1 var per line, contra bash. +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 +fi + + set -u # If RUSTUP_UPDATE_ROOT is unset or empty, default it. @@ -192,6 +201,24 @@ get_architecture() { fi fi + if [ "$_ostype" = SunOS ]; then + # Both Solaris and illumos presently announce as "SunOS" in "uname -s" + # so use "uname -o" to disambiguate. We use the full path to the + # system uname in case the user has coreutils uname first in PATH, + # which has historically sometimes printed the wrong value here. + if [ "$(/usr/bin/uname -o)" = illumos ]; then + _ostype=illumos + fi + + # illumos systems have multi-arch userlands, and "uname -m" reports the + # machine hardware name; e.g., "i86pc" on both 32- and 64-bit x86 + # systems. Check for the native (widest) instruction set on the + # running kernel: + if [ "$_cputype" = i86pc ]; then + _cputype="$(isainfo -n)" + fi + fi + case "$_ostype" in Android) @@ -219,6 +246,10 @@ get_architecture() { _ostype=apple-darwin ;; + illumos) + _ostype=unknown-illumos + ;; + MINGW* | MSYS* | CYGWIN*) _ostype=pc-windows-gnu ;; diff --git a/src/dist/dist.rs b/src/dist/dist.rs index 2e82b95c7c..f1fc3f84a6 100644 --- a/src/dist/dist.rs +++ b/src/dist/dist.rs @@ -103,6 +103,7 @@ static LIST_OSES: &[&str] = &[ "linux", "rumprun-netbsd", "unknown-freebsd", + "unknown-illumos", ]; static LIST_ENVS: &[&str] = &[ "gnu", @@ -259,6 +260,7 @@ impl TargetTriple { (b"NetBSD", b"x86_64") => Some("x86_64-unknown-netbsd"), (b"NetBSD", b"i686") => Some("i686-unknown-netbsd"), (b"DragonFly", b"x86_64") => Some("x86_64-unknown-dragonfly"), + (b"SunOS", b"i86pc") => Some("x86_64-unknown-illumos"), _ => None, }; diff --git a/src/test.rs b/src/test.rs index 88e344cc6e..7c87f36de2 100644 --- a/src/test.rs +++ b/src/test.rs @@ -101,6 +101,8 @@ pub fn this_host_triple() -> String { "unknown-linux" } else if cfg!(target_os = "macos") { "apple-darwin" + } else if cfg!(target_os = "illumos") { + "unknown-illumos" } else { unimplemented!() }; diff --git a/www/index.html b/www/index.html index 094e74ed96..f8b5213276 100644 --- a/www/index.html +++ b/www/index.html @@ -84,7 +84,7 @@

I don't recognize your platform.

- rustup runs on Windows, Linux, macOS, FreeBSD and NetBSD. If + rustup runs on Windows, Linux, macOS, FreeBSD, NetBSD, and illumos. If you are on one of these platforms and are seeing this then please report an issue, along with the following values: