Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nrfxlib needs bindgen binary to build #444

Closed
jonathanpallant opened this issue Oct 25, 2019 · 9 comments
Closed

nrfxlib needs bindgen binary to build #444

jonathanpallant opened this issue Oct 25, 2019 · 9 comments
Labels
C-build-failure Category: This is a crate that failed to build E-easy Effort: Should be easy to implement and would make a good first PR P-medium Medium priority S-needs-dependency Status: This is a build failure due to a missing dependency in the build environment

Comments

@jonathanpallant
Copy link

Crate name:
nrfxlib
nrfxlib-sys

Build failure link:
https://docs.rs/crate/nrfxlib-sys/0.2.0
https://docs.rs/crate/nrfxlib/0.2.1

Additional details:
I used to use bindgen as a build-dependency to convert my third-party header files to Rust source in nrfxlib-sys. Now I shell out to the bindgen command line tool, to work around Cargo 5730. Is it possible to get bindgen pre-installed in the build environment? I found it was already installed when I used the Rust action on Github.

@jonathanpallant jonathanpallant added the C-build-failure Category: This is a crate that failed to build label Oct 25, 2019
@jyn514
Copy link
Member

jyn514 commented Dec 21, 2019

@jonathanpallant if bindgen is not packaged on Ubuntu 18.04, it is unlikely this can be fixed. We use https://github.com/rust-lang/crates-build-env for the build environment and it only installs dependencies that are packaged.

@thejpster
Copy link

(swapped to my personal account)

Hmm, that makes sense. It's packaged for 19.04 - https://packages.ubuntu.com/disco/bindgen.

I assume there's no mechanism to cargo install something?

@jyn514
Copy link
Member

jyn514 commented Dec 21, 2019

It's packaged for 19.04

Ok, in that case we can add it when 20.04 gets released in a few months.

I assume there's no mechanism to cargo install something?

No, because the build environment doesn't have a Rust toolchain installed.

@jonathanpallant
Copy link
Author

So, it seems rust-bindgen isn't packaged for focal (20.04) yet. I presume that means someone needs to do some work to package it?

@jyn514
Copy link
Member

jyn514 commented Apr 29, 2020

That's correct. I didn't realize that packages for 19.04 weren't automatically transferred over to 20.04, that seems like a shame.

@jyn514
Copy link
Member

jyn514 commented Apr 29, 2020

Another alternative I just thought of is to install bindgen on the host toolchain with the rest of the toolchain components. Rustwide exposes a cargo command - cc @pietroalbini , if I run cargo install bindgen with that, will bindgen be in PATH inside the build environment?

@pietroalbini
Copy link
Member

if I run cargo install bindgen with that, will bindgen be in PATH inside the build environment?

It should be.

@jyn514 jyn514 added E-easy Effort: Should be easy to implement and would make a good first PR wishlist labels Apr 29, 2020
@jyn514 jyn514 added P-medium Medium priority E-easy Effort: Should be easy to implement and would make a good first PR S-needs-dependency Status: This is a build failure due to a missing dependency in the build environment and removed E-easy Effort: Should be easy to implement and would make a good first PR wishlist labels Jun 27, 2020
@jyn514
Copy link
Member

jyn514 commented Jun 24, 2021

rust-lang/cargo#5730 is fixed with the new resolver, so you should no longer need this workaround. Eventually rust-lang/rfcs#3028 would allow having a build-dependency on the bindgen binary if for some reason crates want to call it as a CLI instead of a library.

I'm going to close this since there are alternatives to having docs.rs install bindgen.

@jyn514 jyn514 closed this as completed Jun 24, 2021
@jonathanpallant
Copy link
Author

Indeed. https://docs.rs/nrfxlib/0.6.0/nrfxlib/ rendered correctly using the new resolver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-build-failure Category: This is a crate that failed to build E-easy Effort: Should be easy to implement and would make a good first PR P-medium Medium priority S-needs-dependency Status: This is a build failure due to a missing dependency in the build environment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants