Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Multiple regex crates warnings #65

Closed
gchp opened this issue Dec 23, 2014 · 7 comments
Closed

Multiple regex crates warnings #65

gchp opened this issue Dec 23, 2014 · 7 comments

Comments

@gchp
Copy link
Contributor

gchp commented Dec 23, 2014

Building on the latest nightly gives some warnings about multiple versions of the regex crate. Any ideas how to remove these?

   Compiling docopt v0.6.18
warning: using multiple versions of crate `regex`
/home/gchp/.cargo/registry/src/github.com-1ecc6299db9ec823/docopt-0.6.18/src/lib.rs:217:1: 217:24 note: used here
/home/gchp/.cargo/registry/src/github.com-1ecc6299db9ec823/docopt-0.6.18/src/lib.rs:217 extern crate serialize;
                                                                                        ^~~~~~~~~~~~~~~~~~~~~~~
note: crate name: regex
/home/gchp/.cargo/registry/src/github.com-1ecc6299db9ec823/docopt-0.6.18/src/lib.rs:216:1: 216:20 note: used here
/home/gchp/.cargo/registry/src/github.com-1ecc6299db9ec823/docopt-0.6.18/src/lib.rs:216 extern crate regex;
                                                                                        ^~~~~~~~~~~~~~~~~~~
@BurntSushi
Copy link
Member

@alexcrichton Any ideas on this one? Is it because the regex crate hasn't actually been removed from the Rust distribution yet?

@alexcrichton
Copy link
Contributor

The serialize crate in the standard distribution depends on log which depends on regex (in the standard distribution. Because docopt links to crates.io-based regex and distribution-based serialize, you're getting a duplicate warning.

All you'll need to do is migrate to the crates.io-based rustc-serialize and you should be good to go!

@BurntSushi
Copy link
Member

@alexcrichton Oh, cool. Sounds great. Things are changing so fast! Thanks for the clarification.

@BurntSushi
Copy link
Member

@alexcrichton So I switched to rustc-serialize, and it seems like the number of warnings went down, but I'm still seeing at least one "using multiple versions of crate regex." Is it used somewhere else? Maybe the bundled regex crate in the Rust distribution should switch to a different crate name?

I also see the warnings when compiling the docopt_macros crate too.

Thanks!

@alexcrichton
Copy link
Contributor

That may be because of cargo test which links in test from the standard distribution, which transitively links to log and regex from the standard distribution (causing duplicate warnings).

For docopt_macros it's likely because you're linking to libsyntax which is linking to log, serialize, and regex in the standard distribution, causing the duplicate warnings.

@alexcrichton
Copy link
Contributor

The warning will probably go away in time, it's almost an encouraged practice with Cargo, but I'd also be fine renaming the ones we distribute.

@gchp
Copy link
Contributor Author

gchp commented Jan 6, 2015

Thanks for the information on this, haven't seen this happening in a good while now.

@gchp gchp closed this as completed Jan 6, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants