Cargo install error: "This is the stub cargo. If you see this, scratchbox2 is not working"


As there is no SailfishOS packaging for librespot for aarch64, I tried to install it using “cargo install librespot” (as described on their GitHub-README), which gives the following error:

[defaultuser@PinePhone ~]$ cargo install librespot
This is the stub cargo. If you see this, scratchbox2 is not working. Called as
/usr/bin/cargo install librespot

Is there something I can do to fix this, or is the installation of packages with cargo just not possible on SailfishOS?

1 Like

I’m not sure you can compile rust directly on your device. Look at the section Building from source from whisperfish to get an idea how to compile rust.

Edit: Oh, and if you’re motivated it would be very nice to submit a PR to improve Sailfish’s documentation.


I tried to use the instructions of Whisperfish, but then I discovered that librespot (obviously) doesn’t include a .spec file and therefore sfdk complains about that.

As I don’t know how to write such a file, I will leave this for now.

Working for me…

How did you install rust?

curl option here is best - Install Rust - Rust Programming Language

Not sure what it is or what it does, but seems to be working…

1 Like

It’d be really great to some how get this into the librespot sailfish-spotify · GitHub context. I’ve ‘sort of’ pushed to get hutspot into chum, which is fine, but lacks a method of building librespot reliably.

I could easily make aarch64 rpm, if you want, (cargo-rpm)


It’d be really helpful to know if building from can be reproduced. I just haven’t had the time to see if that works. But you, obviously, have a clue.

If the info there is NOT usable, I have commit access and can update instructions. I just don’t have time for futzing about with rust builds at the moment.

I also don’t know if this can be done on obs/chum?

I’ll try… Meanwhile, here’s this, if anyone wants - 2.57 MB file on MEGA

1 Like

Copying source and running ‘cargo build’ fails…

error is
error: failed to run custom build command for portaudio-sys v0.1.1

Ok, I’ll see if I can track that down.
EDIT: The sailfish repo is way far behind upstream. And the portaudio patches, among other things are from 1.22 (we have 1.5x). This is going to need some love from a rust dev.

Just to check, you just pulled from the main repo at: and built directly?

Oops - sorry, no… I just hastily saw your link in post 9 and thought you wanted to test that one…

This one builds fine…

Wow, thank you! I will try it again to compile for myself at some point, if it works so easy for you. Did you build directly on a SailfishOS-Device?

Thanks for confirming! I’ll see if I can find someone to help.

Yes - just run curl commamd, and rust installed. Then just run cargo install (whatever), or download source & cd and run cargo build…

1 Like

Thank very much you for your help!