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

dune-configurator for MSVC #6537

Closed
jonahbeckford opened this issue Nov 21, 2022 · 0 comments · Fixed by #6538 or ocaml/opam-repository#22754
Closed

dune-configurator for MSVC #6537

jonahbeckford opened this issue Nov 21, 2022 · 0 comments · Fixed by #6538 or ocaml/opam-repository#22754

Comments

@jonahbeckford
Copy link
Collaborator

Expected Behavior

I have been maintaining the patch at https://github.com/diskuv/diskuv-opam-repository/blob/main/packages/dune-configurator/dune-configurator.2.9.3/files/custom.patch which lets MSVC work when dune-configurator is used.

If we were creating a test file on Windows, the -o flags should instead be one of the following flags:

-Fotest.obj
-Fetest.exe

Actual Behavior

          cl dkml-runtime-apps/duniverse/ocaml-sha/sha512_stubs.obj
sha512_stubs.c
    discover dkml-runtime-apps/duniverse/dkml-c-probe/src/c_abi.ml (exit 2)
(cd _build/default/dkml-runtime-apps/duniverse/dkml-c-probe/src && config/discover.exe)
compiling c program:
 | #include <stdio.h>
 | #include <discover_osinfo.h>
 |
 | const char *s0 = "BEGIN-0-" DKML_OS_NAME "-END";
run: cl -nologo -O2 -Gy- -MD    -I Z:\dow1\dkml\_opam\.opam-switch\build\dune.2.9.3+shim.1.0.1\_build\default\dkml-runtime-apps\duniverse\dkml-c-probe\src -I Z:/dow1/lib/ocaml -o C:\Users\beckf\AppData\Local\Temp\buildfd33e7.dune\ocaml-configurator287304\c-test-0\test.obj -c C:\Users\beckf\AppData\Local\Temp\buildfd33e7.dune\ocaml-configurator287304\c-test-0\test.c
-> process exited with code 0
-> stdout:
 | test.c
-> stderr:
 | cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release
Fatal error: exception Sys_error("C:\\Users\\beckf\\AppData\\Local\\Temp\\buildfd33e7.dune\\ocaml-configurator287304\\c-test-0\\test.obj: No such file or directory")

Reproduction

This needs the MSVC compiler and a Cygwin/MSYS2 environment:

git clone https://github.com/diskuv/dkml-runtime-apps.git
cd dkml-runtime-apps
git switch 4c2fe53328ef3bb9b68c931b2c174847fb44b04d
opam install .

Additional information

I looked at the latest Dune code in the main branch ... it still uses the -o option for the name of the object and executable. (This is one of the reasons I haven't yet upgraded the Windows Diskuv OCaml distribution past Dune 2.9 yet.)

I'll bump up the priority of #6535 so this bug report can be verified.

emillon added a commit to emillon/opam-repository that referenced this issue Dec 21, 2022
…ne-site, dune-rpc, dune-rpc-lwt, dune-private-libs, dune-glob, dune-configurator, dune-build-info, dune-action-plugin and chrome-trace (3.6.2)

CHANGES:

- Fix configurator when using the MSVC compiler (ocaml/dune#6538, fixes ocaml/dune#6537, @nojb)

- Fix running the RPC server on windows (ocaml/dune#6721 fixes ocaml/dune#6720, @rgrinberg)
jonahbeckford pushed a commit to diskuv/diskuv-opam-repository that referenced this issue Dec 23, 2022
…ne-site, dune-rpc, dune-rpc-lwt, dune-private-libs, dune-glob, dune-configurator, dune-build-info, dune-action-plugin and chrome-trace (3.6.2)

CHANGES:

- Fix configurator when using the MSVC compiler (ocaml/dune#6538, fixes ocaml/dune#6537, @nojb)

- Fix running the RPC server on windows (ocaml/dune#6721 fixes ocaml/dune#6720, @rgrinberg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment