Support Microsoft CL.EXE compiler
-
__attribute__((unused)): Convert to MSVC non-standard extensions rather than GCC non-standard extensions - Use
_WIN64in addition to__x86_64__to detect 64 bit - Quote shell parameters
- Drop to 32-bit for some C code on 64-bit Windows to avoid algorithms that use 128-bit integers. MSVC does not support 128 bit integers
- Use MSVC CPU intrinsics rather than GCC intrinsics
Added commits for all the Opam packages in mirage-crypto that can work with MSVC:
- ./mirage-crypto.opam
- ./mirage-crypto-ec.opam
- ./mirage-crypto-rng.opam
- ./mirage-crypto-rng-mirage.opam
There are two Opam packages that won't work with MSVC:
- ./mirage-crypto-pk.opam (relies on
conf-gmpthroughzarith; GNU MP won't be available to MSVC) - ./mirage-crypto-rng-async.opam (Async is not supported on Windows)
Thanks!
Thanks for your PR. This adds quite some #ifdef to the codebase -- would you be able to add a GitHub action (or whichever free-for-use other CI is suitable) that tests these paths?
I'll also need much more time to think about the #ifdef since these turned out to be a maintenance burden in the past.
The two failing ocaml-ci jobs (mirage-crypto-rng-async on s390 and 4.12+domains) are expected.
Thanks for your PR. This adds quite some
#ifdefto the codebase -- would you be able to add a GitHub action (or whichever free-for-use other CI is suitable) that tests these paths?
~~That may be quite a while, and GitLab will come before GitHub (at least for me)~~. But we can keep this PR open; I can just patch it and pin this version for use in my Windows distribution for quite some time.
EDIT: GitHub Actions are possible but there is still work to-do; see https://github.com/diskuv/diskuv-ocaml-starter-ghmirror/runs/3844831608?check_suite_focus=true for an example. But GitHub Actions doesn't seem to resolve your main issue ("maintenance burden" below).
I'll also need much more time to think about the
#ifdefsince these turned out to be a maintenance burden in the past.
Yeah, this is related to your CI comment and my 'just patch/pin it' comment. Since the ifdefs will be a maintenance burden, let's figure out something else. Perhaps an expansion of the Dune configurator to simplify the ifdef clauses? Anyway ... there is no point proceeding with this PR without resolving how the PR will fit into the code base long-term!
Action Item:
- [ ] (Owner: Mirage team) Resolve how this PR and ifdefs more generally can be maintainable in the code base
Any progress on the maintainability of ifdefs?
Again, thanks for your work. Looking back into this, how to move forward? I see the following action items:
- It is crucial to have a CI system for this port. Could you submit this as a separate PR? Then we can rebase this one on top of the CI one.
- Figure out the
__WIN32__vs_WIN32situation. We have a GitHub action (windows.yml) which tests cygwin, we'll see errors when only using_WIN32fails (unclear why the windows CI run is not showing above). - is "CL.EXE" (and windows) only available on x86 CPUs? (since you add a
|| defined (_MSC_VER)to i386/x86_64 ifdef in entropy_cpu_stubs.c, and I'm not convinced that mixing CPU architecture ifdefs with platform ifdefs is a good idea) -
Microsoft compiler does not support 128-bit integers. Drop down to 32-bit for MSVC.is this really the case, and no other way? Since this has a pretty big performance impact. - Please take a look at the code comments and address them
- Please rebase onto the main branch
I haven't forgotten about this PR. However, it may be quite a while before I get even to the first item (the MSVC CI, which is broader than this one package).
- Figure out the
__WIN32__vs_WIN32situation. We have a GitHub action (windows.yml) which tests cygwin, we'll see errors when only using_WIN32fails (unclear why the windows CI run is not showing above).
According to https://reviews.llvm.org/D40285 the _WIN32 macro works across MSVC, GCC and clang compilers:
In MSVC, WIN32 and WIN64 are never defined by the compiler, neither by system headers. Project files created by the IDE often contains them set manually though.
GCC on the other hand predefines both
_WIN32andWIN32(and similarly for -64), but only when using the GNU standards additions (which are enabled by default)x86_64-w64-mingw32-gcc -E -dM - < /dev/null | grep WIN32does include both, while the unprefixed one vanishes if you add e.g.-std=c99(but are still included if you set-std=gnu99).clang on the other hand doesn't check the standards version, but provides both
WIN32and_WIN32. And for the really inconsistent case, withclang -target x86_64-w64-mingw32 -E -dM - < /dev/null, you will haveWIN64,_WIN64and_WIN32, but no unprefixedWIN32.
So WIN32 is incorrect, even on GCC compilers.
More than a year later, any news on this PR? I'm fine to integrate CL.EXE support into mirage-crypto. I'd be very happy to have a CI system.
I proposed some changes above, if you could integrate them and rebase, I'm fine to review again and likely merge.
Oops!! I thought I had gotten all of these MSVC PRs done! I don't how I forgot about this one.
I'll stick an entry in my main issue queue, so I don't lose visibility.
Now that the CI part is merged, would you mind to rebase this PR on top of the main branch? There are some minor comments, which you could address or just rebase and we check whether the CI is happy. :)
Is there a version of mirage-crypto-pk that does not require zarith and conf-gmp-powm-sec? In particular, it looks like the GMP library needs to be compiled for MSVC.
I suspect originally I wasn't using mirage-crypto-pk. Or perhaps I used vcpkg (search for "gmp" in https://vcpkg.io/en/packages) to manually compile and hack the opam packages; but vcpkg (and other C build tools like Conan and even my more recent DkSDK CMake) can't be used in opam. We need to compile with the normal opam, ocaml and dune tools we have today.
- [ ] This issue will stall again if someone can't look at the zarith dependency (either remove it from mirage-crypto-pk, or get zarith compiling with MSVC using opam+dune).
- [x] Rebase
- [x]
opam exec -- dune runtest -p mirage-crypto-rng-lwt,mirage-crypto-rng-mirage,mirage-crypto-rng,mirage-cryptopasses (notice nomirage-crypto-pkand its test consumermirage-crypto-ec)
#=== ERROR while compiling zarith.1.13 ========================================#
# context 2.2.0~alpha0~20221228 | win32/x86_64 | ocaml-system.4.14.0 | https://opam.ocaml.org#98bb73cb
# path Z:\source\mirage-crypto\_opam\.opam-switch\build\zarith.1.13
# command C:\Users\beckf\AppData\Local\Programs\DKMLNA~1\bin\WITH-D~1.EXE ./configure
# exit-code 2
# env-file C:\Users\beckf\AppData\Local\opam\log\zarith-30492-488a23.env
# output-file C:\Users\beckf\AppData\Local\opam\log\zarith-30492-488a23.out
### output ###
# [...]
# binary ocamlmklib: found in /c/Users/beckf/AppData/Local/Programs/DKMLNA~1/usr/bin
# binary ocamldoc: found in /c/Users/beckf/AppData/Local/Programs/DKMLNA~1/usr/bin
# binary ocamlopt: found in /c/Users/beckf/AppData/Local/Programs/DKMLNA~1/usr/bin
# checking compilation with ocamlc -O3 -Wall -Wextra : not working
# checking compilation with ocamlc -O: working
# include caml/mlvalues.h: found
# library dynlink.cmxa: found
# binary ocamlfind: found in /z/source/mirage-crypto/_opam/bin
# OCaml's word size is 64
# include gmp.h: not found
# include mpir.h: not found
# cannot find GMP nor MPIR
#=== ERROR while compiling conf-gmp-powm-sec.3 ================================#
# context 2.2.0~alpha0~20221228 | win32/x86_64 | ocaml-system.4.14.0 | https://opam.ocaml.org#98bb73cb
# path Z:\source\mirage-crypto\_opam\.opam-switch\build\conf-gmp-powm-sec.3
# command C:\Users\beckf\AppData\Local\Programs\DKMLNA~1\bin\WITH-D~1.EXE sh -exc cc -c $CFLAGS -I/usr/local/include test.c
# exit-code 127
# env-file C:\Users\beckf\AppData\Local\opam\log\conf-gmp-powm-sec-30492-467716.env
# output-file C:\Users\beckf\AppData\Local\opam\log\conf-gmp-powm-sec-30492-467716.out
### output ###
# + cc -c -I/usr/local/include test.c
# sh: line 1: cc: command not found
Thanks for your work. In respect to gmp: there's no effort to make mirage-crypto-pk independent of gmp/zarith so far :/
The good news is there's (esp. for the mirage build setup) an overlay of the zarith package that uses dune: https://github.com/dune-universe/opam-overlays/tree/master/packages/zarith/zarith.1.12%2Bdune (there's even a gmp-compiled-by-dune, released as "gmp" to opam-repository).
There's some discussion https://github.com/ocaml/Zarith/pull/73 https://github.com/ocaml/Zarith/pull/143 about using dune for zarith, but I do not know the state thereof.
6 months later, I'm curious whether there's any interest to move this to completion? As I see, opam 2.2 is supposed to support windows natively - would this help for this PR (my suspicion is that gmp & zarith from opam should then work?) I also have seen https://github.com/ocaml/Zarith/issues/43 (open since 5 years without any comment).
6 months later, I'm curious whether there's any interest to move this to completion?
I think the way forward is just to check in the MSVC code as-is so it doesn't stagnate. Or provide a mock implementation of a subset of zarith (failwith every function) via a virtual library for gmp and zarith ... so at least the MSVC code compiles but does not run.
As I see, opam 2.2 is supposed to support windows natively - would this help for this PR (my suspicion is that gmp & zarith from opam should then work?)
Highly doubt that opam 2.2 is concerned with gmp and zarith. They will just mark those libraries as unavailable on Windows. But those libraries are very likely available in Cygwin, which isn't native Windows but is a stop-gap for some Windows users.
I also have seen https://github.com/ocaml/Zarith/issues/43 (open since 5 years without any comment).
Oh, that is so sad! Eventually we (OCaml community) may need to port over (perhaps machine translate) something from Rust rather than rely on GMP. I assume that crypto just needs big integer not big decimal numbers, right? Regardless, a mock implementation defining exactly what is needed from the leading crypto package (mirage-crypto) would be the first step.
Dear @jonahbeckford, thanks for your reply.
6 months later, I'm curious whether there's any interest to move this to completion?
I think the way forward is just to check in the MSVC code as-is so it doesn't stagnate. Or provide a mock implementation of a subset of zarith (
failwithevery function) via a virtual library for gmp and zarith ... so at least the MSVC code compiles but does not run. [...]I also have seen ocaml/Zarith#43 (open since 5 years without any comment).
Oh, that is so sad! Eventually we (OCaml community) may need to port over (perhaps machine translate) something from Rust rather than rely on GMP. I assume that crypto just needs big integer not big decimal numbers, right? Regardless, a mock implementation defining exactly what is needed from the leading crypto package (mirage-crypto) would be the first step.
Since "a mock implementation" is quite some work, in addition to runtime failures which I do not appreciate, what about (a) solving the conflicts in this PR and (b) focus on mirage-crypto/mirage-crypto-rng/mirage-crypto-ec (but not mirage-crypto-pk which has the gmp dependency) for windows for now -- specifically, can we adapt the windows CI to not compile mirage-crypto-pk (is it as smooth as removing "mirage-crypto-pk" from "ci/build-test.sh")?
Since "a mock implementation" is quite some work, in addition to runtime failures which I do not appreciate,
I took a second look at virtual libraries: https://dune.readthedocs.io/en/stable/variants.html. No mock implementation needed, and we'd be able to avoid bitrot for the MSVC code since that code will compile. The precise steps would be:
- Create a virtual library. Let's call it
mirage-crypto-bigintfor now. - Inside it has a
mirage_crypto_bigint.mlispecifying exactly what types and functions mirage-crypto needs from Zarith. - Make an implementation library
mirage-crypto-bigint.zariththat just passes through to Zarith.
I'm not asking for that today, but I am asking whether you or your team can do that sometime in the next year or two. If not (or something less Dune-specific; perhaps with functors, etc.), this whole exercise is pointless.
After that mirage_crypto_bigint.mli is made, everybody will have a good starting point for what needs to be implemented outside Zarith. (Actually, the num package is perfectly portable although slower, so an implementation library mirage-crypto-bigint.num could be an intermediate step).
(a) solving the conflicts in this PR and (b) focus on mirage-crypto/mirage-crypto-rng/mirage-crypto-ec (but not mirage-crypto-pk which has the gmp dependency) for windows for now -- specifically, can we adapt the windows CI to not compile mirage-crypto-pk (is it as smooth as removing "mirage-crypto-pk" from "ci/build-test.sh")?
Done. Although I can't test my windows CI changes because it does not look like the MSVC tests run as part of PRs.
Dear @jonahbeckford, thanks for your rebase & comments.
To move forward, would you mind to answer the inline code comments? They all look minor (see https://github.com/mirage/mirage-crypto/pull/137/files): https://github.com/mirage/mirage-crypto/pull/137/files#r1485599551 https://github.com/mirage/mirage-crypto/pull/137/files#r700918256 https://github.com/mirage/mirage-crypto/pull/137/files#r773731227 https://github.com/mirage/mirage-crypto/pull/137/files#r773731540 https://github.com/mirage/mirage-crypto/pull/137/files#r700918490 https://github.com/mirage/mirage-crypto/pull/137/files#r700921559 https://github.com/mirage/mirage-crypto/pull/137/files#r773734014 https://github.com/mirage/mirage-crypto/pull/137/files#r773735597 https://github.com/mirage/mirage-crypto/pull/137/commits/b5b1c918127221bf50526ae73c5fedfade9d55b1#r1485601480
dune virtual library "mirage-crypto-bigint"
I don't have much experience with those. Your suggestion sounds good -- would you mind to open an issue with it? (Once the PR is merged, it is hard to discover the contents.)
Thanks again for your work, there's only a minor nit to re-establish the std_cflags as before this PR in cfg.ml. Otherwise good to merge. I ran bench/speed.exe on my laptop with this change (including my proposal https://github.com/mirage/mirage-crypto/pull/137#discussion_r1493297696) and the main branch (36bc72f5), and there's not much difference.
Thus, fine to merge if the proposed re-restablishment of std_cflags is added to your branch. I'd squash and merge since I don't think the individual commits are worth to keep. Let me know if you disagree.
Dear @jonahbeckford, it would be great if you could re-establish the C flags as suggested above. Once this is done, maybe a rebase/merge of the main branch is useful, and then I'd move forward and merge this long-lasting PR finally into the main tree.
I'd squash and merge since I don't think the individual commits are worth to keep. Let me know if you disagree.
Squash and merge is good. Thanks!
Thanks a lot, merged. Let's see the CI on the main branch :)
Dear @jonahbeckford, I merged this. I also pushed https://github.com/mirage/mirage-crypto/commit/7f3887e53462a8ef16d32bb4accf2d8b195516cc which will hopefully run the DKML CI for each pull request.
I noticed that the DKML CI does not work though: https://github.com/mirage/mirage-crypto/actions/runs/8003970521/job/21860387635
#=== ERROR while compiling zarith.1.13 ========================================#
# context 2.2.0~alpha0~20221228 | win32/x86_64 | | [https://opam.ocaml.org#8cda2e5a](https://opam.ocaml.org/#8cda2e5a)
# path D:\.opam\dkml\.opam-switch\build\zarith.1.13
# command D:\.opam\dkml\.opam-switch\build\zarith.1.13\./configure
# exit-code 2
# env-file D:\.opam\log\zarith-5380-7341b5.env
# output-file D:\.opam\log\zarith-5380-7341b5.out
### output ###
# [...]
# binary ocamlmklib: found in /d/.opam/dkml/bin
# binary ocamldoc: found in /d/.opam/dkml/bin
# binary ocamlopt: found in /d/.opam/dkml/bin
# checking compilation with ocamlc -O3 -Wall -Wextra : not working
# checking compilation with ocamlc -O: working
# include caml/mlvalues.h: found
# library dynlink.cmxa: found
# binary ocamlfind: found in /d/.opam/dkml/bin
# OCaml's word size is 32
# include gmp.h: not found
# include mpir.h: not found
# cannot find GMP nor MPIR
#=== ERROR while compiling mirage-crypto.0.11.2 ===============================#
# context 2.2.0~alpha0~20221228 | win32/x86_64 | | [https://opam.ocaml.org#8cda2e5a](https://opam.ocaml.org/#8cda2e5a)
# path D:\.opam\dkml\.opam-switch\build\mirage-crypto.0.11.2
# command D:\.opam\dkml\bin\dune.exe build -p mirage-crypto -j 3
# exit-code 1
# env-file D:\.opam\log\mirage-crypto-5380-bd0157.env
# output-file D:\.opam\log\mirage-crypto-5380-bd0157.out
### output ###
# [...]
# (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cst[...]
# cl : Command line error D8021 : invalid numeric argument '/Wextra'
# File "src/dune", line 11, characters 11-25:
# 11 | chacha poly1305-donna entropy_cpu_stubs)
# ^^^^^^^^^^^^^^
# (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cst[...]
# cl : Command line error D8021 : invalid numeric argument '/Wextra'
# File "src/dune", line 9, characters 59-65:
# 9 | (names detect_cpu_features misc misc_sse md5 sha1 sha256 sha512 hash_stubs
# ^^^^^^
# (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cst[...]
# cl : Command line error D8021 : invalid numeric argument '/Wextra'
#=== ERROR while compiling conf-gmp-powm-sec.3 ================================#
# context 2.2.0~alpha0~20221228 | win32/x86_64 | | [https://opam.ocaml.org#8cda2e5a](https://opam.ocaml.org/#8cda2e5a)
# path D:\.opam\dkml\.opam-switch\build\conf-gmp-powm-sec.3
# command D:\a\_temp\msys64\usr\bin\sh.exe -exc cc -c $CFLAGS -I/usr/local/include test.c
# exit-code 127
# env-file D:\.opam\log\conf-gmp-powm-sec-5380-fd851c.env
# output-file D:\.opam\log\conf-gmp-powm-sec-5380-fd851c.out
### output ###
# + cc -c -I/usr/local/include test.c
# /usr/bin/sh: line 1: cc: command not found
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build conf-gmp-powm-sec 3
| - build mirage-crypto 0.11.2
| - build zarith 1.13
+-
+- The following changes have been performed (the rest was aborted)
| - install alcotest 1.7.0
| - install astring 0.8.5
| - install base-bytes base
| - install cmdliner 1.2.0
| - install conf-gmp 4
| - install cppo 1.6.9
| - install csexp 1.5.2
| - install cstruct 6.2.0
| - install domain-name 0.4.0
| - install dune 3.12.1
| - install dune-configurator 3.12.1
| - install duration 0.2.1
| - install eqaf 0.9
| - install fmt 0.9.0
| - install functoria-runtime 4.4.2
| - install hex 1.5.0
| - install ipaddr 5.5.0
| - install logs 0.7.0
| - install lwt 5.7.0
| - install macaddr 5.5.0
| - install mirage-clock 4.2.0
| - install mirage-clock-unix 4.2.0
| - install mirage-runtime 4.4.2
| - install mirage-time 3.0.0
| - install mirage-time-unix 3.0.0
| - install mirage-unix 5.0.1
| - install mtime 2.0.0
| - install ocaml-compiler-libs v0.12.4
| - install ocaml-syntax-shims 1.0.0
| - install ocamlbuild 0.14.2+win+unix
| - install ocamlfind 1.9.5
| - install ocplib-endian 1.2
| - install ounit2 2.2.7
| - install ppx_derivers 1.2.1
| - install ppx_deriving 5.2.1
| - install ppx_deriving_yojson 3.7.0
| - install ppxlib 0.30.0
| - install ptime 1.1.0
| - install randomconv 0.1.3
| - install re 1.11.0
| - install result 1.5
| - install seq base
| - install sexplib0 v0.16.0
| - install stdlib-shims 0.3.0
| - install topkg 1.0.7
| - install uutf 1.0.3
| - install yojson 2.1.2
+-
# Run eval $(opam env '--root=D:\.opam') to update the current shell environment
The former state can be restored with:
D:\a\mirage-crypto\mirage-crypto\.ci\sd4\bs\bin\opam.exe switch import "D:\\.opam\\dkml\\.opam-switch\\backup\\state-20240222120353.export"
========= [START OF TROUBLESHOOTING] ===========
========= [TROUBLESHOOTING] conf-gmp-powm-sec-5380-fd851c.out ===========
[conf-gmp-powm-sec-5380-fd851c.out] + cc -c -I/usr/local/include test.c
[conf-gmp-powm-sec-5380-fd851c.out] /usr/bin/sh: line 1: cc: command not found
========= [TROUBLESHOOTING] mirage-crypto-5380-bd0157.out ===========
[mirage-crypto-5380-bd0157.out] File "src/dune", line 10, characters 16-25:
[mirage-crypto-5380-bd0157.out] 10 | aes_generic aes_aesni ghash_generic ghash_pclmul ghash_ctmul des_generic
[mirage-crypto-5380-bd0157.out] ^^^^^^^^^
[mirage-crypto-5380-bd0157.out] (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cstruct /Foaes_aesni.obj -c native/aes_aesni.c)
[mirage-crypto-5380-bd0157.out] cl : Command line error D8021 : invalid numeric argument '/Wextra'
[mirage-crypto-5380-bd0157.out] File "src/dune", line 10, characters 4-15:
[mirage-crypto-5380-bd0157.out] 10 | aes_generic aes_aesni ghash_generic ghash_pclmul ghash_ctmul des_generic
[mirage-crypto-5380-bd0157.out] ^^^^^^^^^^^
[mirage-crypto-5380-bd0157.out] (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cstruct /Foaes_generic.obj -c native/aes_generic.c)
[mirage-crypto-5380-bd0157.out] cl : Command line error D8021 : invalid numeric argument '/Wextra'
[mirage-crypto-5380-bd0157.out] File "src/dune", line 17, characters 9-23:
[mirage-crypto-5380-bd0157.out] 17 | (names chacha_generic)
[mirage-crypto-5380-bd0157.out] ^^^^^^^^^^^^^^
[mirage-crypto-5380-bd0157.out] (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cstruct /Fochacha_generic.obj -c native/chacha_generic.c)
[mirage-crypto-5380-bd0157.out] cl : Command line error D8021 : invalid numeric argument '/Wextra'
[mirage-crypto-5380-bd0157.out] File "src/dune", line 10, characters 65-76:
[mirage-crypto-5380-bd0157.out] 10 | aes_generic aes_aesni ghash_generic ghash_pclmul ghash_ctmul des_generic
[mirage-crypto-5380-bd0157.out] ^^^^^^^^^^^
[mirage-crypto-5380-bd0157.out] (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cstruct /Fodes_generic.obj -c native/des_generic.c)
[mirage-crypto-5380-bd0157.out] cl : Command line error D8021 : invalid numeric argument '/Wextra'
[mirage-crypto-5380-bd0157.out] File "src/dune", line 9, characters 9-28:
[mirage-crypto-5380-bd0157.out] 9 | (names detect_cpu_features misc misc_sse md5 sha1 sha256 sha512 hash_stubs
[mirage-crypto-5380-bd0157.out] ^^^^^^^^^^^^^^^^^^^
[mirage-crypto-5380-bd0157.out] (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cstruct /Fodetect_cpu_features.obj -c native/detect_cpu_features.c)
[mirage-crypto-5380-bd0157.out] cl : Command line error D8021 : invalid numeric argument '/Wextra'
[mirage-crypto-5380-bd0157.out] File "src/dune", line 11, characters 4-10:
[mirage-crypto-5380-bd0157.out] 11 | chacha poly1305-donna entropy_cpu_stubs)
[mirage-crypto-5380-bd0157.out] ^^^^^^
[mirage-crypto-5380-bd0157.out] (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cstruct /Fochacha.obj -c native/chacha.c)
[mirage-crypto-5380-bd0157.out] cl : Command line error D8021 : invalid numeric argument '/Wextra'
[mirage-crypto-5380-bd0157.out] File "src/dune", line 11, characters 26-43:
[mirage-crypto-5380-bd0157.out] 11 | chacha poly1305-donna entropy_cpu_stubs)
[mirage-crypto-5380-bd0157.out] ^^^^^^^^^^^^^^^^^
[mirage-crypto-5380-bd0157.out] (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cstruct /Foentropy_cpu_stubs.obj -c native/entropy_cpu_stubs.c)
[mirage-crypto-5380-bd0157.out] cl : Command line error D8021 : invalid numeric argument '/Wextra'
[mirage-crypto-5380-bd0157.out] File "src/dune", line 10, characters 40-52:
[mirage-crypto-5380-bd0157.out] 10 | aes_generic aes_aesni ghash_generic ghash_pclmul ghash_ctmul des_generic
[mirage-crypto-5380-bd0157.out] ^^^^^^^^^^^^
[mirage-crypto-5380-bd0157.out] (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cstruct /Foghash_pclmul.obj -c native/ghash_pclmul.c)
[mirage-crypto-5380-bd0157.out] cl : Command line error D8021 : invalid numeric argument '/Wextra'
[mirage-crypto-5380-bd0157.out] File "src/dune", line 10, characters 26-39:
[mirage-crypto-5380-bd0157.out] 10 | aes_generic aes_aesni ghash_generic ghash_pclmul ghash_ctmul des_generic
[mirage-crypto-5380-bd0157.out] ^^^^^^^^^^^^^
[mirage-crypto-5380-bd0157.out] (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cstruct /Foghash_generic.obj -c native/ghash_generic.c)
[mirage-crypto-5380-bd0157.out] cl : Command line error D8021 : invalid numeric argument '/Wextra'
[mirage-crypto-5380-bd0157.out] File "src/dune", line 10, characters 53-64:
[mirage-crypto-5380-bd0157.out] 10 | aes_generic aes_aesni ghash_generic ghash_pclmul ghash_ctmul des_generic
[mirage-crypto-5380-bd0157.out] ^^^^^^^^^^^
[mirage-crypto-5380-bd0157.out] (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cstruct /Foghash_ctmul.obj -c native/ghash_ctmul.c)
[mirage-crypto-5380-bd0157.out] cl : Command line error D8021 : invalid numeric argument '/Wextra'
[mirage-crypto-5380-bd0157.out] File "src/dune", line 9, characters 66-76:
[mirage-crypto-5380-bd0157.out] 9 | (names detect_cpu_features misc misc_sse md5 sha1 sha256 sha512 hash_stubs
[mirage-crypto-5380-bd0157.out] ^^^^^^^^^^
[mirage-crypto-5380-bd0157.out] (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cstruct /Fohash_stubs.obj -c native/hash_stubs.c)
[mirage-crypto-5380-bd0157.out] cl : Command line error D8021 : invalid numeric argument '/Wextra'
[mirage-crypto-5380-bd0157.out] File "src/dune", line 9, characters 43-46:
[mirage-crypto-5380-bd0157.out] 9 | (names detect_cpu_features misc misc_sse md5 sha1 sha256 sha512 hash_stubs
[mirage-crypto-5380-bd0157.out] ^^^
[mirage-crypto-5380-bd0157.out] (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cstruct /Fomd5.obj -c native/md5.c)
[mirage-crypto-5380-bd0157.out] cl : Command line error D8021 : invalid numeric argument '/Wextra'
[mirage-crypto-5380-bd0157.out] File "src/dune", line 9, characters 34-42:
[mirage-crypto-5380-bd0157.out] 9 | (names detect_cpu_features misc misc_sse md5 sha1 sha256 sha512 hash_stubs
[mirage-crypto-5380-bd0157.out] ^^^^^^^^
[mirage-crypto-5380-bd0157.out] (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cstruct /Fomisc_sse.obj -c native/misc_sse.c)
[mirage-crypto-5380-bd0157.out] cl : Command line error D8021 : invalid numeric argument '/Wextra'
[mirage-crypto-5380-bd0157.out] File "src/dune", line 9, characters 29-33:
[mirage-crypto-5380-bd0157.out] 9 | (names detect_cpu_features misc misc_sse md5 sha1 sha256 sha512 hash_stubs
[mirage-crypto-5380-bd0157.out] ^^^^
[mirage-crypto-5380-bd0157.out] (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cstruct /Fomisc.obj -c native/misc.c)
[mirage-crypto-5380-bd0157.out] cl : Command line error D8021 : invalid numeric argument '/Wextra'
[mirage-crypto-5380-bd0157.out] File "src/dune", line 9, characters 52-58:
[mirage-crypto-5380-bd0157.out] 9 | (names detect_cpu_features misc misc_sse md5 sha1 sha256 sha512 hash_stubs
[mirage-crypto-5380-bd0157.out] ^^^^^^
[mirage-crypto-5380-bd0157.out] (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cstruct /Fosha256.obj -c native/sha256.c)
[mirage-crypto-5380-bd0157.out] cl : Command line error D8021 : invalid numeric argument '/Wextra'
[mirage-crypto-5380-bd0157.out] File "src/dune", line 9, characters 47-51:
[mirage-crypto-5380-bd0157.out] 9 | (names detect_cpu_features misc misc_sse md5 sha1 sha256 sha512 hash_stubs
[mirage-crypto-5380-bd0157.out] ^^^^
[mirage-crypto-5380-bd0157.out] (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cstruct /Fosha1.obj -c native/sha1.c)
[mirage-crypto-5380-bd0157.out] cl : Command line error D8021 : invalid numeric argument '/Wextra'
[mirage-crypto-5380-bd0157.out] File "src/dune", line 11, characters 11-25:
[mirage-crypto-5380-bd0157.out] 11 | chacha poly1305-donna entropy_cpu_stubs)
[mirage-crypto-5380-bd0157.out] ^^^^^^^^^^^^^^
[mirage-crypto-5380-bd0157.out] (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cstruct /Fopoly1305-donna.obj -c native/poly1305-donna.c)
[mirage-crypto-5380-bd0157.out] cl : Command line error D8021 : invalid numeric argument '/Wextra'
[mirage-crypto-5380-bd0157.out] File "src/dune", line 9, characters 59-65:
[mirage-crypto-5380-bd0157.out] 9 | (names detect_cpu_features misc misc_sse md5 sha1 sha256 sha512 hash_stubs
[mirage-crypto-5380-bd0157.out] ^^^^^^
[mirage-crypto-5380-bd0157.out] (cd _build/default/src && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.25.28610\bin\HostX64\x86\cl.exe" -nologo -O2 -Gy- -MD -D_CRT_SECURE_NO_DEPRECATE -nologo -O2 -Gy- -MD --std=c11 -Wall -Wextra -Wpedantic -O3 -I D:/.opam/dkml/lib/ocaml -I D:\.opam\dkml\lib\cstruct -I D:\.opam\dkml\lib\eqaf -I D:\.opam\dkml\lib\eqaf\bigstring -I D:\.opam\dkml\lib\eqaf\cstruct /Fosha512.obj -c native/sha512.c)
[mirage-crypto-5380-bd0157.out] cl : Command line error D8021 : invalid numeric argument '/Wextra'
========= [TROUBLESHOOTING] zarith-5380-7341b5.out ===========
[zarith-5380-7341b5.out] binary ocaml: found in /d/.opam/dkml/bin
[zarith-5380-7341b5.out] binary ocamlc: found in /d/.opam/dkml/bin
[zarith-5380-7341b5.out] binary ocamldep: found in /d/.opam/dkml/bin
[zarith-5380-7341b5.out] binary ocamlmklib: found in /d/.opam/dkml/bin
[zarith-5380-7341b5.out] binary ocamldoc: found in /d/.opam/dkml/bin
[zarith-5380-7341b5.out] binary ocamlopt: found in /d/.opam/dkml/bin
[zarith-5380-7341b5.out] checking compilation with ocamlc -O3 -Wall -Wextra : not working
[zarith-5380-7341b5.out] checking compilation with ocamlc -O: working
[zarith-5380-7341b5.out] include caml/mlvalues.h: found
[zarith-5380-7341b5.out] library dynlink.cmxa: found
[zarith-5380-7341b5.out] binary ocamlfind: found in /d/.opam/dkml/bin
[zarith-5380-7341b5.out] OCaml's word size is 32
[zarith-5380-7341b5.out] include gmp.h: not found
[zarith-5380-7341b5.out] include mpir.h: not found
[zarith-5380-7341b5.out] cannot find GMP nor MPIR
Scroll up to see the [TROUBLESHOOTING] logs that begin at the [START OF TROUBLESHOOTING] line
(same for the x86_64 CI). I've no clue what the underlying issue is, maybe you have an idea?
somehow it looks like in cfg.ml the std_flags doesn't take the match ccomp_opt with Some "msvc" -> .. turn, but the catchall.
and also the opam install --yes --deps-only --with-test .. mirage-crypto-ec .. leads to mirage-crypto-pk being installed (or trying to at least)