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 doc does not seem to respect RUSTFLAGS #12481

Closed
yongqli opened this issue Aug 11, 2023 · 6 comments
Closed

cargo doc does not seem to respect RUSTFLAGS #12481

yongqli opened this issue Aug 11, 2023 · 6 comments
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.

Comments

@yongqli
Copy link

yongqli commented Aug 11, 2023

Problem

In the following repo:
https://github.com/yongqli/bug-test

Running

RUSTFLAGS="-L/opt/homebrew/opt/libomp/lib" cargo build --release

on macOS works, but running

RUSTFLAGS="-L/opt/homebrew/opt/libomp/lib" cargo test --doc

fails with linker error.

Tested on cargo 1.71

Steps

No response

Possible Solution(s)

No response

Notes

On macOs you may need to install dependencies by running brew install libomp.

Version

No response

@yongqli yongqli added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Aug 11, 2023
@yongqli
Copy link
Author

yongqli commented Aug 11, 2023

Looks like this was the issue: #4737

@weihanglo
Copy link
Member

Have you tried RUSTDOCFLAGS?

@yongqli
Copy link
Author

yongqli commented Aug 11, 2023

Is there a way to pass linker arguments to cargo doc based on target triple? Only rustflags is listed under [target.<triple>]: https://doc.rust-lang.org/cargo/reference/config.html#configuration-format rustdocflags is not accepted.

@yongqli
Copy link
Author

yongqli commented Aug 11, 2023

Have you tried RUSTDOCFLAGS?

Yes, RUSTDOCFLAGS worked.

@weihanglo
Copy link
Member

Is there a way to pass linker arguments to cargo doc based on target triple? Only rustflags is listed under [target.<triple>]: https://doc.rust-lang.org/cargo/reference/config.html#configuration-format rustdocflags is not accepted.

No. And afaik no one requested for that. (I've fixed an issue around btw #11323)

The request does look different from this issue you've tried to fix. If possible, to make it clear, could you open a new one and close this?

@weihanglo
Copy link
Member

weihanglo commented Aug 12, 2023

Okay. Maybe don't need to open a new one. In #6460 there are some upstream issue linked need to deal with first. I'll close this now. If you have different thoughts, please let use know. Thank you :)

EDIT: see also #7040

@weihanglo weihanglo closed this as not planned Won't fix, can't repro, duplicate, stale Aug 12, 2023
@weihanglo weihanglo reopened this Aug 12, 2023
@weihanglo weihanglo closed this as not planned Won't fix, can't repro, duplicate, stale Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

2 participants