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

CI: test on 64-bit Windows (GNU) #19

Merged
merged 3 commits into from
Oct 20, 2020
Merged

CI: test on 64-bit Windows (GNU) #19

merged 3 commits into from
Oct 20, 2020

Conversation

tarcieri
Copy link
Member

@tarcieri tarcieri commented Oct 20, 2020

Seems 32-bit is a bit tricky (see below).

Testing on MSVC reproduced the error reported in #17.

@tarcieri tarcieri force-pushed the ci/windows branch 2 times, most recently from c13d00b to 3ecf8b7 Compare October 20, 2020 13:22
@tarcieri tarcieri mentioned this pull request Oct 20, 2020
@newpavlov
Copy link
Member

Can you try the GNU toolchain?

@tarcieri tarcieri changed the title [WIP] CI: test on 32-bit and 64-bit Windows (MSVC) [WIP] CI: test on 32-bit and 64-bit Windows (GNU) Oct 20, 2020
@tarcieri
Copy link
Member Author

Guess we need to install MinGW or something to make GNU work?

linker `i686-w64-mingw32-gcc` not found

@tarcieri
Copy link
Member Author

tarcieri commented Oct 20, 2020

Hmmm, this is odd:

https://github.com/RustCrypto/asm-hashes/pull/19/checks?check_run_id=1281623236

   Compiling md5-asm v0.4.3 (D:\a\asm-hashes\asm-hashes\md5)
error: linking with `gcc` failed: exit code: 1
  |
  = note: "gcc" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-nostdlib" "-Wl,--large-address-aware" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\crt2.o" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\rsbegin.o" "-L" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib" "D:\\a\\asm-hashes\\asm-hashes\\target\\i686-pc-windows-gnu\\release\\deps\\md5_asm-d19db745816a8321.md5_asm.4zggfnky-cgu.0.rcgu.o" "D:\\a\\asm-hashes\\asm-hashes\\target\\i686-pc-windows-gnu\\release\\deps\\md5_asm-d19db745816a8321.md5_asm.4zggfnky-cgu.1.rcgu.o" "-o" "D:\\a\\asm-hashes\\asm-hashes\\target\\i686-pc-windows-gnu\\release\\deps\\md5_asm-d19db745816a8321.exe" "D:\\a\\asm-hashes\\asm-hashes\\target\\i686-pc-windows-gnu\\release\\deps\\md5_asm-d19db745816a8321.56acw0ez4fz0pp1x.rcgu.o" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "D:\\a\\asm-hashes\\asm-hashes\\target\\i686-pc-windows-gnu\\release\\deps" "-L" "D:\\a\\asm-hashes\\asm-hashes\\target\\release\\deps" "-L" "D:\\a\\asm-hashes\\asm-hashes\\target\\i686-pc-windows-gnu\\release\\build\\md5-asm-d793530e91a79f1e\\out" "-L" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib" "-Wl,-Bstatic" "-Wl,--whole-archive" "-lmd5" "-Wl,--no-whole-archive" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libtest-6fb8dee5da8fd51b.rlib" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libterm-44f946979850a39d.rlib" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libgetopts-1ede4ac20c009740.rlib" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libunicode_width-ae33122183e4e153.rlib" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\librustc_std_workspace_std-ad99504a34ebe13d.rlib" "-Wl,--start-group" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libstd-319c66d95f163cfa.rlib" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libpanic_unwind-1a1fb2d4d34efaf8.rlib" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libhashbrown-d427c26d6ee540f6.rlib" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\librustc_std_workspace_alloc-d57a946752c9dbe0.rlib" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libbacktrace-3aac111d9e75f9b6.rlib" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libbacktrace_sys-a6930c64c4de4d00.rlib" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\librustc_demangle-b50cb3c05c89c847.rlib" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libunwind-60ed44205c3c5009.rlib" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libcfg_if-adf5cf96a1b5cae5.rlib" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\liblibc-a7dbed86c78763ca.rlib" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\liballoc-3f311c7fee9215e7.rlib" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\librustc_std_workspace_core-e7fe638b0e960749.rlib" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libcore-f6794ed3da403dd0.rlib" "-Wl,--end-group" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\libcompiler_builtins-33bdd2acd606fd31.rlib" "-Wl,-Bdynamic" "-lkernel32" "-ladvapi32" "-lws2_32" "-luserenv" "-Wl,-Bstatic" "-lgcc_eh" "-lpthread" "-Wl,-Bdynamic" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-lmsvcrt" "-luser32" "-lkernel32" "C:\\Rust\\.rustup\\toolchains\\1.41.0-x86_64-pc-windows-msvc\\lib\\rustlib\\i686-pc-windows-gnu\\lib\\rsend.o"
  = note: C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: unrecognized option '--large-address-aware'
          C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: use the --help option for usage information
          collect2.exe: error: ld returned 1 exit status

Notably:

x86_64-w64-mingw32/bin/ld.exe: unrecognized option '--large-address-aware'

@tarcieri
Copy link
Member Author

Aha, here's an explanation:

rust-lang/rust#33535 (comment)

The compiler only assumes that it can run executables for its own platform, which in this case is x86_64-pc-windows-gnu. That means that the compiler is running a 64-bit mingw gcc trying to generate a 32-bit executable. The mingw gcc builds, however, do not support this.

...so we can't test 32-bit builds on a 64-bit Windows host. Unfortunate.

I can still try testing 64-bit builds.

@tarcieri tarcieri changed the title [WIP] CI: test on 32-bit and 64-bit Windows (GNU) [WIP] CI: test on 64-bit Windows (GNU) Oct 20, 2020
@tarcieri
Copy link
Member Author

Different error trying to link on 64-bit windows:

https://github.com/RustCrypto/asm-hashes/pull/19/checks?check_run_id=1281689904

  = note: C:\Rust\.rustup\toolchains\1.41.0-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-gnu\lib\crt2.o:crtexe.c:(.rdata$.refptr.__onexitbegin[.refptr.__onexitbegin]+0x0): undefined reference to `__onexitbegin'
          C:\Rust\.rustup\toolchains\1.41.0-x86_64-pc-windows-msvc\lib\rustlib\x86_64-pc-windows-gnu\lib\crt2.o:crtexe.c:(.rdata$.refptr.__onexitend[.refptr.__onexitend]+0x0): undefined reference to `__onexitend'

@newpavlov
Copy link
Member

newpavlov commented Oct 20, 2020

...so we can't test 32-bit builds on a 64-bit Windows host. Unfortunate.

It looks you have found a way? I wonder if we should add a compilation error for MSVC targets, after short search I could not find a clear instruction on how to compile S files using it.

Different error trying to link on 64-bit windows:

Since it works on stable, simply bump MSRV?

@tarcieri
Copy link
Member Author

tarcieri commented Oct 20, 2020

It looks you have found a way?

I removed the 32-bit Windows build

Since it works on stable, simply bump MSRV?

Huh, interesting. Guess I can start from 1.46.0 and work backwards until it breaks.

Edit: looks like 1.43 is the minimum supported version

@tarcieri tarcieri force-pushed the ci/windows branch 8 times, most recently from f21c023 to b7b2a69 Compare October 20, 2020 16:07
Splits the GitHub Actions configs into `linux`, `windows`, and `cross`
jobs, each configured to test certain targets.

Tests Windows in the 64-bit environment only, as it seems it's not
possible to test MINGW32 builds on 64-bit Windows:

rust-lang/rust#33535 (comment)

> The compiler only assumes that it can run executables for its own
> platform, which in this case is x86_64-pc-windows-gnu. That means that
> the compiler is running a 64-bit mingw gcc trying to generate a 32-bit
> executable. The mingw gcc builds, however, do not support this.
@tarcieri tarcieri changed the title [WIP] CI: test on 64-bit Windows (GNU) CI: test on 64-bit Windows (GNU) Oct 20, 2020
@tarcieri tarcieri marked this pull request as ready for review October 20, 2020 16:18
Copy link
Member

@newpavlov newpavlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!


In the future when the minimum supported Rust version is changed,
it will be accompanied by a minor version bump.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comment about MSVC targets?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some platform notes in 47d0fd7

@tarcieri tarcieri merged commit 9e3f715 into master Oct 20, 2020
@tarcieri tarcieri deleted the ci/windows branch October 20, 2020 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants