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

Doc tests ignore RUSTFLAGS #3227

Closed
crumblingstatue opened this issue Oct 25, 2016 · 2 comments
Closed

Doc tests ignore RUSTFLAGS #3227

crumblingstatue opened this issue Oct 25, 2016 · 2 comments

Comments

@crumblingstatue
Copy link

crumblingstatue commented Oct 25, 2016

(Moved from rust-lang/rust#37330)

I am writing doc examples for the bindings of a C library.
In my RUSTFLAGS, I add a search path for the C library using -L /path/to/lib. (needed because I am using a custom version of the library that's not installed globally)

cargo build/run picks this up fine, and the C library links correctly.
However, doc tests cause a linking error, because RUSTFLAGS seem to be ignored when compiling doc examples.

@alexcrichton
Copy link
Member

Ok so as pointed out by @rkruppe I was corrected in that we actually can't do this blindly per se. That is, rustdoc doesn't currently have a feature for "pass these flags to the compiler".

What you can do today, however, is hopefully use RUSTDOCFLAGS!

@carols10cents
Copy link
Member

It sounds like using RUSTDOCFLAGS fixes this issue, so I'm going to close this. Please reopen if I'm mistaken! Thank you!

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

3 participants