-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Doctest cannot find reexported proc-macro crate when --target is given #4254
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
Comments
Duplicate of #4224 by the sounds of things |
@parched Seems so. Thanks for the pointer. |
kennytm
added a commit
to kennytm/cov
that referenced
this issue
Jul 10, 2017
Doing so will cause doc test to fail when serde's feature="derive" is used. See rust-lang/cargo#4254.
bors
added a commit
that referenced
this issue
Aug 31, 2017
…e, r=alexcrichton Add host dependency path via -L for cargo_test. Proc-macro crates' dependencies in the host dependency directory cannot be found when running `cargo test` with the `--target {target}` flag set as reported in #4224. This adds the host dependency directory to the search path to find those missing dependencies with -L when building tests and adds a test case that fails before and passes after this patch. A new function `find_host_deps(..)` is added to accomplish this which can determine the path of the host dependencies directory from within `run_doc_tests(..)` where the missing library search path is needed. Fixes #4224 Fixes #4254 Modeled after a similar patch: a298346 **Concerns** The test case seems to require a non-local crate from crates.io to example the failure before this patch. Couldn't make it fail with simply another local subcrate, but if others think it's possible that'd be great. This means that during tests for the cargo project itself that this test case actually downloads and compiles a crate, which I don't think any other tests do and is obviously not ideal and is perhaps even unacceptable. I've used the base64 crate pretty arbitrarily, but which crate it is really doesn't matter to test the case's content. So if anyone knows a tiny or empty crate on crates.io to use instead that'd speed this up and if someone can figure out how to make it fail before this patch is applied without downloading an external crate that would help as well. Also, I'm not 100% confident about the `find_host_deps(..)` style and whether it's the best way to find the host dependencies directory with just the `TestOptions` and `Compilation` structs available since I'm new to this project. Any comments are appreciated.
faern
added a commit
to mullvad/openvpn-plugin-rs
that referenced
this issue
Oct 13, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Repro step:
Execute these in the shell:
(The
x86_64-apple-darwin
should be replaced by the HOST triple. The same happens withx86_64-unknown-linux-gnu
as the HOST.)Actual result:
The doc test failed by complaining
serde_derive
not found:[dev-dependencies]
toserde_derive
will not solve it.serde_derive
directly in[dependencies]
+extern crate serde_derive;
will solve it (but it defeats the purpose offeatures = ["derive"]
)The problem is that
libserde_derive-*
are placed in the HOST folder (target/debug/deps
), whilelibserde-*
is in the TARGET folder (target/<triple>/debug/deps
). rustdoc is executed only with-L dependency=target/<triple>/debug/deps
, solibserde_derive-*
is not found.Versions
The text was updated successfully, but these errors were encountered: