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

build-dependencies should not share the same feature space with target dependencies #8064

Closed
kvinwang opened this issue Apr 1, 2020 · 1 comment
Labels
C-bug Category: bug

Comments

@kvinwang
Copy link

kvinwang commented Apr 1, 2020

Problem
The bindgen crate turns on the feature log/std. When I use bindgen as a build-dependency in a no_std crate which using the log crate, the log/std is turned on unexpectly.

Steps

cargo new --lib foo
cd foo
cat >> Cargo.toml <<EOF
[dependencies.log]
default-features = false
version = "0.4"

[build-dependencies]
bindgen = "0.49"
EOF
cargo +nightly check -Z build-std=core,alloc --target=x86_64-linux-kernel

output:

error[E0463]: can't find crate for `std`
  |
  = note: the `x86_64-linux-kernel` target may not be installed

error: aborting due to previous error

For more information about this error, try `rustc --explain E0463`.
error: could not compile `log`.

Changing then version of log to = 0.3.8 makes the cargo check happy.

Possible Solution(s)

Notes

Output of cargo version:
cargo 1.44.0-nightly (7019b3e 2020-03-17)

@kvinwang kvinwang added the C-bug Category: bug label Apr 1, 2020
@Eh2406
Copy link
Contributor

Eh2406 commented Apr 1, 2020

This is a well known issue, these days there is an experimental fix at #7916. Please leave the report there or on one of the other open issues.

@Eh2406 Eh2406 closed this as completed Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants