-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Description
When running std's tests under Windows 7, it fails on the first execution on the following error:
Running unittests lib.rs (build/x86_64-unknown-linux-gnu/stage1-std/x86_64-win7-windows-msvc/release/deps/alloctests-6f6372787480eb2d.exe)
uploaded "/builds/hlab/rust-ci/rust/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-win7-windows-msvc/release/deps/alloctests-6f6372787480eb2d.exe", waiting for result
run "C:\\Users\\root\\AppData\\Local\\Temp\\work\\test0\\alloctests-6f6372787480eb2d.exe"
error: test failed, to rerun pass `-p alloctests --lib`
Caused by:
process didn't exit successfully: `/builds/hlab/rust-ci/rust/build/x86_64-unknown-linux-gnu/stage1-tools-bin/remote-test-client run 0 /builds/hlab/rust-ci/rust/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-win7-windows-msvc/release/deps/alloctests-6f6372787480eb2d.exe -Z unstable-options --format json` (exit status: 57)
note: test exited abnormally; to see the full output pass --no-capture to the harness.
(remote running is used, here under x86_64 Windows 7 SP1, but it also applies to x86)
Manually running the alloctests-*.exe program with std-*.dll alongside it gives the following dialog box:
which can confirmed using depends.exe and observing the function's absence from WS2_32.dll. It could therefore make programs compiled with Rust 1.92.0 systematically fail as well, but I haven't been able to test that just yet.
The only place where this function is used if for std::net::hostname's Windows support, that is still unstable and tracked with #135142. This should explain why it started to fail only now as the feature's initial implementation is recent and only landed in stable under 1.92. As documented, GetHostNameW is indeed only available starting from Windows 8.
Removing this feature's support for Windows 7 should be easy, but ideally it should be adapted or ported to be compatible with Win7. Another possibility would be to use GetComputerNameExW that is available from prehistory times, but I don't know if its semantics are the same as GetHostNameW: would it work for what we want for the feature?
cc @roblabla @orowith2os @joboet
@rustbot label C-bug O-windows-7 T-libs A-io