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

Comments

Projects
None yet
3 participants
@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

This comment has been minimized.

Copy link
Member

alexcrichton commented Oct 26, 2016

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

This comment has been minimized.

Copy link
Member

carols10cents commented Sep 29, 2017

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
You can’t perform that action at this time.