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: 7932 Reporter:@stedolan Status: new Resolution: open Priority: normal Severity: minor Version: 4.08.0+dev/beta1/beta2 Category: typing Monitored by:@nojb
Bug description
The package frama-c-base does not build with 4.08 or trunk, due to a change in the typing rules around ocamlc -pack.
I've reduced the issue to a minimal example:
==> Cint.ml <==
let is_cint_simplifier = []
==> Cint.mli <==
val is_cint_simplifier: Conditions.simplifier
==> Conditions.ml <==
type simplifier = Lang.pred list
==> Conditions.mli <==
type simplifier = Lang.pred list
==> Lang.ml <==
type pred = unit
==> Lang.mli <==
type pred
==> Pack.mli <==
module Lang : sig
type pred
end
module Cint : sig
val is_cint_simplifier: Conditions.simplifier
end
module Conditions : sig
type simplifier = Lang.pred list
end
The command ocamlc -o Pack.cmo -pack Lang.cmo Cint.cmo Conditions.cmo gives the following error on 4.08 and trunk, but succeeds on earlier versions:
File "none", line 1:
Error: The implementation (obtained by packing)
does not match the interface Pack.mli:
In module Cint:
Modules do not match:
sig val is_cint_simplifier : Conditions.simplifier end
is not included in
sig val is_cint_simplifier : Conditions/2.simplifier end
In module Cint:
Values do not match:
val is_cint_simplifier : Conditions/1.simplifier
is not included in
val is_cint_simplifier : Conditions/2.simplifier
File "Pack.mli", line 5, characters 2-47: Expected declaration
File "Cint.mli", line 1, characters 0-45: Actual declaration
File "none", line 1:
Definition of module Conditions/1
File "none", line 1:
Definition of module Conditions/2
(The reproduction case is available as a gist, see below)
I suspect the change occurred during #2175. However, upon examining the test case, I think the new behaviour might be correct: Pack.mli has the modules in the wrong order, and indeed frama-c-base builds correctly when they are reordered. So it's possible that the only change needed is to change a '-' to a '*' in the Changes entry for #2175. But since I don't precisely understand what -pack is meant to do, more opinions would be welcome.
Yes, that looks like the new behaviour is correct. Previously the example will have had a reference to the unpacked [Conditions] module in the interface of the pack which is not what was intended and should not be allowed.
Indeed, we noticed it in our development version and fixed it for the next Frama-C release.
In our tests, fixing the command line order seemed to fix it for 4.08 but prevented it from compiling in <4.08. So we decided to remove the cyclic dependency in the files, which was neither intended nor necessary.
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.
Original bug ID: 7932
Reporter: @stedolan
Status: new
Resolution: open
Priority: normal
Severity: minor
Version: 4.08.0+dev/beta1/beta2
Category: typing
Monitored by: @nojb
Bug description
The package frama-c-base does not build with 4.08 or trunk, due to a change in the typing rules around ocamlc -pack.
I've reduced the issue to a minimal example:
The command ocamlc -o Pack.cmo -pack Lang.cmo Cint.cmo Conditions.cmo gives the following error on 4.08 and trunk, but succeeds on earlier versions:
File "none", line 1:
Error: The implementation (obtained by packing)
does not match the interface Pack.mli:
In module Cint:
Modules do not match:
sig val is_cint_simplifier : Conditions.simplifier end
is not included in
sig val is_cint_simplifier : Conditions/2.simplifier end
In module Cint:
Values do not match:
val is_cint_simplifier : Conditions/1.simplifier
is not included in
val is_cint_simplifier : Conditions/2.simplifier
File "Pack.mli", line 5, characters 2-47: Expected declaration
File "Cint.mli", line 1, characters 0-45: Actual declaration
File "none", line 1:
Definition of module Conditions/1
File "none", line 1:
Definition of module Conditions/2
(The reproduction case is available as a gist, see below)
I suspect the change occurred during #2175. However, upon examining the test case, I think the new behaviour might be correct: Pack.mli has the modules in the wrong order, and indeed frama-c-base builds correctly when they are reordered. So it's possible that the only change needed is to change a '-' to a '*' in the Changes entry for #2175. But since I don't precisely understand what -pack is meant to do, more opinions would be welcome.
Steps to reproduce
git clone https://gist.github.com/d0137407e00ace3e7f83c4414e9adf52.git ocaml-pack-issue && ( cd ocaml-pack-issue; ./run.sh /path/to/ocamlc-408; )
The text was updated successfully, but these errors were encountered: