Clap: error: cannot produce proc-macro for `clap_derive v3.0.0-beta.1` as the target `x86_64-unknown-linux-musl` does not support these crate types

Created on 21 May 2020  路  4Comments  路  Source: clap-rs/clap

Make sure you completed the following tasks

  • [x] Searched the discussions
  • [x] Searched the closes issues

Code

Here.

Steps to reproduce the issue

Here.

Version

Environment: 1.43.1-alpine3.11
Clap: 3.0.0-beta.1

Actual Behavior Summary

error: cannot produce proc-macro for 'clap_derive v3.0.0-beta.1' as the target 'x86_64-unknown-linux-musl' does not support these crate types

Expected Behavior Summary

Build should be successful.

Additional context

Alpine Linux, official Rust image.

Debug output

Here.

bug

All 4 comments

@mrusme As a general rule, please avoid linking to someone's github.com/<user>/<repo>/master because master (and other tags/branches) are not permalinks. You push a new commit, and the link now points to another piece of code.

Ideally, you should copy-paste the relevant code into the issue. If you think that the code sample is too large, you can use permalinks:

image


As regards to the issue, this is a bug in rustc. The fix is already merged and will be released in 1.44.0.

The temporary workaround is to use this

RUSTFLAGS="-C target-feature=-crt-static" cargo build

instead of cargo build.

Or if you don't need the derive (and it looks like you don't), you can just switch it off with:

# Cargo.toml
[dependencies]
clap = { git = "...", default-features = false, features = ["std"] }

@CreepySkeleton thank you, Sir!

I'm a Sir, yay!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kbknapp picture kbknapp  路  16Comments

joshtriplett picture joshtriplett  路  75Comments

casey picture casey  路  25Comments

casey picture casey  路  25Comments

kbknapp picture kbknapp  路  23Comments