Skip to content

Build on MinGW: examples/wiki fails #328

@camlspotter

Description

@camlspotter

The build fails at the compilation of wiki.js:

$ make
...
C:\cygwin\...\js_of_ocaml\compiler\js_of_ocaml: Error: End_of_file
Raised at file "jsoo_compile.ml", line 41, characters 28-29
Re-raised at file "jsoo_compile.ml", line 47, characters 10-13
Called from file "jsoo_compile.ml", line 114, characters 6-300
../Makefile.common:11: recipe for target 'wiki.js' failed
...

The EOF is raised by really_input ic s 0 n of Util.read_file. Unlike the other example .ml files, wikicreole.ml is created from wikicreole.mll, and it is in DOS format with \r in MinGW OCaml. While in_channel_length returns bytes of the channel not taking into account the EOL translations, really_input does. Therefore the n from in_channel_length is too big for really_input and the EOF exception is raised. For details, please refer to the comment of in_channel_length.

Possible quick fix is to open the file using open_in_bin instead of open_in in Util.read_file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions