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

v3 errors with "error Only Win32 target is supported!" #822

Closed
JasonGross opened this issue Jul 8, 2024 · 3 comments
Closed

v3 errors with "error Only Win32 target is supported!" #822

JasonGross opened this issue Jul 8, 2024 · 3 comments
Labels

Comments

@JasonGross
Copy link

  C:\hostedtoolcache\windows\opam\2.2.0\x86_64\opam.exe switch --no-install --packages=ocaml-base-compiler.4.11.1 create .
  
  <><> Installing new switch packages <><><><><><><><><><><><><><><><><><><><><><>
  Switch invariant: ["ocaml-base-compiler" {= "4.11.1"}]
  
  <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
  -> installed base-bigarray.base
  -> installed base-threads.base
  -> installed base-unix.base
  -> retrieved ocaml-config.3  (2 extra sources)
  -> retrieved ocaml-config.3  (2 extra sources)
  -> retrieved ocaml-base-compiler.4.11.1  (https://github.com/ocaml/ocaml/archive/4.11.1.tar.gz)
  [ERROR] The compilation of ocaml-base-compiler.4.11.1 failed at "make -j3 world".
  
  #=== ERROR while compiling ocaml-base-compiler.4.11.1 =========================#
  # context     2.2.0 | win32/x86_64 |  | git+https://github.com/ocaml/opam-repository.git
  # path        D:\a\fiat-crypto\fiat-crypto\_opam\.opam-switch\build\ocaml-base-compiler.4.11.1
  # command     D:\cygwin\bin\make.exe -j3 world
  # exit-code   2
  # env-file    D:\.opam\log\ocaml-base-compiler-2360-cbf09e.env
  # output-file D:\.opam\log\ocaml-base-compiler-2360-cbf09e.out
  ### output ###
  # /usr/bin/make -C runtime  all
  # make[1]: Entering directory '/cygdrive/d/a/fiat-crypto/fiat-crypto/_opam/.opam-switch/build/ocaml-base-compiler.4.11.1/runtime'
  # echo "D:\a\fiat-crypto\fiat-crypto\_opam/lib/ocaml/stublibs" > ld.conf
  # tr -d '\r' < caml/instruct.h | \
  # sed -n -e '/^  /s/ \([A-Z]\)/ \&\&lbl_\1/gp' \
  #        -e '/^}/q' > caml/jumptbl.h
  # echo "D:\a\fiat-crypto\fiat-crypto\_opam/lib/ocaml" >> ld.conf
  # ../tools/make-version-header.sh ../VERSION > caml/version.h
  # gcc -c -O2 -fno-strict-aliasing -fwrapv -Wall -Wdeclaration-after-statement -fno-common -fexcess-precision=standard -fno-tree-vrp -g -D_FILE_OFFSET_BITS=64 -U_WIN32 -D_REENTRANT -DCAML_NAME_SPACE   -o stacks_b.o stacks.c
  # gcc -c -O2 -fno-strict-aliasing -fwrapv -Wall -Wdeclaration-after-statement -fno-common -fexcess-precision=standard -fno-tree-vrp -g -D_FILE_OFFSET_BITS=64 -U_WIN32 -D_REENTRANT -DCAML_NAME_SPACE   -o fix_code_b.o fix_code.c
  # In file included from C:/mingw64/x86_64-w64-mingw32/include/corecrt.h:10,
  #                  from C:/mingw64/x86_64-w64-mingw32/include/crtdefs.h:10,
  #                  from C:/mingw64/x86_64-w64-mingw32/include/string.h:9,
  #                  from stacks.c:20:
  # C:/mingw64/x86_64-w64-mingw32/include/_mingw.h:271:2: error: #error Only Win32 target is supported!
  #   271 | #error Only Win32 target is supported!
  #       |  ^~~~~
  # In file included from C:/mingw64/x86_64-w64-mingw32/include/stdarg.h:140,
  #                  from C:/mingw64/lib/gcc/x86_64-w64-mingw32/12.2.0/include/stdarg.h:1,
  #                  from caml/misc.h:30,
  #                  from caml/fail.h:26,
  #                  from stacks.c:22:
  # C:/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h:11:2: error: #error Only Win32 target is supported!

mit-plv/fiat-crypto#1925
https://github.com/mit-plv/fiat-crypto/actions/runs/9754963239/job/26922701015?pr=1925

@smorimoto
Copy link
Member

The PR adding windows support only back-ported the necessary fixes on OCaml 4.13 and up.

@JasonGross
Copy link
Author

Why did ocaml-setup v2 work fine here, but v3 does not?

@smorimoto
Copy link
Member

@JasonGross Because the version of opam has been updated to use the native opam repository instead of the slightly outdated repository for Windows. It should be possible to add support for older versions by backporting some commits to the OCaml compiler side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants