Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004940OCaml~DO NOT USE (was: OCaml general)public2009-12-14 18:022009-12-30 16:40
Assigned Todoligez 
PrioritynormalSeverityminorReproducibilityhave not tried
PlatformOSOS Version
Product Version 
Target VersionFixed in Version3.12.0+dev 
Summary0004940: Problem with end-on-line convention on bytecomp/
DescriptionWhen using "ocamlc -output-obj" with a recent version of OCaml compiled from the branch version/3.11 of the SVN, using the Win32 MSVC port, I get errors like:

csml_bytecode.c : error C4335: Mac file format detected: please convert the source file to either DOS or UNIX format
File "_none_", line 1, characters 0-1:
Error: Error while building custom runtime system

The culprit is very probably some non-Unix end-of-lines in the file, in parts that generate literal C code. Applying the dos2unix tool to solves the problem.

Possible fixes:
- do not use Mac end-of-lines for OCaml sources;
- do not insert end-of-lines in literal strings (instead, terminate lines with \n\).

Btw, we also have to apply dos2unix to the file VERSION to be able to compile OCaml (but this is not new).

FWIW, we use the "DOS / text" install mode of Cygwin, not the "Unix / binary" mode.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
doligez (administrator)
2009-12-28 14:19

We do not use Mac end-of-lines for OCaml sources. In fact, there isn't a single occurrence of CR in
the whole source tree.

What probably happens is this:
- there are end-of-lines in literal strings
- they are translated by your Cygwin into CR-LF when OCaml reads and compiles the source,
   so the string contains CR-LF
- when the compiler outputs them as CR-LF, your cygwin again translates the LF into CR-LF,
   resulting in CR-CR-LF in the output file.

The short-term solution is to terminate the lines of with \n\, the long-term solution
is to do that for all compiler source files, and to add a warning for naked end-of-lines in string

We have made the change to for 3.11.2+rc1, we'll do the rest for 3.12.
doligez (administrator)
2009-12-30 16:40

added the warning and escaped all end-of-lines in strings (in the trunk)

- Issue History
Date Modified Username Field Change
2009-12-14 18:02 frisch New Issue
2009-12-28 14:19 doligez Note Added: 0005209
2009-12-28 14:19 doligez Assigned To => doligez
2009-12-28 14:19 doligez Status new => acknowledged
2009-12-30 16:40 doligez Note Added: 0005214
2009-12-30 16:40 doligez Status acknowledged => closed
2009-12-30 16:40 doligez Resolution open => fixed
2009-12-30 16:40 doligez Fixed in Version => 3.12.0+dev
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-03-03 17:55 doligez Category -OCaml general => -(deprecated) general
2017-03-03 18:01 doligez Category -(deprecated) general => ~deprecated (was: OCaml general)
2017-03-06 17:04 doligez Category ~deprecated (was: OCaml general) => ~DO NOT USE (was: OCaml general)

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker