-
Notifications
You must be signed in to change notification settings - Fork 503
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
Add i686-pc-windows-gnullvm target #2961
Conversation
On my fork, the "cross" test fails now. Oddly, I modified the "cross" workflow first, and it actually succeeded before I started adding i686_gnullvm elsewhere. I guess it's testing a mix between the current git crates/libs/targets and older published crates/targets/..., where there is no such i686_gnullvm version? That was the only failure I was seeing though. |
I'm an idiot, the build.rs I based on x86_64_gnullvm, and changed |
Should i686_gnu's build.rs be modified also, to add |
I think that came from #2774 courtesy of @seritools. |
Tests pass, so I'm going to merge this PR. If you have a repro do let us know. Thanks for the contribution! |
I now believe that the "cross" test I added failed to fail as I expected because of #2774. Specifically,
windows-rs/crates/targets/x86_64_gnu/build.rs Lines 5 to 6 in a08ab56
|
Some failure tests would be great, although I'm not sure how exactly it would fail since |
I'm talking about the status quo before this PR was merged - the cfg expression in windows-rs/crates/libs/targets/Cargo.toml Lines 25 to 26 in 158a528
i686-pc-windows-gnu or i686-uwp-windows-gnu . After #2774, it would not return early, because the env is gnu for gnullvm, and it does not do the target.ends_with check that would exclude gnullvm.
|
Do you have a repro? I don't see that here: D:\git\windows-rs>rustup default
nightly-i686-pc-windows-gnu (default)
D:\git\windows-rs>cargo check -p windows-targets
Compiling windows_i686_gnu v0.52.4 (D:\git\windows-rs\crates\targets\i686_gnu)
Checking windows-targets v0.52.4 (D:\git\windows-rs\crates\libs\targets)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.53s |
C:\>curl -LO https://github.com/mstorsjo/llvm-mingw/releases/download/20231128/llvm-mingw-20231128-ucrt-x86_64.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 128M 100 128M 0 0 26.8M 0 0:00:04 0:00:04 --:--:-- 34.9M
C:\>tar -xf llvm-mingw-20231128-ucrt-x86_64.zip
C:\>git clone --depth 1 --single-branch -b 0.52.0 https://github.com/microsoft/windows-rs
C:\windows-rs>path c:\llvm-mingw-20231128-ucrt-x86_64\bin;%PATH%
C:\windows-rs>rustup default
nightly-i686-pc-windows-gnu (default)
C:\windows-rs>rustup component add rust-src
info: downloading component 'rust-src'
info: installing component 'rust-src'
C:\windows-rs>del \llvm-mingw-20231128-ucrt-x86_64\bin\*gcc.exe
C:\windows-rs>del \llvm-mingw-20231128-ucrt-x86_64\bin\*g++.exe
C:\windows-rs>cargo test -p test_win32 --target i686-pc-windows-gnullvm -Zbuild-std
...
= note: clang-17: warning: argument unused during compilation: '-nolibc' [-Wunused-command-line-argument]
clang-17: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
lld: error: unable to find library -lwindows.0.52.0
lld: error: unable to find library -lwindows.0.52.0
clang-17: error: linker command failed with exit code 1 (use -v to see invocation)
error: could not compile `test_win32` (test "winsock") due to 1 previous error
warning: `test_win32` (test "win32") generated 3 warnings
error: could not compile `test_win32` (test "win32") due to 1 previous error; 3 warnings emitted
C:\windows-rs>cd ..
C:\>rmdir /s windows-rs
windows-rs, Are you sure (Y/N)? y C:\>git clone --depth 1 --single-branch https://github.com/microsoft/windows-rs
C:\>cd windows-rs
C:\windows-rs>cargo test -p test_win32 --target i686-pc-windows-gnullvm -Zbuild-std
...
Running unittests src\lib.rs (target\i686-pc-windows-gnullvm\debug\deps\test_win32-a6badaa2d7e7e7e5.exe)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running tests\hresult.rs (target\i686-pc-windows-gnullvm\debug\deps\hresult-3b4ba2f37ba503d2.exe)
running 1 test
test test_message ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Running tests\win32.rs (target\i686-pc-windows-gnullvm\debug\deps\win32-e90a6c871585c2a0.exe)
running 14 tests
test callback ... ok
test size32 ... ok
test bool_as_error ... ok
test constant ... ok
test dxgi_mode_desc ... ok
test function ... ok
test rect ... ok
test com ... ok
test signed_enum32 ... ok
test unsigned_enum32 ... ok
test empty_struct ... ok
test interface ... ok
test com_inheritance ... ok
test onecore_imports ... ok
test result: ok. 14 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.13s
Running tests\winsock.rs (target\i686-pc-windows-gnullvm\debug\deps\winsock-e6e3a30783a5f0b9.exe)
running 6 tests
test in6_addr ... ok
test sockaddr_inet6 ... ok
test sockaddr_inet4 ... ok
test sockaddr_in ... ok
test sockaddr_in6 ... ok
test in_addr ... ok
test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s
Is that what you're looking for? BTW, as expected, 0.53.0 through 0.55.0 succeed due to the build.rs change referenced above. I hadn't noticed that before, I was dealing with breakages of 0.52.0 and 0.48.x. |
Also, once rust-lang/rust#121712 goes somewhere, it should be possible to get more test coverage of gnullvm (without having to use nightly so that |
@jeremyd2019 Is there any remaining work to be done here? I can't quite tell by reading the latest messages here. |
I created #2970 for completeness' sake. The only other thing is I want to try to add more testing of the -gnullvm targets. |
Adds i686-pc-windows-gnullvm target.
Fixes: #2960