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 test --doc fails with multiple rlib candidates for * found #6819

Closed
indutny opened this issue Apr 3, 2019 · 5 comments
Closed

cargo test --doc fails with multiple rlib candidates for * found #6819

indutny opened this issue Apr 3, 2019 · 5 comments
Labels

Comments

@indutny
Copy link

indutny commented Apr 3, 2019

Problem

I'm getting an error when trying to run cargo test --doc on this (practically empty) project:

https://github.com/indutny/append-multi-log

Steps

  1. git clone git@github.com:indutny/append-multi-log.git
  2. cd append-multi-log
  3. cargo test --doc

Possible Solution(s)

No ideas, but I suppose it is somehow related to having docs (/// comments) in the dependency?

Notes

Output of cargo version:

cargo 1.33.0 (f099fe94b 2019-02-12)

The platform is:

Darwin Kernel Version 18.2.0: Thu Dec 20 20:46:53 PST 2018; root:xnu-4903.241.1~1/RELEASE_X86_64

Rustc:

$ rustc --version
rustc 1.33.0 (2aa4c46cf 2019-02-28)
@indutny indutny added the C-bug Category: bug label Apr 3, 2019
@indutny
Copy link
Author

indutny commented Apr 3, 2019

Full cargo test --doc output: https://gist.github.com/indutny/31b2f68bad11b4c8bf95158641dd14f8

@ehuss
Copy link
Contributor

ehuss commented Apr 4, 2019

Hm, that's interesting. It looks like cargo test --doc is having problems if you depend on a package with the same name (in your case append-log 0.1.0-dev depends on append-log 0.1.4-dev). Cargo is issuing two --extern flags with the same package name, which confuses rustdoc.

I think the issue is somewhere around here. This was changed in #3721 to attempt to address this, but the doctest case seems broken. I'll try to look at it sometime soon.

@indutny
Copy link
Author

indutny commented Apr 4, 2019

Oh gosh. I've copy-pasted Cargo.toml and forgot to update it. Thank you for finding this!

It is weird that only the doc test are failing, though! Let me know if you'd like me to close the issue.

@ehuss
Copy link
Contributor

ehuss commented Apr 4, 2019

Hm, thinking about it more, it may be difficult/impossible to fix. rustdoc is building the tests from scratch and doesn't know about the local crate.

One workaround is to give the other crate a different name (using rename), something like this:

diff --git a/Cargo.toml b/Cargo.toml
index 23d1086..f8dde9e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,7 +12,7 @@ license = "MIT"
 repository = "https://github.com/indutny/append-multi-log"

 [dependencies]
-append-log = "0.1.4-dev"
+append-log-other = { version="0.1.4-dev", package="append-log" }

 [dev-dependencies]
 tempfile = "^3.0.7"
diff --git a/src/log.rs b/src/log.rs
index 86eda7a..a537fb2 100644
--- a/src/log.rs
+++ b/src/log.rs
@@ -1,6 +1,6 @@
-extern crate append_log;
+extern crate append_log_other;

-use append_log::Log;
+use append_log_other::Log;

 pub struct MultiLog {
 }

@indutny
Copy link
Author

indutny commented Apr 4, 2019

I didn't intend that package to have the same name as its dependency. Sorry for the noise. I guess it is better to close the issue then!

Thank you for help.

@indutny indutny closed this as completed Apr 4, 2019
lukaspiatkowski added a commit to lukaspiatkowski/rust-shed that referenced this issue Oct 19, 2020
Summary: With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

Differential Revision: D24390815

fbshipit-source-id: 19b06e7f8d011da8f213c8e82de98d88d1cd0dd4
lukaspiatkowski added a commit to lukaspiatkowski/rust-shed that referenced this issue Oct 19, 2020
Summary:
With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Differential Revision: D24390815

fbshipit-source-id: 8e2047715a83b50c3de4f8c74f0565799185f2ea
facebook-github-bot pushed a commit to facebook/mvfst that referenced this issue Oct 19, 2020
Summary:
Pull Request resolved: facebookexperimental/rust-shed#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
facebook-github-bot pushed a commit to facebookarchive/fbzmq that referenced this issue Oct 19, 2020
Summary:
Pull Request resolved: facebookexperimental/rust-shed#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
facebook-github-bot pushed a commit to rsocket/rsocket-cpp that referenced this issue Oct 19, 2020
Summary:
Pull Request resolved: facebookexperimental/rust-shed#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
facebook-github-bot pushed a commit to facebookincubator/below that referenced this issue Oct 19, 2020
Summary:
Pull Request resolved: facebookexperimental/rust-shed#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
facebook-github-bot pushed a commit to facebook/sapling that referenced this issue Oct 19, 2020
Summary:
Pull Request resolved: facebookexperimental/rust-shed#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
facebook-github-bot pushed a commit to facebookarchive/bistro that referenced this issue Oct 19, 2020
Summary:
Pull Request resolved: facebookexperimental/rust-shed#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
facebook-github-bot pushed a commit to facebookincubator/fizz that referenced this issue Oct 19, 2020
Summary:
Pull Request resolved: facebookexperimental/rust-shed#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
facebook-github-bot pushed a commit to facebookincubator/reindeer that referenced this issue Oct 19, 2020
Summary:
Pull Request resolved: facebookexperimental/rust-shed#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
facebook-github-bot pushed a commit to facebookexperimental/rust-shed that referenced this issue Oct 19, 2020
Summary:
Pull Request resolved: #15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
facebook-github-bot pushed a commit to facebook/folly that referenced this issue Oct 19, 2020
Summary:
Pull Request resolved: facebookexperimental/rust-shed#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
facebook-github-bot pushed a commit to facebook/fb303 that referenced this issue Oct 19, 2020
Summary:
Pull Request resolved: facebookexperimental/rust-shed#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
facebook-github-bot pushed a commit to facebook/proxygen that referenced this issue Oct 19, 2020
Summary:
Pull Request resolved: facebookexperimental/rust-shed#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
facebook-github-bot pushed a commit to facebook/fboss that referenced this issue Oct 19, 2020
Summary:
Pull Request resolved: facebookexperimental/rust-shed#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
facebook-github-bot pushed a commit to facebookincubator/katran that referenced this issue Oct 19, 2020
Summary:
Pull Request resolved: facebookexperimental/rust-shed#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
facebook-github-bot pushed a commit to facebook/fbthrift that referenced this issue Oct 19, 2020
Summary:
Pull Request resolved: facebookexperimental/rust-shed#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
facebook-github-bot pushed a commit to facebook/wangle that referenced this issue Oct 19, 2020
Summary:
Pull Request resolved: facebookexperimental/rust-shed#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
facebook-github-bot pushed a commit to facebookarchive/fbmeshd that referenced this issue Oct 19, 2020
Summary:
Pull Request resolved: facebookexperimental/rust-shed#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
facebook-github-bot pushed a commit to facebook/watchman that referenced this issue Oct 19, 2020
Summary:
Pull Request resolved: facebookexperimental/rust-shed#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
facebook-github-bot pushed a commit to facebook/openr that referenced this issue Oct 19, 2020
Summary:
Pull Request resolved: facebookexperimental/rust-shed#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
facebook-github-bot pushed a commit to facebookarchive/LogDevice that referenced this issue Oct 19, 2020
Summary:
Pull Request resolved: facebookexperimental/rust-shed#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
lukaspiatkowski added a commit to lukaspiatkowski/rust-shed that referenced this issue Oct 21, 2020
…acebookexperimental#15)

Summary:
Pull Request resolved: facebookexperimental#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
dotconnor pushed a commit to 5448C8/folly that referenced this issue Mar 19, 2021
…acebook#15)

Summary:
Pull Request resolved: facebookexperimental/rust-shed#15

With the update from rustc 1.44 to 1.47 the doctests started to break when building a crate that depends on a different crate of the same name, see this: rust-lang/cargo#6819

This diff also removes the TravisCI build as it was broken and unused for some time.

Reviewed By: krallin

Differential Revision: D24390815

fbshipit-source-id: fa9c78ef394640afbf8c419f8276bbf339960406
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants