[GH-ISSUE #1447] Build error of v0.6.0 on raspberry pi -- aws-lc-sys fails #650

Closed
opened 2026-02-27 19:31:46 +03:00 by kerem · 10 comments
Owner

Originally created by @kalj on GitHub (Jan 18, 2025).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1447

Description

librespot v0.6.0 fails to build with cargo install on a Raspberry Pi 3 with Raspbian 11. It seems like the dependency aws-lc-sys 0.25.0 encounters some strange build error where it complains about stddef.h not existing...

Version

Version 0.6.0 (maybe others)

How to reproduce

Do cargo install librespot.

Log

warning: aws-lc-sys@0.25.0: Building with: CMake
warning: aws-lc-sys@0.25.0: Symbol Prefix: Some("aws_lc_0_25_0")
warning: aws-lc-sys@0.25.0: CMAKE environment variable set: cmake
warning: aws-lc-sys@0.25.0: Clang version: Raspbian clang version 11.0.1-2+rpi1
warning: aws-lc-sys@0.25.0: Generating bindings - internal bindgen. Platform: armv7-unknown-linux-gnueabihf
error: failed to run custom build command for `aws-lc-sys v0.25.0`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installo65HFN/release/build/aws-lc-sys-d1bc584b739d5232/build-script-main` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=AWS_LC_SYS_NO_PREFIX
  cargo:rerun-if-env-changed=AWS_LC_SYS_PREGENERATING_BINDINGS
  cargo:rerun-if-env-changed=AWS_LC_SYS_EXTERNAL_BINDGEN
  cargo:rerun-if-env-changed=AWS_LC_SYS_NO_ASM
  cargo:rerun-if-env-changed=AWS_LC_SYS_CFLAGS
  cargo:rerun-if-env-changed=AWS_LC_SYS_PREBUILT_NASM
  cargo:rerun-if-env-changed=AWS_LC_SYS_C_STD
  cargo:rerun-if-env-changed=AWS_LC_SYS_CMAKE_BUILDER
  cargo:rerun-if-env-changed=AWS_LC_SYS_STATIC
  cargo:rerun-if-env-changed=CMAKE
  cargo:warning=Building with: CMake
  cargo:warning=Symbol Prefix: Some("aws_lc_0_25_0")
  cargo:rerun-if-env-changed=CMAKE
  cargo:warning=CMAKE environment variable set: cmake
  cargo:warning=Clang version: Raspbian clang version 11.0.1-2+rpi1
  cargo:warning=Generating bindings - internal bindgen. Platform: armv7-unknown-linux-gnueabihf
  cargo:rerun-if-env-changed=AWS_LC_SYS_INCLUDES

  --- stderr
  /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/aws-lc-sys-0.25.0/aws-lc/include/openssl/base.h:59:10: fatal error: 'stddef.h' file not found
  thread 'main' panicked at /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/aws-lc-sys-0.25.0/builder/sys_bindgen.rs:106:10:
  Unable to generate bindings.: ClangDiagnostic("/home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/aws-lc-sys-0.25.0/aws-lc/include/openssl/base.h:59:10: fatal error: 'stddef.h' file not found\n")
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `librespot v0.6.0`, intermediate artifacts can be found at `/tmp/cargo-installo65HFN`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Host (what you are running librespot on):

  • OS: Raspbian 11
  • Platform: RPi 3B+
Originally created by @kalj on GitHub (Jan 18, 2025). Original GitHub issue: https://github.com/librespot-org/librespot/issues/1447 ### Description `librespot` v0.6.0 fails to build with cargo install on a Raspberry Pi 3 with Raspbian 11. It seems like the dependency `aws-lc-sys` 0.25.0 encounters some strange build error where it complains about `stddef.h` not existing... ### Version Version 0.6.0 (maybe others) ### How to reproduce Do cargo install librespot. ### Log ``` warning: aws-lc-sys@0.25.0: Building with: CMake warning: aws-lc-sys@0.25.0: Symbol Prefix: Some("aws_lc_0_25_0") warning: aws-lc-sys@0.25.0: CMAKE environment variable set: cmake warning: aws-lc-sys@0.25.0: Clang version: Raspbian clang version 11.0.1-2+rpi1 warning: aws-lc-sys@0.25.0: Generating bindings - internal bindgen. Platform: armv7-unknown-linux-gnueabihf error: failed to run custom build command for `aws-lc-sys v0.25.0` Caused by: process didn't exit successfully: `/tmp/cargo-installo65HFN/release/build/aws-lc-sys-d1bc584b739d5232/build-script-main` (exit status: 101) --- stdout cargo:rerun-if-env-changed=AWS_LC_SYS_NO_PREFIX cargo:rerun-if-env-changed=AWS_LC_SYS_PREGENERATING_BINDINGS cargo:rerun-if-env-changed=AWS_LC_SYS_EXTERNAL_BINDGEN cargo:rerun-if-env-changed=AWS_LC_SYS_NO_ASM cargo:rerun-if-env-changed=AWS_LC_SYS_CFLAGS cargo:rerun-if-env-changed=AWS_LC_SYS_PREBUILT_NASM cargo:rerun-if-env-changed=AWS_LC_SYS_C_STD cargo:rerun-if-env-changed=AWS_LC_SYS_CMAKE_BUILDER cargo:rerun-if-env-changed=AWS_LC_SYS_STATIC cargo:rerun-if-env-changed=CMAKE cargo:warning=Building with: CMake cargo:warning=Symbol Prefix: Some("aws_lc_0_25_0") cargo:rerun-if-env-changed=CMAKE cargo:warning=CMAKE environment variable set: cmake cargo:warning=Clang version: Raspbian clang version 11.0.1-2+rpi1 cargo:warning=Generating bindings - internal bindgen. Platform: armv7-unknown-linux-gnueabihf cargo:rerun-if-env-changed=AWS_LC_SYS_INCLUDES --- stderr /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/aws-lc-sys-0.25.0/aws-lc/include/openssl/base.h:59:10: fatal error: 'stddef.h' file not found thread 'main' panicked at /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/aws-lc-sys-0.25.0/builder/sys_bindgen.rs:106:10: Unable to generate bindings.: ClangDiagnostic("/home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/aws-lc-sys-0.25.0/aws-lc/include/openssl/base.h:59:10: fatal error: 'stddef.h' file not found\n") note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... error: failed to compile `librespot v0.6.0`, intermediate artifacts can be found at `/tmp/cargo-installo65HFN`. To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path. ``` ### Host (what you are running `librespot` on): - OS: Raspbian 11 - Platform: RPi 3B+
kerem 2026-02-27 19:31:46 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@photovoltex commented on GitHub (Jan 18, 2025):

I think I encountered that problem recently and it had something to do in regards to build dependencies I think.

You could try to install a matching clang for your distro that is mentioned here and it might just work.

https://rust-lang.github.io/rust-bindgen/requirements.html

<!-- gh-comment-id:2599843200 --> @photovoltex commented on GitHub (Jan 18, 2025): I think I encountered that problem recently and it had something to do in regards to build dependencies I think. You could try to install a matching clang for your distro that is mentioned here and it might just work. https://rust-lang.github.io/rust-bindgen/requirements.html
Author
Owner

@kalj commented on GitHub (Jan 19, 2025):

Hm, it says clang 9 or greater whereas I have clang 11. That ought to be sufficient.

<!-- gh-comment-id:2600826389 --> @kalj commented on GitHub (Jan 19, 2025): Hm, it says clang 9 or greater whereas I have clang 11. That ought to be sufficient.
Author
Owner

@kingosticks commented on GitHub (Jan 19, 2025):

How did you install bindgen? Is it from apt or cargo?

<!-- gh-comment-id:2600836886 --> @kingosticks commented on GitHub (Jan 19, 2025): How did you install bindgen? Is it from apt or cargo?
Author
Owner

@kalj commented on GitHub (Jan 22, 2025):

How did you install bindgen? Is it from apt or cargo?

I was under the impression that it is being pulled in by cargo. I definitely don't have it installed using apt.

<!-- gh-comment-id:2607470358 --> @kalj commented on GitHub (Jan 22, 2025): > How did you install bindgen? Is it from apt or cargo? I was under the impression that it is being pulled in by cargo. I definitely don't have it installed using apt.
Author
Owner

@photovoltex commented on GitHub (Jan 22, 2025):

Then installing bindgen-cli might fix the issue. Here (https://aws.github.io/aws-lc-rs/requirements/linux.html#bindgen-cli) are the requirements for aws-lc-rs that I wanted to link previously but didn't found.

When we compile to "other" platforms, which includes your targeted platform armv7-unknown-linux-gnueabihf, it requires the bindgen-cli as prerequisite.

<!-- gh-comment-id:2607833992 --> @photovoltex commented on GitHub (Jan 22, 2025): Then installing `bindgen-cli` might fix the issue. Here (https://aws.github.io/aws-lc-rs/requirements/linux.html#bindgen-cli) are the requirements for `aws-lc-rs` that I wanted to link previously but didn't found. When we compile to "other" platforms, which includes your targeted platform `armv7-unknown-linux-gnueabihf`, it requires the `bindgen-cli` as prerequisite.
Author
Owner

@kalj commented on GitHub (Jan 22, 2025):

Alright, installing bindgen-cli using cargo now, then trying again!

<!-- gh-comment-id:2608006260 --> @kalj commented on GitHub (Jan 22, 2025): Alright, installing bindgen-cli using cargo now, then trying again!
Author
Owner

@kalj commented on GitHub (Jan 22, 2025):

I seem to be getting the exact same error:

warning: aws-lc-sys@0.25.0: Building with: CMake                                   
warning: aws-lc-sys@0.25.0: Symbol Prefix: Some("aws_lc_0_25_0")                   
warning: aws-lc-sys@0.25.0: CMAKE environment variable set: cmake                  
warning: aws-lc-sys@0.25.0: Clang version: Raspbian clang version 11.0.1-2+rpi1    
warning: aws-lc-sys@0.25.0: Generating bindings - internal bindgen. Platform: armv7-unknown-linux-gnueabihf                                                           
error: failed to run custom build command for `aws-lc-sys v0.25.0`                 
                                                                                   
Caused by:                                                                         
  process didn't exit successfully: `/tmp/cargo-installqBKXM2/release/build/aws-lc-sys-ef6deae880932b87/build-script-main` (exit status: 101)                         
  --- stdout                                                                       
  cargo:rerun-if-env-changed=AWS_LC_SYS_NO_PREFIX                                  
  cargo:rerun-if-env-changed=AWS_LC_SYS_PREGENERATING_BINDINGS                     
  cargo:rerun-if-env-changed=AWS_LC_SYS_EXTERNAL_BINDGEN                           
  cargo:rerun-if-env-changed=AWS_LC_SYS_NO_ASM                                     
  cargo:rerun-if-env-changed=AWS_LC_SYS_CFLAGS                                     
  cargo:rerun-if-env-changed=AWS_LC_SYS_PREBUILT_NASM                              
  cargo:rerun-if-env-changed=AWS_LC_SYS_C_STD                                      
  cargo:rerun-if-env-changed=AWS_LC_SYS_CMAKE_BUILDER                              
  cargo:rerun-if-env-changed=AWS_LC_SYS_STATIC                                     
  cargo:rerun-if-env-changed=CMAKE                                                 
  cargo:warning=Building with: CMake                                               
  cargo:warning=Symbol Prefix: Some("aws_lc_0_25_0")                               
  cargo:rerun-if-env-changed=CMAKE                                                 
  cargo:warning=CMAKE environment variable set: cmake                              
  cargo:warning=Clang version: Raspbian clang version 11.0.1-2+rpi1                
  cargo:warning=Generating bindings - internal bindgen. Platform: armv7-unknown-linux-gnueabihf                                                                       
  cargo:rerun-if-env-changed=AWS_LC_SYS_INCLUDES                                   
                                                                                   
  --- stderr                                                                       
  /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/aws-lc-sys-0.25.0/aws-lc/include/openssl/base.h:59:10: fatal error: 'stddef.h' file not found         
  thread 'main' panicked at /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/aws-lc-sys-0.25.0/builder/sys_bindgen.rs:106:10:                            
  Unable to generate bindings.: ClangDiagnostic("/home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/aws-lc-sys-0.25.0/aws-lc/include/openssl/base.h:59:10: fatal error: 'stddef.h' file not found\n")                                         
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace    
warning: build failed, waiting for other jobs to finish...                         
error: failed to compile `librespot v0.6.0`, intermediate artifacts can be found at `/tmp/cargo-installqBKXM2`.                                                       
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path. 

Or maybe this line tells me that I did not in fact get my installed bindgen:

warning: aws-lc-sys@0.25.0: Generating bindings - internal bindgen. 

Did I?

<!-- gh-comment-id:2608190391 --> @kalj commented on GitHub (Jan 22, 2025): I seem to be getting the exact same error: ``` warning: aws-lc-sys@0.25.0: Building with: CMake warning: aws-lc-sys@0.25.0: Symbol Prefix: Some("aws_lc_0_25_0") warning: aws-lc-sys@0.25.0: CMAKE environment variable set: cmake warning: aws-lc-sys@0.25.0: Clang version: Raspbian clang version 11.0.1-2+rpi1 warning: aws-lc-sys@0.25.0: Generating bindings - internal bindgen. Platform: armv7-unknown-linux-gnueabihf error: failed to run custom build command for `aws-lc-sys v0.25.0` Caused by: process didn't exit successfully: `/tmp/cargo-installqBKXM2/release/build/aws-lc-sys-ef6deae880932b87/build-script-main` (exit status: 101) --- stdout cargo:rerun-if-env-changed=AWS_LC_SYS_NO_PREFIX cargo:rerun-if-env-changed=AWS_LC_SYS_PREGENERATING_BINDINGS cargo:rerun-if-env-changed=AWS_LC_SYS_EXTERNAL_BINDGEN cargo:rerun-if-env-changed=AWS_LC_SYS_NO_ASM cargo:rerun-if-env-changed=AWS_LC_SYS_CFLAGS cargo:rerun-if-env-changed=AWS_LC_SYS_PREBUILT_NASM cargo:rerun-if-env-changed=AWS_LC_SYS_C_STD cargo:rerun-if-env-changed=AWS_LC_SYS_CMAKE_BUILDER cargo:rerun-if-env-changed=AWS_LC_SYS_STATIC cargo:rerun-if-env-changed=CMAKE cargo:warning=Building with: CMake cargo:warning=Symbol Prefix: Some("aws_lc_0_25_0") cargo:rerun-if-env-changed=CMAKE cargo:warning=CMAKE environment variable set: cmake cargo:warning=Clang version: Raspbian clang version 11.0.1-2+rpi1 cargo:warning=Generating bindings - internal bindgen. Platform: armv7-unknown-linux-gnueabihf cargo:rerun-if-env-changed=AWS_LC_SYS_INCLUDES --- stderr /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/aws-lc-sys-0.25.0/aws-lc/include/openssl/base.h:59:10: fatal error: 'stddef.h' file not found thread 'main' panicked at /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/aws-lc-sys-0.25.0/builder/sys_bindgen.rs:106:10: Unable to generate bindings.: ClangDiagnostic("/home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/aws-lc-sys-0.25.0/aws-lc/include/openssl/base.h:59:10: fatal error: 'stddef.h' file not found\n") note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... error: failed to compile `librespot v0.6.0`, intermediate artifacts can be found at `/tmp/cargo-installqBKXM2`. To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path. ``` Or maybe this line tells me that I did not in fact get my installed bindgen: ``` warning: aws-lc-sys@0.25.0: Generating bindings - internal bindgen. ``` Did I?
Author
Owner

@photovoltex commented on GitHub (Jan 22, 2025):

Do you have $HOME/.cargo/bin added to your PATH? If not you may need to add the directory to your path and restart the shell.

Another point is that the error you are getting points to a clang issue from a quick search. So maybe try installing a different clang version. Just to rule out that the clang version of raspbian is incompatible.

Besides, could you not just install a cross compiled version of the binary? We provided some scripts here to compile them yourself using docker https://github.com/librespot-org/librespot/tree/dev/contrib

<!-- gh-comment-id:2608229189 --> @photovoltex commented on GitHub (Jan 22, 2025): Do you have `$HOME/.cargo/bin` added to your PATH? If not you may need to add the directory to your path and restart the shell. Another point is that the error you are getting points to a clang issue from a quick search. So maybe try installing a different clang version. _Just to rule out that the clang version of raspbian is incompatible._ Besides, could you not just install a cross compiled version of the binary? We provided some scripts here to compile them yourself using docker https://github.com/librespot-org/librespot/tree/dev/contrib
Author
Owner

@kingosticks commented on GitHub (Jan 22, 2025):

Sounds like https://github.com/rust-lang/rust-bindgen/issues/242#issuecomment-1152747511

<!-- gh-comment-id:2608261590 --> @kingosticks commented on GitHub (Jan 22, 2025): Sounds like https://github.com/rust-lang/rust-bindgen/issues/242#issuecomment-1152747511
Author
Owner

@kalj commented on GitHub (Jan 23, 2025):

Sounds like rust-lang/rust-bindgen#242 (comment)

Wow, yeah that turned out to be it! Thanks!

<!-- gh-comment-id:2609173280 --> @kalj commented on GitHub (Jan 23, 2025): > Sounds like [rust-lang/rust-bindgen#242 (comment)](https://github.com/rust-lang/rust-bindgen/issues/242#issuecomment-1152747511) Wow, yeah that turned out to be it! Thanks!
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#650
No description provided.