You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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?
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.
Activity
jyn514 commentedon 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 commentedon Dec 21, 2019
(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 installsomething?jyn514 commentedon Dec 21, 2019
Ok, in that case we can add it when 20.04 gets released in a few months.
No, because the build environment doesn't have a Rust toolchain installed.
jonathanpallant commentedon Apr 29, 2020
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 commentedon 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 commentedon 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 bindgenwith that, willbindgenbe in PATH inside the build environment?emilyalbini commentedon Apr 29, 2020
It should be.
jyn514 commentedon 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.
jonathanpallant commentedon Jun 24, 2021
Indeed. https://docs.rs/nrfxlib/0.6.0/nrfxlib/ rendered correctly using the new resolver.