Skip to content

Commit c81946b

Browse files
committed
Fix *-solaris targets
Adapted from rust-lang/rust#108951 and rust-lang/rust#81229.
1 parent 60017d6 commit c81946b

File tree

4 files changed

+29
-10
lines changed

4 files changed

+29
-10
lines changed

.changes/1495.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"description": "Fix `*-solaris` targets",
3+
"issues": [1424],
4+
"type": "fixed",
5+
"breaking": true
6+
}

docker/solaris.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,28 +57,33 @@ main() {
5757
esac
5858

5959
apt-key adv --batch --yes --keyserver keyserver.ubuntu.com --recv-keys 74DA7924C5513486
60-
add-apt-repository -y 'deb http://apt.dilos.org/dilos dilos2-testing main'
60+
add-apt-repository -y 'deb http://apt.dilos.org/dilos dilos2 main'
6161
dpkg --add-architecture "${apt_arch}"
6262
apt-get update
63-
# shellcheck disable=SC2046
64-
apt-get download $(apt-cache depends --recurse --no-replaces \
63+
apt-get install -y --download-only \
6564
"libc:${apt_arch}" \
66-
"liblgrp-dev:${apt_arch}" \
6765
"liblgrp:${apt_arch}" \
6866
"libm-dev:${apt_arch}" \
6967
"libpthread:${apt_arch}" \
7068
"libresolv:${apt_arch}" \
7169
"librt:${apt_arch}" \
72-
"libsendfile-dev:${apt_arch}" \
7370
"libsendfile:${apt_arch}" \
7471
"libsocket:${apt_arch}" \
7572
"system-crt:${apt_arch}" \
76-
"system-header:${apt_arch}" \
77-
| grep "^\w")
73+
"system-header:${apt_arch}"
7874

79-
for deb in *"${apt_arch}.deb"; do
75+
for deb in /var/cache/apt/archives/*"${apt_arch}.deb"; do
8076
dpkg -x "${deb}" "${td}/solaris"
8177
done
78+
apt-get clean
79+
80+
# The -dev packages are not available from the apt repository we're using.
81+
# However, those packages are just symlinks from *.so to *.so.<version>.
82+
# This makes all those symlinks.
83+
while IFS= read -r -d '' lib; do
84+
link_name=${lib%.so.*}.so
85+
[ -e "$link_name" ] || ln -sf "${lib##*/}" "$link_name"
86+
done < <(find . -name '*.so.*' -print0)
8287

8388
cd binutils-build
8489
../binutils/configure \

src/docker/provided_images.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,16 @@ pub static PROVIDED_IMAGES: &[ProvidedImage] = &[
228228
platforms: &[ImagePlatform::X86_64_UNKNOWN_LINUX_GNU],
229229
sub: None
230230
},
231+
ProvidedImage {
232+
name: "sparcv9-sun-solaris",
233+
platforms: &[ImagePlatform::X86_64_UNKNOWN_LINUX_GNU],
234+
sub: None
235+
},
236+
ProvidedImage {
237+
name: "x86_64-pc-solaris",
238+
platforms: &[ImagePlatform::X86_64_UNKNOWN_LINUX_GNU],
239+
sub: None
240+
},
231241
ProvidedImage {
232242
name: "x86_64-unknown-illumos",
233243
platforms: &[ImagePlatform::X86_64_UNKNOWN_LINUX_GNU],

targets.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,15 +447,13 @@ dylib = true
447447
std = true
448448

449449
[[target]]
450-
disabled = true # https://github.com/cross-rs/cross/issues/1424
451450
target = "sparcv9-sun-solaris"
452451
os = "ubuntu-latest"
453452
cpp = true
454453
dylib = true
455454
std = true
456455

457456
[[target]]
458-
disabled = true # https://github.com/cross-rs/cross/issues/1424
459457
target = "x86_64-pc-solaris"
460458
os = "ubuntu-latest"
461459
cpp = true

0 commit comments

Comments
 (0)