Skip to content

nrfxlib needs bindgen binary to build #444

Closed

Description

@jonathanpallant

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.

Activity

  1. jyn514 commented on Dec 21, 2019

    @jyn514
    Member

    @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.

  2. thejpster commented on Dec 21, 2019

    @thejpster

    (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?

  3. jyn514 commented on Dec 21, 2019

    @jyn514
    Member

    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.

  4. jonathanpallant commented on Apr 29, 2020

    @jonathanpallant
    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?

  5. jyn514 commented on Apr 29, 2020

    @jyn514
    Member

    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.

  6. jyn514 commented on Apr 29, 2020

    @jyn514
    Member

    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?

  7. emilyalbini commented on Apr 29, 2020

    @emilyalbini
    Member

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

    It should be.

  8. added
    E-easyEffort: Should be easy to implement and would make a good first PR
    on Apr 29, 2020
  9. added
    E-easyEffort: Should be easy to implement and would make a good first PR
    S-needs-dependencyStatus: This is a build failure due to a missing dependency in the build environment
    and removed
    E-easyEffort: Should be easy to implement and would make a good first PR
    on Jun 27, 2020
  10. jyn514 commented on Jun 24, 2021

    @jyn514
    Member

    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.

  11. jonathanpallant commented on Jun 24, 2021

    @jonathanpallant
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-build-failureCategory: This is a crate that failed to buildE-easyEffort: Should be easy to implement and would make a good first PRP-mediumMedium priorityS-needs-dependencyStatus: This is a build failure due to a missing dependency in the build environment

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions