Skip to content

Commit 2e05bd8

Browse files
authored
Merge pull request #2432 from jclulow/illumos
add illumos (amd64) support
2 parents 1863453 + d5f60b8 commit 2e05bd8

File tree

10 files changed

+49
-1
lines changed

10 files changed

+49
-1
lines changed

ci/actions-templates/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ system.
4646
| arm-unknown-linux-gnueabihf | Yes | Two | No | No |
4747
| x86_64-unknown-freebsd | Yes | Two | No | No |
4848
| x86_64-unknown-netbsd | Yes | Two | No | No |
49+
| x86_64-unknown-illumos | Yes | Two | No | No |
4950
| powerpc-unknown-linux-gnu | Yes | Two | No | No |
5051
| powerpc64le-unknown-linux-gnu | Yes | Two | No | No |
5152
| mips-unknown-linux-gnu | Yes | Two | No | No |

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

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
- arm-unknown-linux-gnueabihf # skip-pr skip-master
3737
- x86_64-unknown-freebsd # skip-pr skip-master
3838
- x86_64-unknown-netbsd # skip-pr skip-master
39+
- x86_64-unknown-illumos # skip-pr skip-master
3940
- powerpc-unknown-linux-gnu # skip-pr skip-master
4041
- powerpc64le-unknown-linux-gnu # skip-pr skip-master
4142
- mips-unknown-linux-gnu # skip-pr skip-master

ci/cloudfront-invalidation.txt

+2
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe
5353
rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe.sha256
5454
rustup/dist/x86_64-unknown-freebsd/rustup-init
5555
rustup/dist/x86_64-unknown-freebsd/rustup-init.sha256
56+
rustup/dist/x86_64-unknown-illumos/rustup-init
57+
rustup/dist/x86_64-unknown-illumos/rustup-init.sha256
5658
rustup/dist/x86_64-unknown-linux-gnu/rustup-init
5759
rustup/dist/x86_64-unknown-linux-gnu/rustup-init.sha256
5860
rustup/dist/x86_64-unknown-linux-musl/rustup-init
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

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ case "$TARGET" in
3131
powerpc64le-unknown-linux-gnu) image=dist-powerpc64le-linux ;;
3232
s390x-unknown-linux-gnu) image=dist-s390x-linux ;;
3333
x86_64-unknown-freebsd) image=dist-x86_64-freebsd ;;
34+
x86_64-unknown-illumos) image=dist-x86_64-illumos ;;
3435
x86_64-unknown-linux-gnu) image=dist-x86_64-linux ;;
3536
x86_64-unknown-netbsd) image=dist-x86_64-netbsd ;;
3637
riscv64gc-unknown-linux-gnu) image=dist-riscv64-linux ;;

doc/src/installation/other.md

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ choice:
5858
- [x86_64-pc-windows-gnu](https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-gnu/rustup-init.exe)
5959
- [x86_64-pc-windows-msvc](https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe)[^msvc]
6060
- [x86_64-unknown-freebsd](https://static.rust-lang.org/rustup/dist/x86_64-unknown-freebsd/rustup-init)
61+
- [x86_64-unknown-illumos](https://static.rust-lang.org/rustup/dist/x86_64-unknown-illumos/rustup-init)
6162
- [x86_64-unknown-linux-gnu](https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init)
6263
- [x86_64-unknown-linux-musl](https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-musl/rustup-init)
6364
- [x86_64-unknown-netbsd](https://static.rust-lang.org/rustup/dist/x86_64-unknown-netbsd/rustup-init)

rustup-init.sh

+31
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

+2
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",
@@ -259,6 +260,7 @@ impl TargetTriple {
259260
(b"NetBSD", b"x86_64") => Some("x86_64-unknown-netbsd"),
260261
(b"NetBSD", b"i686") => Some("i686-unknown-netbsd"),
261262
(b"DragonFly", b"x86_64") => Some("x86_64-unknown-dragonfly"),
263+
(b"SunOS", b"i86pc") => Some("x86_64-unknown-illumos"),
262264
_ => None,
263265
};
264266

src/test.rs

+2
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ pub fn this_host_triple() -> String {
101101
"unknown-linux"
102102
} else if cfg!(target_os = "macos") {
103103
"apple-darwin"
104+
} else if cfg!(target_os = "illumos") {
105+
"unknown-illumos"
104106
} else {
105107
unimplemented!()
106108
};

www/index.html

+1-1
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)