-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Cannot override Windows runtime for rust tests #116900
Comments
I think this is the same issue as the one you link tbh. Sure, there are workarounds which may work in some situations but without a proper fix this issue will keep cropping up in various forms. My personal opinion is that the first step should be to move linking of the CRT into the compiler (for historical reasons it's currently hardcoded in the libc crate). Then we can use The next step would be to have some way to properly coordinate using the debug CRT or other CRT. This matters for crates like |
Feel free to close as dup, yes. The thing is the workaround proposed there is to add |
If I look at the link arguments, |
@ChrisDenton oh, good point, that's really weird! For regular programs |
I mean, msvc doesn't really make much of a distinction. But if you want to be explicitly static then try:
|
Fair enough. Old rust version used to do whole archive by default I think. Then +whole-archive got added and it stopped doing wholearchive by default. This seems broken in the ---test case, that's a Rustc bug right? |
I'd think so. It might be a good idea to open an issue about that specifically. Someone who knows more about the test harness than me can chime in. My suspicion would be that it was indeed just an oversight but perhaps there's a reason for it I'm not aware of. |
@ChrisDenton reported #116910. Thanks a lot for your help. |
Related to #39016.
Meson has an option to select different vscrt, but rustc always uses
msvcrt.lib
. To work around that issue, Meson adds-l static=msvcrtd.lib
when we need use debug crt. This seems to work fine, unless a rust test program is built withrustc --test
. In that case I get that linker issue:Any idea what causes that? Any workaround possible?
The text was updated successfully, but these errors were encountered: