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

rustdoc ignores cargo and linker settings when compiling doc tests #125657

Open
alice-i-cecile opened this issue May 28, 2024 · 1 comment
Open
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@alice-i-cecile
Copy link

alice-i-cecile commented May 28, 2024

When building doc tests, cargo settings like --jobs are ignored, and the linker specified in config.toml is also ignored.

However, by setting rustdocflags we can control the linker correctly. This should use the project-level linker by default.

Context

These limitations make problems with slow / high memory doc test construction (see #75341) much harder to mitigate.
The approach proposed in #51228 may offer a way to fix this.

Initially discovered by Giooschi on the Bevy Discord while investigating bevyengine/bevy#12207.

Meta

rustc 1.78.0 (9b00956e5 2024-04-29)
binary: rustc
commit-hash: 9b00956e56009bab2aa15d7bff10916599e3d6d6
commit-date: 2024-04-29
host: x86_64-pc-windows-msvc
release: 1.78.0
LLVM version: 18.1.2
@alice-i-cecile alice-i-cecile added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels May 28, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 28, 2024
@ehuss
Copy link
Contributor

ehuss commented May 28, 2024

I believe linker support is gated behind the doctest-xcompile feature.

I think jobs support is already tracked as a request in rust-lang/cargo#10702 and #53143.

@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants