Skip to content

Commit bb9bdc5

Browse files
committed
add illumos (amd64) support
1 parent ac1a8c4 commit bb9bdc5

File tree

10 files changed

+49
-1
lines changed

10 files changed

+49
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,7 @@ platform of your choice:
773773
- [x86_64-pc-windows-gnu](https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-gnu/rustup-init.exe)
774774
- [x86_64-pc-windows-msvc](https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe)<sup>[](#vs2019)</sup>
775775
- [x86_64-unknown-freebsd](https://static.rust-lang.org/rustup/dist/x86_64-unknown-freebsd/rustup-init)
776+
- [x86_64-unknown-illumos](https://static.rust-lang.org/rustup/dist/x86_64-unknown-illumos/rustup-init)
776777
- [x86_64-unknown-linux-gnu](https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init)
777778
- [x86_64-unknown-linux-musl](https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-musl/rustup-init)
778779
- [x86_64-unknown-netbsd](https://static.rust-lang.org/rustup/dist/x86_64-unknown-netbsd/rustup-init)

ci/actions-templates/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ system.
4545
| arm-unknown-linux-gnueabihf | Yes | Two | No | No |
4646
| x86_64-unknown-freebsd | Yes | Two | No | No |
4747
| x86_64-unknown-netbsd | Yes | Two | No | No |
48+
| x86_64-unknown-illumos | Yes | Two | No | No |
4849
| powerpc-unknown-linux-gnu | Yes | Two | No | No |
4950
| powerpc64le-unknown-linux-gnu | Yes | Two | No | No |
5051
| mips-unknown-linux-gnu | Yes | Two | No | No |

ci/actions-templates/linux-builds-template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
- arm-unknown-linux-gnueabihf # skip-pr skip-master
3636
- x86_64-unknown-freebsd # skip-pr skip-master
3737
- x86_64-unknown-netbsd # skip-pr skip-master
38+
- x86_64-unknown-illumos # skip-pr skip-master
3839
- powerpc-unknown-linux-gnu # skip-pr skip-master
3940
- powerpc64le-unknown-linux-gnu # skip-pr skip-master
4041
- mips-unknown-linux-gnu # skip-pr skip-master

ci/cloudfront-invalidation.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe
5151
rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe.sha256
5252
rustup/dist/x86_64-unknown-freebsd/rustup-init
5353
rustup/dist/x86_64-unknown-freebsd/rustup-init.sha256
54+
rustup/dist/x86_64-unknown-illumos/rustup-init
55+
rustup/dist/x86_64-unknown-illumos/rustup-init.sha256
5456
rustup/dist/x86_64-unknown-linux-gnu/rustup-init
5557
rustup/dist/x86_64-unknown-linux-gnu/rustup-init.sha256
5658
rustup/dist/x86_64-unknown-linux-musl/rustup-init
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM rust-x86_64-unknown-illumos
2+
3+
ENV \
4+
AR_x86_64_unknown_illumos=x86_64-illumos-ar \
5+
CC_x86_64_unknown_illumos=x86_64-illumos-gcc \
6+
CXX_x86_64_unknown_illumos=x86_64-illumos-g++ \
7+
CARGO_TARGET_X86_64_UNKNOWN_ILLUMOS_LINKER=x86_64-illumos-gcc

ci/fetch-rust-docker.bash

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ case "$TARGET" in
3030
powerpc64le-unknown-linux-gnu) image=dist-powerpc64le-linux ;;
3131
s390x-unknown-linux-gnu) image=dist-s390x-linux ;;
3232
x86_64-unknown-freebsd) image=dist-x86_64-freebsd ;;
33+
x86_64-unknown-illumos) image=dist-x86_64-illumos ;;
3334
x86_64-unknown-linux-gnu) image=dist-x86_64-linux ;;
3435
x86_64-unknown-netbsd) image=dist-x86_64-netbsd ;;
3536
riscv64gc-unknown-linux-gnu) image=dist-riscv64-linux ;;

rustup-init.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88
# It runs on Unix shells like {a,ba,da,k,z}sh. It uses the common `local`
99
# extension. Note: Most shells limit `local` to 1 var per line, contra bash.
1010

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

1322
# If RUSTUP_UPDATE_ROOT is unset or empty, default it.
@@ -192,6 +201,24 @@ get_architecture() {
192201
fi
193202
fi
194203

204+
if [ "$_ostype" = SunOS ]; then
205+
# Both Solaris and illumos presently announce as "SunOS" in "uname -s"
206+
# so use "uname -o" to disambiguate. We use the full path to the
207+
# system uname in case the user has coreutils uname first in PATH,
208+
# which has historically sometimes printed the wrong value here.
209+
if [ "$(/usr/bin/uname -o)" = illumos ]; then
210+
_ostype=illumos
211+
fi
212+
213+
# illumos systems have multi-arch userlands, and "uname -m" reports the
214+
# machine hardware name; e.g., "i86pc" on both 32- and 64-bit x86
215+
# systems. Check for the native (widest) instruction set on the
216+
# running kernel:
217+
if [ "$_cputype" = i86pc ]; then
218+
_cputype="$(isainfo -n)"
219+
fi
220+
fi
221+
195222
case "$_ostype" in
196223

197224
Android)
@@ -219,6 +246,10 @@ get_architecture() {
219246
_ostype=apple-darwin
220247
;;
221248

249+
illumos)
250+
_ostype=unknown-illumos
251+
;;
252+
222253
MINGW* | MSYS* | CYGWIN*)
223254
_ostype=pc-windows-gnu
224255
;;

src/dist/dist.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ static LIST_OSES: &[&str] = &[
103103
"linux",
104104
"rumprun-netbsd",
105105
"unknown-freebsd",
106+
"unknown-illumos",
106107
];
107108
static LIST_ENVS: &[&str] = &[
108109
"gnu",
@@ -255,6 +256,7 @@ impl TargetTriple {
255256
(b"NetBSD", b"x86_64") => Some("x86_64-unknown-netbsd"),
256257
(b"NetBSD", b"i686") => Some("i686-unknown-netbsd"),
257258
(b"DragonFly", b"x86_64") => Some("x86_64-unknown-dragonfly"),
259+
(b"SunOS", b"i86pc") => Some("x86_64-unknown-illumos"),
258260
_ => None,
259261
};
260262

src/test.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ pub fn this_host_triple() -> String {
102102
"unknown-linux"
103103
} else if cfg!(target_os = "macos") {
104104
"apple-darwin"
105+
} else if cfg!(target_os = "illumos") {
106+
"unknown-illumos"
105107
} else {
106108
unimplemented!()
107109
};

www/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
<!-- unrecognized platform: ask for help -->
8585
<p>I don't recognize your platform.</p>
8686
<p>
87-
rustup runs on Windows, Linux, macOS, FreeBSD and NetBSD. If
87+
rustup runs on Windows, Linux, macOS, FreeBSD, NetBSD, and illumos. If
8888
you are on one of these platforms and are seeing this then please
8989
<a href="https://github.com/rust-lang/rustup/issues/new">report an issue</a>,
9090
along with the following values:

0 commit comments

Comments
 (0)