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

"cannot produce proc-macro for crate as the target x86_64-unknown-linux-gnu does not support these crate types" with +crt-static #83481

Closed
youknowone opened this issue Mar 25, 2021 · 2 comments

Comments

@youknowone
Copy link
Contributor

This issue looks like the same one but closed #78210. I am creating a new issue because I don't know if it was fixed at that time or won't be fixed or just closed by accident.

Crate code

I created an empty project with this Cargo.toml file.

[package]
name = "broken"
version = "0.1.0"
edition = "2018"

[dependencies]
async-trait = "*"

[lib]
name = "broken"
crate-type = ["staticlib", "rlib"]

And tried to build with

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

I expected to see this happen: successful build

Instead, this happened:

error: cannot produce proc-macro for `async-trait v0.1.48` as the target `x86_64-unknown-linux-gnu` does not support these crate types

Version it worked on

It most recently worked on: 1.48

Version with regression

It doesn't work since 1.49 only in Linux.
It still works on macOS with any rust version.

rustc --version --verbose:

rustc 1.51.0 (2fd73fabe 2021-03-23)
binary: rustc
commit-hash: 2fd73fabe469357a12c2c974c140f67e7cdd76d0
commit-date: 2021-03-23
host: x86_64-unknown-linux-gnu
release: 1.51.0
LLVM version: 11.0.1
@jyn514
Copy link
Member

jyn514 commented Mar 25, 2021

I am creating a new issue because I don't know if it was fixed at that time or won't be fixed or just closed by accident.

It says at the end of the issue:

I don't believe we're intending to fix this.

@jyn514 jyn514 closed this as completed Mar 25, 2021
@youknowone
Copy link
Contributor Author

Thank you to make it clear. I thought it may meant it was unintentionally fixed by the upper PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants