Add Rust toolchain support for Solaris-based environments

This commit updates the Solstice job script to install the Rust toolchain (`developer/rustc`) via the IPS package manager on Solaris-based systems (SunOS). It also adjusts the `ensure_rust` function to prioritize system package installation before falling back to `rustup`.
This commit is contained in:
Till Wegmueller 2025-11-01 15:03:09 +01:00
parent 033f9b5ab0
commit 7ca7966916
No known key found for this signature in database

View file

@ -51,7 +51,7 @@ install_illumos() {
if command -v pkg >/dev/null 2>&1; then if command -v pkg >/dev/null 2>&1; then
# OpenIndiana IPS packages (best-effort) # OpenIndiana IPS packages (best-effort)
sudo pkg refresh || true sudo pkg refresh || true
sudo pkg install -v developer/build/gnu-make developer/gcc-13 git developer/protobuf || true sudo pkg install -v developer/build/gnu-make developer/gcc-13 git developer/protobuf developer/rustc || true
elif command -v pkgin >/dev/null 2>&1; then elif command -v pkgin >/dev/null 2>&1; then
sudo pkgin -y install git gcc gmake protobuf || true sudo pkgin -y install git gcc gmake protobuf || true
else else
@ -61,6 +61,13 @@ install_illumos() {
ensure_rust() { ensure_rust() {
if command -v cargo >/dev/null 2>&1; then return 0; fi if command -v cargo >/dev/null 2>&1; then return 0; fi
OS=$(uname -s 2>/dev/null || echo unknown)
if [ "$OS" = "SunOS" ] && command -v pkg >/dev/null 2>&1; then
log "installing Rust toolchain via IPS package manager (developer/rustc)"
sudo pkg refresh || true
sudo pkg install -v developer/rustc || true
if command -v cargo >/dev/null 2>&1; then return 0; fi
fi
log "installing Rust toolchain with rustup" log "installing Rust toolchain with rustup"
curl -fsSL https://sh.rustup.rs | sh -s -- -y curl -fsSL https://sh.rustup.rs | sh -s -- -y
# shellcheck disable=SC1091 # shellcheck disable=SC1091