[GH-ISSUE #1573] cross-compiling for arm fails without --features rustls-tls-native-roots #716

Closed
opened 2026-02-27 19:32:06 +03:00 by kerem · 2 comments
Owner

Originally created by @sethtroisi on GitHub (Sep 6, 2025).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1573

Description

Leaving this here in case other people are having the same problem. Ultimately I just want a armv7hf binary I can scp to my RPi 3B+.

I had to add --features rustls-tls-native-roots to the cross compile command to get it to succeed

docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features alsa-backend --features rustls-tls-native-roots

My understanding is

  • binary from CI aren't saved
  • publish.sh only pushes source not binary to crates.io

So I tried to follow the cross-compiling guide

Version

head (0.7.1)

How to reproduce

  1. Docker builds successfully with `sudo docker build -t librespot-cross -f contrib/Dockerfile .
  2. running the cross-compiler has issues with tls see Log below
    docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features alsa-backend

I tried adding --features native-tls but that didn't work

Log

$ docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features alsa-backend

error: Either feature "native-tls" (default), "rustls-tls-native-roots" or "rustls-tls-webpki-roots" must be enabled for this crate.
  --> oauth/src/lib.rs:48:1
   |
48 | / compile_error!(
49 | |     "Either feature \"native-tls\" (default), \"rustls-tls-native-roots\" or \"rustls-tls-webpki-roots\" must be enabled for this crate."
50 | | );
   | |_^
$ docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features alsa-backend --features native-tls

  cargo:warning=Could not find directory of OpenSSL installation, and this `-sys` crate cannot proceed without this knowledge. If OpenSSL is installed and this crate had trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the compilation process. See stderr section below for further information.
$ docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features alsa-backend --features rustls-tls-native-roots


Host (what you are running librespot on):

Building on Linux, x86_64

Trying to cross-compile for armhf e.g. RPi 3B+

Originally created by @sethtroisi on GitHub (Sep 6, 2025). Original GitHub issue: https://github.com/librespot-org/librespot/issues/1573 ### Description Leaving this here in case other people are having the same problem. Ultimately I just want a armv7hf binary I can scp to my RPi 3B+. I had to add `--features rustls-tls-native-roots` to the cross compile command to get it to succeed `docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features alsa-backend --features rustls-tls-native-roots` My understanding is * binary from CI aren't saved * publish.sh only pushes source not binary to crates.io So I tried to follow the [cross-compiling guide](https://github.com/librespot-org/librespot/wiki/Cross-compiling) ### Version head (0.7.1) ### How to reproduce 1. Docker builds successfully with `sudo docker build -t librespot-cross -f contrib/Dockerfile . 2. running the cross-compiler has issues with tls see Log below `docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features alsa-backend` I tried adding `--features native-tls` but that didn't work ### Log ``` $ docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features alsa-backend error: Either feature "native-tls" (default), "rustls-tls-native-roots" or "rustls-tls-webpki-roots" must be enabled for this crate. --> oauth/src/lib.rs:48:1 | 48 | / compile_error!( 49 | | "Either feature \"native-tls\" (default), \"rustls-tls-native-roots\" or \"rustls-tls-webpki-roots\" must be enabled for this crate." 50 | | ); | |_^ ``` ``` $ docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features alsa-backend --features native-tls cargo:warning=Could not find directory of OpenSSL installation, and this `-sys` crate cannot proceed without this knowledge. If OpenSSL is installed and this crate had trouble finding it, you can set the `OPENSSL_DIR` environment variable for the compilation process. See stderr section below for further information. ``` ``` $ docker run -v /tmp/librespot-build:/build librespot-cross cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features alsa-backend --features rustls-tls-native-roots ``` ### Host (what you are running `librespot` on): Building on Linux, x86_64 Trying to cross-compile for armhf e.g. RPi 3B+
kerem 2026-02-27 19:32:06 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@roderickvd commented on GitHub (Sep 6, 2025):

To succeed building with native TLS, you need to install the OpenSSL libraries.

<!-- gh-comment-id:3261123311 --> @roderickvd commented on GitHub (Sep 6, 2025): To succeed building with native TLS, you need to install the OpenSSL libraries.
Author
Owner

@kingosticks commented on GitHub (Sep 6, 2025):

Maybe the wiki could be more explicit about requiring which additional packages. Or should they already be present in the docker container? I'm not sure how the cargo cross system works, I never got on with it!

<!-- gh-comment-id:3261418294 --> @kingosticks commented on GitHub (Sep 6, 2025): Maybe the wiki could be more explicit about requiring which additional packages. Or should they already be present in the docker container? I'm not sure how the cargo cross system works, I never got on with it!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#716
No description provided.