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

make cold on Windows: dune error #5601

Closed
rjbou opened this issue Jul 13, 2023 · 7 comments
Closed

make cold on Windows: dune error #5601

rjbou opened this issue Jul 13, 2023 · 7 comments

Comments

@rjbou
Copy link
Collaborator

rjbou commented Jul 13, 2023

Issue originates from ocaml-opam/opam-repository-mingw#10

Hi. I'm glad to try Opam 2.2.0-alpha for Windows because I hope it will simplify the build of Geneweb on that platform. After installing a fresh cygwin64 + upgrading %path, the make cold ends with:

make[1]: Entering directory '/home/Tom/opam2.2.0a'
cd src_ext/dune-local && ocaml bootstrap.ml
ocamlc -output-complete-exe -w -24 -g -o .duneboot.exe -I boot unix.cma boot/libs.ml boot/duneboot.ml
.\.duneboot.exe
/home/Tom/opam2.2.0a/src_ext/dune-local/dune.exe build --profile=release --root .  --promote-install-files -- opam-installer.install opam.install
File "src/stubs/win32/dune", line 24, characters 0-150:
24 | (rule
25 |   (targets opam-putenv.exe)
26 |   (deps    opamInject.c)
27 |   (action  (run ocaml %{dep:build-putenv.ml} %{targets} %{dep:opam-putenv.c} %{dep:cc64})))
Exception: End_of_file.
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
make[1]: *** [Makefile:144: build-opam] Error 1
make[1]: Leaving directory '/home/Tom/opam2.2.0a'
make: *** [Makefile:285: cold] Error 2

Full log here https://gist.github.com/a2line/a2b951b9018a402280ac244f461c8bf5

I tried make cold CONFIGURE_ARGS=--with-private-runtime for the same results. Any idea?

@rjbou
Copy link
Collaborator Author

rjbou commented Jul 13, 2023

From the logs, you installed some packages on your fresh cygwin install. Was it just autoconf, make, mingw64-x86_64-gcc-g++, mingw64-i686-gcc-g++, and patch, or other ones ?

Also you say that you updated your %path, did you run make cold from cygwin or from cmd ?

@rjbou
Copy link
Collaborator Author

rjbou commented Jul 13, 2023

/cc @a2line

@a2line
Copy link

a2line commented Jul 14, 2023

Hi. The shell are still open on that machine so I can paste what I did exactly. We already had a batch for building GeneWeb on Windows, I only added autoconf and mingw64-i686-gcc-g++ here, and launched this on a CMD with administrator rights to install Cygwin:

setup-x86_64.exe -qnNdO -R c:\cygwin64 -s http://cygwin.mirror.constant.com -l c:\cygwin64/var/cache/setup -P rsync -P patch -P diffutils -P curl -P make -P unzip -P git -P m4 -P perl -P perl-IPC-System-Simple -P mingw64-x86_64-gcc-core -P mingw64-x86_64-gmp -p autoconf -p mingw64-i686-gcc-g++

the command make cold CONFIGURE_ARGS=--with-private-runtime was failing because of missing dll so I added the paths as written

set PATH=%PATH%;c:\cygwin64\usr\x86_64-w64-mingw32\sys-root\mingw\bin;c:\cygwin64\bin 

Then I used cygwin console and got what I pasted on first message here.

Note that I've just tried with command prompt and it doesn't work well at all:

DE -D_UNICODE -DWINDOWS_UNICODE=1 -DCAMLDLLIMPORT=  \
  -o prims.o prims.c
rm -f libcamlrun.a && x86_64-w64-mingw32-ar rc libcamlrun.a  interp.b.o misc.b.o stacks.b.o fix_code.b.o startup_aux.b.o startup_byt.b.o freelist.b.o major_gc.b.o minor_gc.b.o memory.b.o alloc.b.o roots_byt.b.o globroots.b.o fail_byt.b.o signals.b.o signals_byt.b.o printexc.b.o backtrace_byt.b.o backtrace.b.o compare.b.o ints.b.o eventlog.b.o floats.b.o str.b.o array.b.o io.b.o extern.b.o intern.b.o hash.b.o sys.b.o meta.b.o parsing.b.o gc_ctrl.b.o md5.b.o obj.b.o lexing.b.o callback.b.o debugger.b.o weak.b.o compact.b.o finalise.b.o custom.b.o dynlink.b.o afl.b.o win32.b.o bigarray.b.o main.b.o memprof.b.o domain.b.o skiplist.b.o codefrag.b.o
prims.c:1619:3: warning: missing terminating " character
prims.c:1619:3: error: missing terminating " character
prims.c:1620:1: warning: missing terminating " character
prims.c:1620:1: error: missing terminating " character

[…]

prims.c:2421:3: error: missing terminating " character
prims.c:2422:1: warning: missing terminating " character
prims.c:2422:1: error: missing terminating " character
prims.c:2423:3: warning: missing terminating " character
prims.c:2423:3: error: missing terminating " character
prims.c:2424:1: warning: missing terminating " character
prims.c:2424:1: error: missing terminating " character
make[3]: *** [../Makefile.common:128: prims.o] Error 1
make[3]: Leaving directory '/home/Tom/opam2.2.0a/bootstrap/ocaml-4.14.1/runtime'
make[2]: *** [Makefile:172: coldstart] Error 2
make[2]: Leaving directory '/home/Tom/opam2.2.0a/bootstrap/ocaml-4.14.1'
make[1]: *** [Makefile:311: world.opt] Error 2
make[1]: Leaving directory '/home/Tom/opam2.2.0a/bootstrap/ocaml-4.14.1'
make: *** [Makefile:278: compiler] Error 2

@rjbou
Copy link
Collaborator Author

rjbou commented Jul 19, 2023

related to #5522

@rjbou
Copy link
Collaborator Author

rjbou commented Jul 19, 2023

I was not able to reproduce. From a fresh Cygwin, I installed the same packages, and launched the same command. And it succeed.
In my case, it was able to detect i686-w64-mingw32-gcc.

image

@a2line
Copy link

a2line commented Jul 21, 2023

Ok. I used the installer of Cygwin and saw in the list of packet that mingw64-i686-gcc-g++ was not installed at all (I can't explain why…). I also added mingw64-i686-gcc-core and it's now building. I'll probably retry from scratch to understand better. It doesn't need to add the path to i686 dlls C:\cygwin64\usr\i686-w64-mingw32\sys-root\mingw\bin to build. I have opam exe working. Thank you @rjbou. You can close the issue, as mine was copied here I can't.

@rjbou
Copy link
Collaborator Author

rjbou commented Jul 21, 2023

Glad to hear!

@rjbou rjbou closed this as completed Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants