Skip to content

bindgen-cli fails to install in certain CI Docker environments #4396

Closed

Description

@rami3l

One very weird (although not directly related to the optimization this PR is doing) thing is that bindgen-cli is failing to build (on master) in both aarch64-unknown-linux-musl and powerpc64le-unknown-linux-musl workflows and nothing else.

Furthermore, the error message always says:

error: failed to compile `bindgen-cli v0.72.0`, intermediate artifacts can be found at `/checkout/target`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

Caused by:
  cannot produce proc-macro for `clap_derive v4.1.0` as the target `x86_64-unknown-linux-gnu` does not support these crate types

We do know that clap_derive supports x86_64-unknown-linux-gnu. What could possibly go wrong?

PS: cargo -vV gives host: x86_64-unknown-linux-gnu and os: Ubuntu 22.4.0 [64-bit] for both workflows.

Originally posted by @rami3l in #4394 (comment)

Activity

  1. rami3l commented on Jun 28, 2025

    @rami3l
    MemberAuthor

    @Kobzol My current suspicion is that there could be some weird env vars set in those workflow Docker images that tricked cargo into doing the wrong thing (for example, installing codegen-cli for the wrong target), and I believe that has never happened before #4368's updating the Docker image for the builds. Do you happen to remember anything similar?

  2. Kobzol commented on Jun 29, 2025

    @Kobzol
    Member

    No, I haven't ever encountered this. Have you tried passing --target x86_64-unknown-linux-gnu when installing bindgen-cli? rust-lang/rust#78210

  3. rami3l commented on Jun 29, 2025

    @rami3l
    MemberAuthor

    @Kobzol Aha! That solution doesn't seem obvious but it did do the trick, although I still don't quite understand why that is the case :'D Many thanks!

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions