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

ocaml 3.12.0+beta1, mingw: trying to compile ocamlbuild/discard_printf.ml without -rectypes #5077

Closed
vicuna opened this issue Jun 16, 2010 · 7 comments
Labels
Milestone

Comments

@vicuna
Copy link

vicuna commented Jun 16, 2010

Original bug ID: 5077
Reporter: Dmitry Grebeniuk
Status: closed (set by @xavierleroy on 2015-12-11T18:07:22Z)
Resolution: not a bug
Priority: normal
Severity: minor
Version: 3.12.0+beta1 or 3.12.0+rc1
Target version: 4.01.0+dev
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @ygrek

Bug description

I'm trying to build ocaml 3.12.0+beta1 under win32/mingw:

====================================================
$ make -f Makefile.nt world

[...]

make[1]: Leaving directory `/c/overbld/o312/work/ocamldoc'
OCAMLBUILD_FIND=/usr/bin/find ./build/mixed-boot.sh
++ dirname ./build/mixed-boot.sh

  • cd ./build/..
  • touch build/ocamlbuild_mixed_mode
  • mkdir -p _build
  • cp -rf boot _build/
  • ./build/mkconfig.sh
  • ./build/mkmyocamlbuild_config.sh
  • ./build/boot.sh
  • TAGLINE='true: -use_stdlib'
  • ./boot/ocamlrun boot/myocamlbuild.boot -tag-line '' boot/stdlib.cma boot/std_exit.cmo
  • boot/ocamlrun boot/myocamlbuild.boot -tag-line '' -log _boot_log1 ocamlbuild/ocamlbuildlightlib.cma ocamlbuild/ocamlbuildlight.byte
    mkdir ocamlbuild
    boot/ocamlrun boot/ocamldep -modules ocamlbuild/log.mli > ocamlbuild/log.mli.depends
    mkdir stdlib
    boot/ocamlrun boot/ocamldep -modules ocamlbuild/signatures.mli > ocamlbuild/signatures.mli.depends
    boot/ocamlrun boot/ocamldep -modules ocamlbuild/std_signatures.mli > ocamlbuild/std_signatures.mli.depends
    ../ocamlcomp.sh -c -I ocamlbuild -I stdlib -o ocamlbuild/std_signatures.cmi ocamlbuild/std_signatures.mli

[...]

../ocamlcomp.sh -c -I ocamlbuild -I stdlib -o ocamlbuild/discard_printf.cmo ocamlbuild/discard_printf.ml
File "ocamlbuild/discard_printf.ml", line 14, characters 19-25:
Error: This expression has type 'a -> 'b
but an expression was expected of type 'b
Exit code 2 while executing this command:
../ocamlcomp.sh -c -I ocamlbuild -I stdlib -o ocamlbuild/discard_printf.cmo ocamlbuild/discard_printf.ml
make: *** [ocamlbuild-mixed-boot] Error 2

====================================================

I've uploaded full build log.

File attachments

@vicuna
Copy link
Author

vicuna commented Jun 17, 2010

Comment author: Dmitry Grebeniuk

If I add
"boot/ocamlrun boot/myocamlbuild.boot -show-tags ocamlbuild/discard_printf.ml"
before
"boot/ocamlrun boot/myocamlbuild.boot [...] ocamlbuild/ocamlbuildlightlib.cma ocamlbuild/ocamlbuildlight.byte"

in file build/boot.sh, I get different results on linux (ubuntu) and on win32/mingw.
On linux:

================

  • boot/ocamlrun boot/myocamlbuild.boot -show-tags ocamlbuild/discard_printf.ml
    Tags for "ocamlbuild/discard_printf.ml":
    {. annot, debug, extension:ml, file:ocamlbuild/discard_printf.ml,
    include_unix, ocaml, quiet, rectypes, traverse, use_stdlib, warn_L,
    warn_R, warn_Z, warn_error_A .}
    ================

On mingw:

  • boot/ocamlrun boot/myocamlbuild.boot -show-tags ocamlbuild/discard_printf.ml
    Tags for "ocamlbuild/discard_printf.ml":
    {. extension:ml, file:ocamlbuild/discard_printf.ml, ocaml, quiet, traverse,
    windows .}
    ================

It seems that ocamlbuild on mingw doesn't read _tags files (in root and in ocamlbuild/ subdirectory).

@vicuna
Copy link
Author

vicuna commented Jul 2, 2010

Comment author: Dmitry Grebeniuk

I have workaround for this bug. Replace all "OCAMLBUILD_FIND=/usr/bin/find" with "OCAMLBUILD_FIND=find" in Makefile.nt (of course, mingw/msys bin directories should appear before windows' directories in PATH).

I don't know the exact reason and I don't want to dig for it, because the code (ocamlbuild/slurp.ml) reads the output of "find" utility to get list of files and directories, instead of using Unix library functions, and I've got lost in all these magical quotings (Printf.sprintf "%s > '%s'" in ocamlbuild/slurp.ml, "bash -c " + arcane String.subst in ocamlbuild/my_std.ml).

@vicuna
Copy link
Author

vicuna commented Jul 10, 2012

Comment author: @damiendoligez

Is this problem still present in 4.00 ?

@vicuna
Copy link
Author

vicuna commented Jul 11, 2012

Comment author: @protz

Strange. I built 3.12.1 some time ago on Win32/MinGW/MSys and it worked fine for me.

@vicuna
Copy link
Author

vicuna commented Jul 18, 2012

Comment author: @damiendoligez

Dmitry, are you using msys? We do not support that configuration directly. At any rate, the OCAMLBUILD_FIND variable should point to the Unix version of find, not to the Microsoft one (which is bundled with the MS compilers, AFAIR).

@vicuna
Copy link
Author

vicuna commented Jul 18, 2012

Comment author: Dmitry Grebeniuk

First, sorry for delay. I could not find mingw environment to compile OCaml and had no time to make it. (it seems that OCaml 4 (or recent 3.12) needs new flexdll, so old environment is unusable here.)
Yes, I'm using mingw+msys without cygwin, and with some patches it works perfectly, so if it's easier for you not to support "without cygwin" option, let's leave everything as it is now, I'll make necessary patches and/or will use OCAMLBUILD_FIND variable when I'll have tasks that require OCaml/win.
So, if my configuration is not supported, this bug report is not a bug report at all, so let's close it.

@vicuna
Copy link
Author

vicuna commented Jul 19, 2012

Comment author: @damiendoligez

OK, thanks for the reply.

@vicuna vicuna closed this as completed Dec 11, 2015
@vicuna vicuna added this to the 4.01.0 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
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

1 participant