Skip to content

Commit

Permalink
Merge pull request #2432 from jclulow/illumos
Browse files Browse the repository at this point in the history
add illumos (amd64) support
  • Loading branch information
kinnison authored Oct 28, 2020
2 parents 1863453 + d5f60b8 commit 2e05bd8
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 1 deletion.
1 change: 1 addition & 0 deletions ci/actions-templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
1 change: 1 addition & 0 deletions ci/actions-templates/linux-builds-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions ci/cloudfront-invalidation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions ci/docker/x86_64-unknown-illumos/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions ci/fetch-rust-docker.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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 ;;
Expand Down
1 change: 1 addition & 0 deletions doc/src/installation/other.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
31 changes: 31 additions & 0 deletions rustup-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -219,6 +246,10 @@ get_architecture() {
_ostype=apple-darwin
;;

illumos)
_ostype=unknown-illumos
;;

MINGW* | MSYS* | CYGWIN*)
_ostype=pc-windows-gnu
;;
Expand Down
2 changes: 2 additions & 0 deletions src/dist/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ static LIST_OSES: &[&str] = &[
"linux",
"rumprun-netbsd",
"unknown-freebsd",
"unknown-illumos",
];
static LIST_ENVS: &[&str] = &[
"gnu",
Expand Down Expand Up @@ -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,
};

Expand Down
2 changes: 2 additions & 0 deletions src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!()
};
Expand Down
2 changes: 1 addition & 1 deletion www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<!-- unrecognized platform: ask for help -->
<p>I don't recognize your platform.</p>
<p>
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
<a href="https://github.com/rust-lang/rustup/issues/new">report an issue</a>,
along with the following values:
Expand Down

0 comments on commit 2e05bd8

Please sign in to comment.