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

Cargo build error ... libc imported redundantly #1053

Closed
jlb6740 opened this issue May 17, 2019 · 5 comments
Closed

Cargo build error ... libc imported redundantly #1053

jlb6740 opened this issue May 17, 2019 · 5 comments

Comments

@jlb6740
Copy link
Contributor

jlb6740 commented May 17, 2019

Hi .. I just checked out a copy but immediately ran into a compilation error:

jlbirch@jlb6740:~/github/nix$ cargo build
Updating crates.io index
Updating git repository https://github.com/rust-lang/libc
Compiling libc v0.2.54 (https://github.com/rust-lang/libc#6bc42d40)
Compiling nix v0.13.0 (/home/jlbirch/github/nix)
Compiling void v1.0.2
Compiling cfg-if v0.1.9
Compiling bitflags v1.0.4
error: the item libc is imported redundantly
--> src/mount.rs:64:9
|
2 | use libc;
| ---- the item libc is already imported here
...
64 | use libc;
| ^^^^
|
note: lint level defined here
--> src/lib.rs:13:9
|
13 | #![deny(unused)]
| ^^^^^^
= note: #[deny(unused_imports)] implied by #[deny(unused)]

error: aborting due to previous error

error: Could not compile nix.

To learn more, run the command again with --verbose.

I don't see where this use at either line 2 or 64 was added recently so I assume this used to be valid syntax? Any pointers on compiling?

@asomers
Copy link
Member

asomers commented May 17, 2019

I haven't seen that before. What os and toolchain are you using?

@jlb6740
Copy link
Contributor Author

jlb6740 commented May 17, 2019

Hi .. I am using:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04 LTS"

My toolchain is:

Default host: x86_64-unknown-linux-gnu

installed toolchains

stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)

installed targets for active toolchain

wasm32-unknown-unknown
wasm32-unknown-wasi
x86_64-unknown-linux-gnu

active toolchain

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.36.0-nightly (08bfe1612 2019-05-02)

@asomers
Copy link
Member

asomers commented May 17, 2019

I guess this is new behavior in the latest nightly compiler. I'll fix it.

@jlb6740
Copy link
Contributor Author

jlb6740 commented May 17, 2019

Hi .. yes, I think it is new. I see the same error reported recently for other projects:

openethereum/parity-ethereum#10594
rust-lang/rust#60484 (comment)

Though I don't see a ton of reports nor the rust change where this would have broken this current code. Was looking for an attribute or compiler flag to ignore this but couldn't find one. For now I just commented out line 64. Thanks for the response.

@asomers
Copy link
Member

asomers commented May 22, 2019

Fixed by PR #1054

@asomers asomers closed this as completed May 22, 2019
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