Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004826OCamlOCaml generalpublic2009-06-18 09:302012-09-17 15:00
ReporterDmitry Grebeniuk 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionsuspended 
PlatformOSOS Version
Product Version3.11.1+rc1 
Target Version4.00.1+devFixed in Version 
Summary0004826: bad error reporting + ocamlbuild/ocamlbuild_where.ml is not created by make -f Makefile.nt world
DescriptionI'm trying to compile ocaml under mingw from sources tarball "ocaml-3.11.1.tar.bz2" using the old procedure described in README.win32.

$ make -f Makefile.nt world
[...]
../ocamlcomp.sh -pack -g ocamlbuild/discard_printf.cmo ocamlbuild/std_signatures.cmi ocamlbuild/signatures.cmi ocamlbuild/my_std.cmo ocamlbuild/my_unix.cmo ocamlbuild/tags.cmo ocamlbuild/display.cmo ocamlbuild/log.cmo ocamlbuild/shell.cmo ocamlbuild/bool.cmo ocamlbuild/glob_ast.cmo ocamlbuild/glob_lexer.cmo ocamlbuild/glob.cmo ocamlbuild/lexers.cmo ocamlbuild/command.cmo ocamlbuild/flags.cmo ocamlbuild/slurp.cmo ocamlbuild/options.cmo ocamlbuild/pathname.cmo ocamlbuild/configuration.cmo ocamlbuild/hygiene.cmo ocamlbuild/digest_cache.cmo ocamlbuild/resource.cmo ocamlbuild/rule.cmo ocamlbuild/solver.cmo ocamlbuild/report.cmo ocamlbuild/tools.cmo ocamlbuild/fda.cmo ocamlbuild/ocaml_arch.cmo ocamlbuild/ocaml_utils.cmo ocamlbuild/ocaml_dependencies.cmo ocamlbuild/ocaml_compiler.cmo ocamlbuild/ocaml_tools.cmo ocamlbuild/ocaml_specific.cmo ocamlbuild/ocamlbuild_where.cmi ocamlbuild/ocamlbuild_Myocamlbuild_config.cmo ocamlbuild/plugin.cmo ocamlbuild/exit_codes.cmo ocamlbuild/hooks.cmo ocamlbuild/main.cmo -o ocamlbuild/ocamlbuild_pack.cmo
Fatal error: exception Sys_error("_none_: No such file or directory")
Exit code 2 while executing this command:
  ../ocamlcomp.sh -pack -g ocamlbuild/discard_printf.cmo ocamlbuild/std_signatures.cmi ocamlbuild/signatures.cmi ocamlbuild/my_std.cmo ocamlbuild/my_unix.cmo ocamlbuild/tags.cmo ocamlbuild/display.cmo ocamlbuild/log.cmo ocamlbuild/shell.cmo ocamlbuild/bool.cmo ocamlbuild/glob_ast.cmo ocamlbuild/glob_lexer.cmo ocamlbuild/glob.cmo ocamlbuild/lexers.cmo ocamlbuild/command.cmo ocamlbuild/flags.cmo ocamlbuild/slurp.cmo ocamlbuild/options.cmo ocamlbuild/pathname.cmo ocamlbuild/configuration.cmo ocamlbuild/hygiene.cmo ocamlbuild/digest_cache.cmo ocamlbuild/resource.cmo ocamlbuild/rule.cmo ocamlbuild/solver.cmo ocamlbuild/report.cmo ocamlbuild/tools.cmo ocamlbuild/fda.cmo ocamlbuild/ocaml_arch.cmo ocamlbuild/ocaml_utils.cmo ocamlbuild/ocaml_dependencies.cmo ocamlbuild/ocaml_compiler.cmo ocamlbuild/ocaml_tools.cmo ocamlbuild/ocaml_specific.cmo ocamlbuild/ocamlbuild_where.cmi ocamlbuild/ocamlbuild_Myocamlbuild_config.cmo ocamlbuild/plugin.cmo ocamlbuild/exit_codes.cmo ocamlbuild/hooks.cmo ocamlbuild/main.cmo -o ocamlbuild/ocamlbuild_pack.cmo
make[2]: *** [ocamlbuild.byte] Error 2
[...]

So, ocamlbuild was not built. I've added "-g" to Makefile.nt:

CAMLC=boot/ocamlrun boot/ocamlc -g -I boot
CAMLOPT=boot/ocamlrun ./ocamlopt -g -I stdlib -I otherlibs/dynlink

and run:

$ OCAMLRUNPARAM=b make -f Makefile.nt world
[...]
../ocamlcomp.sh -pack -g ocamlbuild/discard_printf.cmo ocamlbuild/std_signatures.cmi ocamlbuild/signatures.cmi ocamlbuild/my_std.cmo ocamlbuild/my_unix.cmo ocamlbuild/tags.cmo ocamlbuild/display.cmo ocamlbuild/log.cmo ocamlbuild/shell.cmo ocamlbuild/bool.cmo ocamlbuild/glob_ast.cmo ocamlbuild/glob_lexer.cmo ocamlbuild/glob.cmo ocamlbuild/lexers.cmo ocamlbuild/command.cmo ocamlbuild/flags.cmo ocamlbuild/slurp.cmo ocamlbuild/options.cmo ocamlbuild/pathname.cmo ocamlbuild/configuration.cmo ocamlbuild/hygiene.cmo ocamlbuild/digest_cache.cmo ocamlbuild/resource.cmo ocamlbuild/rule.cmo ocamlbuild/solver.cmo ocamlbuild/report.cmo ocamlbuild/tools.cmo ocamlbuild/fda.cmo ocamlbuild/ocaml_arch.cmo ocamlbuild/ocaml_utils.cmo ocamlbuild/ocaml_dependencies.cmo ocamlbuild/ocaml_compiler.cmo ocamlbuild/ocaml_tools.cmo ocamlbuild/ocaml_specific.cmo ocamlbuild/ocamlbuild_where.cmi ocamlbuild/ocamlbuild_Myocamlbuild_config.cmo ocamlbuild/plugin.cmo ocamlbuild/exit_codes.cmo ocamlbuild/hooks.cmo ocamlbuild/main.cmo -o ocamlbuild/ocamlbuild_pack.cmo
Fatal error: exception Sys_error("_none_: No such file or directory")
Raised by primitive operation at file "pervasives.ml", line 280, characters 20-46
Called from file "parsing/linenum.mll", line 62, characters 11-27
Called from file "parsing/location.ml", line 211, characters 6-51
Called from file "parsing/location.ml", line 219, characters 32-58
Called from file "parsing/location.ml", line 236, characters 2-15
Called from file "driver/errors.ml", line 54, characters 6-34
Called from file "format.ml", line 1155, characters 8-17
Called from file "driver/main.ml", line 197, characters 4-46
Called from file "driver/main.ml", line 200, characters 8-15
Exit code 2 while executing this command:
  ../ocamlcomp.sh -pack -g ocamlbuild/discard_printf.cmo ocamlbuild/std_signatures.cmi ocamlbuild/signatures.cmi ocamlbuild/my_std.cmo ocamlbuild/my_unix.cmo ocamlbuild/tags.cmo ocamlbuild/display.cmo ocamlbuild/log.cmo ocamlbuild/shell.cmo ocamlbuild/bool.cmo ocamlbuild/glob_ast.cmo ocamlbuild/glob_lexer.cmo ocamlbuild/glob.cmo ocamlbuild/lexers.cmo ocamlbuild/command.cmo ocamlbuild/flags.cmo ocamlbuild/slurp.cmo ocamlbuild/options.cmo ocamlbuild/pathname.cmo ocamlbuild/configuration.cmo ocamlbuild/hygiene.cmo ocamlbuild/digest_cache.cmo ocamlbuild/resource.cmo ocamlbuild/rule.cmo ocamlbuild/solver.cmo ocamlbuild/report.cmo ocamlbuild/tools.cmo ocamlbuild/fda.cmo ocamlbuild/ocaml_arch.cmo ocamlbuild/ocaml_utils.cmo ocamlbuild/ocaml_dependencies.cmo ocamlbuild/ocaml_compiler.cmo ocamlbuild/ocaml_tools.cmo ocamlbuild/ocaml_specific.cmo ocamlbuild/ocamlbuild_where.cmi ocamlbuild/ocamlbuild_Myocamlbuild_config.cmo ocamlbuild/plugin.cmo ocamlbuild/exit_codes.cmo ocamlbuild/hooks.cmo ocamlbuild/main.cmo -o ocamlbuild/ocamlbuild_pack.cmo
make[2]: *** [ocamlbuild.byte] Error 2
[...]

I've added a patch to see the actual error message (of course, this patch does the wrong thing):

===============================
--- parsing/location.ml 2009-06-17 06:28:31 +0000
+++ parsing/location.ml 2009-06-17 07:19:57 +0000
@@ -207,7 +207,7 @@
   let (filename, linenum, linebeg) =
     if pos.pos_fname = "" && !input_name = "" then
       ("", -1, 0)
- else if pos.pos_fname = "" then
+ else if pos.pos_fname = "" && !input_name <> "_none_" then
       Linenum.for_position !input_name pos.pos_cnum
     else
       (pos.pos_fname, pos.pos_lnum, pos.pos_bol)

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

The actual error is:

Error: The interface ocamlbuild/ocamlbuild_where.cmi
       declares values, not just types. An implementation must be provided.

I think that user should see such errors without patching compiler.

Then, I've searched for a code that create file "ocamlbuild/ocamlbuild_where.ml" and found that the file is created by "ocamlbuild/start.sh". I don't know why "ocamlbuild/start.sh" was not run, but the following patch creates "ocamlbuild/ocamlbuild_where.ml" from "Makefile.nt":

===============================
--- ocaml-3.11.1/Makefile.nt 2008-11-10 16:13:20 +0000
+++ fix/Makefile.nt 2009-06-17 12:55:00 +0000
@@ -611,6 +611,7 @@
 
 .PHONY: ocamlbuild-mixed-boot
 ocamlbuild-mixed-boot:
+ echo "let bindir = ref \"<start>\";; let libdir = bindir;;" > ./ocamlbuild/ocamlbuild_where.ml
     ./build/mixed-boot.sh
 partialclean::
     rm -rf _build
===============================

I don't know whether this patch is correct (maybe "ocamlbuild/ocamlbuild_where.ml" should be created by some of "build/*.sh" scripts), but it works: ocamlbuild gets compiled and ocamlbuild compiles test projects.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0005009)
Dmitry Grebeniuk (reporter)
2009-06-26 21:32

Sorry, this patch is wrong too: error appears when project has ocamlbuild plugin. File "ocamlbuild/ocamlbuild_where.ml", that was created at the build stage, sets the ocamlbuild's "bindir" + "libdir" to initial value "<start>" even for installed ocamlbuild binaries, and ocamlbuild can't find file "<start>/ocamlbuildlib.cmxa" when it compiles "myocamlbuild.ml". I have no good solution, so I've temporary fixed this issue by patching "Makefile.nt" locally, hardcoding the paths in "echo ..." command. Plugins do work, but this solution is ugly.
(0008091)
doligez (administrator)
2012-09-17 15:00

As far as I can tell, both problems are fixed in 4.00.0.

- Issue History
Date Modified Username Field Change
2009-06-18 09:30 Dmitry Grebeniuk New Issue
2009-06-26 21:32 Dmitry Grebeniuk Note Added: 0005009
2011-05-31 15:56 doligez Status new => acknowledged
2012-07-11 14:47 doligez Target Version => 4.01.0+dev
2012-07-31 13:36 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-09-17 15:00 doligez Note Added: 0008091
2012-09-17 15:00 doligez Status acknowledged => resolved
2012-09-17 15:00 doligez Resolution open => suspended


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker