ocaml / opam-repository

Main public package repository for opam, the source package manager of OCaml.
https://opam.ocaml.org
Creative Commons Zero v1.0 Universal
511 stars 1.1k forks source link

Error building ocaml-base-compiler.5.2.0 on x86_64 windows #26206

Closed Logan-010 closed 1 week ago

Logan-010 commented 1 week ago

I am attempting to install ocaml via opam 2.2, because DkML OCaml does not use the latest version (& is missing thread support), However, after everything going OK during an opam init the build process fails with a few bizarre error messages while attempting to build ocaml-base-compiler.

⬇ retrieved ocaml-base-compiler.5.2.0  (https://opam.ocaml.org/cache)
[ERROR] The compilation of ocaml-base-compiler.5.2.0 failed at "make -j31".

#=== ERROR while compiling ocaml-base-compiler.5.2.0 ==========================#       
# context     2.2.0 | win32/x86_64 |  | https://opam.ocaml.org#ca7f74d6
# path        ~\AppData\Local\opam\default\.opam-switch\build\ocaml-base-compiler.5.2.0
# command     C:\ProgramData\chocolatey\bin\make.exe -j31
# exit-code   2
# env-file    ~\AppData\Local\Temp\opam-logan-6796\ocaml-base-compiler-6796-f8b303.env
# output-file ~\AppData\Local\Temp\opam-logan-6796\ocaml-base-compiler-6796-f8b303.out
### output ###
# [...]
# runtime/prims.c:2233:3: warning: missing terminating " character
# runtime/prims.c:2233:3: error: missing terminating " character
# runtime/prims.c:2234:1: warning: missing terminating " character
# runtime/prims.c:2234:1: error: missing terminating " character
# runtime/prims.c:2235:3: warning: missing terminating " character
# runtime/prims.c:2235:3: error: missing terminating " character
# runtime/prims.c:2236:1: warning: missing terminating " character
# runtime/prims.c:2236:1: error: missing terminating " character
# make[1]: *** [Makefile:1424: runtime/prims.o] Error 1
# make[1]: *** Waiting for unfinished jobs....
# make[1]: Leaving directory 'C:/Users/logan/AppData/Local/opam/default/.opam-switch/build/ocaml-base-compiler.5.2.0'
# make: *** [Makefile:830: world.opt] Error 2

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><>  🐫
β”Œβ”€ The following actions failed
β”‚ Ξ» build ocaml-base-compiler 5.2.0
└─
β”Œβ”€ The following changes have been performed (the rest was aborted)
β”‚ βˆ— install arch-x86_64               1
β”‚ βˆ— install base-bigarray             base
β”‚ βˆ— install base-threads              base
β”‚ βˆ— install base-unix                 base
β”‚ βˆ— install conf-mingw-w64-gcc-x86_64 1
β”‚ βˆ— install flexdll                   0.43
β”‚ βˆ— install host-arch-x86_64          1
β”‚ βˆ— install host-system-mingw         1
β”‚ βˆ— install mingw-w64-shims           0.2.0
β”‚ βˆ— install ocaml-env-mingw64         1
β”‚ βˆ— install ocaml-options-vanilla     1
β”‚ βˆ— install system-mingw              1
└─

<><> ocaml-base-compiler.5.2.0 troubleshooting ><><><><><><><><><><><><><><>  🐫
=> A failure in the middle of the build may be caused by build parallelism
      (enabled by default).
      Please file a bug report at https://github.com/ocaml/opam-repository/issues
=> You can try installing again including --jobs=1
      to force a sequential build instead.
# Run for /f "tokens=*" %i in ('opam env --switch=default') do @%i to update the
current shell environment
Switch initialisation failed: clean up? ('n' will leave the switch partially installed)

Any help is appreciated!

Logan-010 commented 1 week ago

here is the piece of code the build process is failing on: runtime/prims.c

const char * const caml_names_of_builtin_cprim[] = {
  "caml_abs_float
",
  "caml_acos_float
",
  "caml_acosh_float
",
  "caml_add_float
",
  "caml_alloc_dummy
",
  "caml_alloc_dummy_float
",
  "caml_alloc_dummy_function
",
  "caml_alloc_dummy_infix
",
  "caml_alloc_stack
",

(Note this is not the full file)

Logan-010 commented 1 week ago

fixed it, some odd issue with the c compiler i had in my path.

Instead of 'use tools in path: _" in the opam setup, i selected 'install for me (recommended)', which was recommended for a reason apparently.