(gonna try to answer some ill-answered or unanswered questions now)
We seem to have the same experience when building Whisperfish now: the VBox version has problems finding downloaded crates, the Docker version runs just fine.
-j 1
is also used in Whisperfish. There’s a bug in (presumably) SB2, which gets cargo
stuck in a futex when running with “too high level of parallelism”. Eventually, it probably will also lock up on -j 1
, but it seems to deter for now. If dropping the parallelism flag works for you, you could drop it locally. I’d still keep it in CI. I think @flypig may be able to give more context.
You’re probably running the VirtualBox SDK, which seems to behave badly w.r.t. the SB2 tooling-based cross compilation. @direc85 and me are trying to figure out, but it seems like the Docker-based SDK works better.
I use these two scripts to get Rust in a tooling and target:
build.sh
(compiles the actual Rust and Cargo):
#!/bin/sh -ex
ARCHS="i486 armv7hl aarch64"
cd rust
for arch in $ARCHS; do
rpmbuild -bb rust.spec --define "_target_cpu $arch"
done
cd ..
install.sh
(Creates the stub compilers and repackages the stdlib):
#!/bin/sh -ex
ARCHS="i486 armv7hl aarch64"
TOOLING=SailfishOS-4.1
# TARGET=SailfishOS-3.4-on-4.1
TARGET=SailfishOS-4.1
VERSION=1.52.1+git1-1
sudo zypper install ~/rpmbuild/RPMS/i486/rust* ~/rpmbuild/RPMS/i486/cargo* || echo zypper error
cd cross
rpmbuild -bb rust-cross-aarch64.spec
rpmbuild -bb rust-cross-armv7hl.spec
cd ..
mkdir -p /srv/mer/toolings/$TOOLING/tmp/rust-rpms/
for f in ~/rpmbuild/RPMS/i486/rust* ~/rpmbuild/RPMS/i486/cargo*; do
cp $f /srv/mer/toolings/$TOOLING/tmp/rust-rpms/
done
sdk-manage tooling package-install $TOOLING /tmp/rust-rpms/{rust-std-static-i686-unknown-linux-gnu-$VERSION.i486.rpm,rust-std-static-armv7-unknown-linux-gnueabihf-$VERSION.i486.rpm,rust-std-static-aarch64-unknown-linux-gnu-$VERSION.i486.rpm,rust-$VERSION.i486.rpm,cargo-$VERSION.i486.rpm}
rm -rf /srv/mer/toolings/$TOOLING/tmp/rust-rpms/*
for arch in $ARCHS; do
sdk-manage target package-remove $TARGET-$arch rust cargo rust-std-static-i686-unknown-linux-gnu rust-std-static-aarch64-unknown-linux-gnu rust-std-static-armv7-unknown-linux-gnueabihf || echo continuing
done
for arch in $ARCHS; do
sdk-manage target package-install $TARGET-$arch ~/rpmbuild/RPMS/$arch/*
done
These assume that you have https://github.com/sailfishos/rust and https://github.com/sailfishos/rust-cross in directories next to eachother, respectively rust
and cross
. I run these scripts inside the Platform SDK, not in mb2
(these packages used to build in mb2
, but Jolla seems to have changed their strategy for the better here).
On SDK 4.1, you can use the repo on my home server, which hosts the patched cargo
: ssu ar https://nas.rubdos.be/~rsmet/sailfish-repo/ rubdos
. These do not have bumped version numbers, so you have to fiddle a bit with zypper
. If someone has a good suggestion on how to get a personalised version number that will get upped by Jolla, let me know.