You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 3545 Reporter: administrator Status: closed (set by @xavierleroy on 2013-08-01T08:48:16Z) Resolution: fixed Priority: normal Severity: feature Category: ~DO NOT USE (was: OCaml general) Monitored by:@gasche nogin
If I have a .cmi that is generated by compiling a ".mli-free" .ml, and the .ml
has shadowing, then an attempt to re-compile .ml while type-checking against the
.cmi will fail with a type error!
% ocamlc -version
3.08.2
% ls x.*
x.ml
% cat x.ml
let x = 1
let x = "s"
% ocamlc -c x.ml
% ls x.*
x.cmi x.cmo x.ml
% ocamlopt -c -intf-suffix .cmi x.ml
The implementation x.ml does not match the interface x.cmi:
Values do not match: val x : string is not included in val x : int
P.S. You might wonder why one would want to do something like this in the first
place. Basically, I want to have build rules that would allow:
a) building both native and bytecode versions of an OCaml project
b) parallelized builds.
I want to be able to say that in the absence of .mli, the way to generate .cmi
file is to run ocamlc on .ml. The problem with is is that once the .cmi is
generated by the ocamlc, some "consumer" of that .cmi may end up running in
parallel with the ocamlopt for the .ml. Since ocamlopt would create the .cmi
again and will actually overwrite it in place, I am likely to get a "corrupted
.cmi" error message from the "consumer" process.
I was hoping to be able to solve this by using "ocamlopt -intf-suffix .cmi" for
compiling .ml files whenever building both native and bytecode versions. This
did not work because of this bug.
Original bug ID: 3545
Reporter: administrator
Status: closed (set by @xavierleroy on 2013-08-01T08:48:16Z)
Resolution: fixed
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)
Monitored by: @gasche nogin
Bug description
Full_Name: Aleksey Nogin
Version: 3.08.2
OS: Mandrake Linux 10.0
Submission from: wasco.cs.caltech.edu (131.215.44.173)
If I have a .cmi that is generated by compiling a ".mli-free" .ml, and the .ml
has shadowing, then an attempt to re-compile .ml while type-checking against the
.cmi will fail with a type error!
% ocamlc -version
3.08.2
% ls x.*
x.ml
% cat x.ml
let x = 1
let x = "s"
% ocamlc -c x.ml
% ls x.*
x.cmi x.cmo x.ml
% ocamlopt -c -intf-suffix .cmi x.ml
The implementation x.ml does not match the interface x.cmi:
Values do not match: val x : string is not included in val x : int
P.S. You might wonder why one would want to do something like this in the first
place. Basically, I want to have build rules that would allow:
a) building both native and bytecode versions of an OCaml project
b) parallelized builds.
I want to be able to say that in the absence of .mli, the way to generate .cmi
file is to run ocamlc on .ml. The problem with is is that once the .cmi is
generated by the ocamlc, some "consumer" of that .cmi may end up running in
parallel with the ocamlopt for the .ml. Since ocamlopt would create the .cmi
again and will actually overwrite it in place, I am likely to get a "corrupted
.cmi" error message from the "consumer" process.
I was hoping to be able to solve this by using "ocamlopt -intf-suffix .cmi" for
compiling .ml files whenever building both native and bytecode versions. This
did not work because of this bug.
This "build rules" issue is discussed in slightly more detail in a bug report
for the OMake build system is http://bugzilla.metaprl.org/show_bug.cgi?id=421
The text was updated successfully, but these errors were encountered: