Open alice-i-cecile opened 5 months ago
I believe linker support is gated behind the doctest-xcompile feature.
I think jobs support is already tracked as a request in https://github.com/rust-lang/cargo/issues/10702 and https://github.com/rust-lang/rust/issues/53143.
This bug also seems to be causing problems here: https://github.com/TheLostLambda/knus/issues/11
On Macos we need to use the lld linker to compile this crate, but because there is a doctest in the repo that's currently causing these linking errors, actually fixing this error in cargo test
is blocked by this, I believe.
We have a .cargo/config.toml
that seems to fix the issue everywhere except for doctests!
When building doc tests, cargo settings like
--jobs
are ignored, and thelinker
specified inconfig.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 https://github.com/bevyengine/bevy/issues/12207.
Meta