whizard is hosted by Hepforge, IPPP Durham

Opened 14 years ago

Closed 14 years ago

#356 closed defect (fixed)

O'Mega fails to compile with ocaml 3.12.0

Reported by: Christian Speckner Owned by: ohl
Priority: P1 Milestone: v2.0.3
Component: core Version: 2.0.2
Severity: blocker Keywords:
Cc:

Description

All said in description; it seems that the signature of Map has changed in the transition.

File "../../../../src/omega/src/trie.ml", line 208, characters 66-73:
Error: Signature mismatch:
       Modules do not match:
         sig
           type key = M.key list
           type 'a t = 'a Make(M).t
           val empty : 'a t
           val is_empty : 'a t -> bool
           val add : key -> 'a -> 'a t -> 'a t
           val find : key -> 'a t -> 'a
           val remove : key -> 'a t -> 'a t
           val mem : key -> 'a t -> bool
           val map : ('a -> 'b) -> 'a t -> 'b t
           val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
           val iter : (key -> 'a -> unit) -> 'a t -> unit
           val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
           val longest : key -> 'a t -> 'a option * key
           val shortest : key -> 'a t -> 'a option * key
           val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
           val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
           val export :
             (int -> unit) ->
             (int -> unit) ->
             (int -> key -> unit) ->
             (int -> key -> 'a -> unit) -> 'a t -> unit
         end
       is not included in
         sig
           type key = M.key list
           type +'a t
           val empty : 'a t
           val is_empty : 'a t -> bool
           val mem : key -> 'a t -> bool
           val add : key -> 'a -> 'a t -> 'a t
           val singleton : key -> 'a -> 'a t
           val remove : key -> 'a t -> 'a t
           val merge :
             (key -> 'a option -> 'b option -> 'c option) ->
             'a t -> 'b t -> 'c t
           val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
           val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
           val iter : (key -> 'a -> unit) -> 'a t -> unit  
           val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
           val for_all : (key -> 'a -> bool) -> 'a t -> bool
           val exists : (key -> 'a -> bool) -> 'a t -> bool
           val filter : (key -> 'a -> bool) -> 'a t -> 'a t
           val partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a t
           val cardinal : 'a t -> int
           val bindings : 'a t -> (key * 'a) list
           val min_binding : 'a t -> key * 'a
           val max_binding : 'a t -> key * 'a
           val choose : 'a t -> key * 'a
           val split : key -> 'a t -> 'a t * 'a option * 'a t
           val find : key -> 'a t -> 'a
           val map : ('a -> 'b) -> 'a t -> 'b t
           val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
         end
       The field `split' is required but not provided
       The field `choose' is required but not provided
       The field `max_binding' is required but not provided
       The field `min_binding' is required but not provided
       The field `bindings' is required but not provided   
       The field `cardinal' is required but not provided   
       The field `partition' is required but not provided  
       The field `filter' is required but not provided
       The field `exists' is required but not provided
       The field `for_all' is required but not provided
       The field `merge' is required but not provided
       The field `singleton' is required but not provided  

Change History (7)

comment:1 Changed 14 years ago by Juergen Reuter

When you look into the Changes file from O'Caml this seems to be the culprit:

- Map: implement functions from Set that make sense for Map.

comment:2 Changed 14 years ago by Juergen Reuter

Priority: P3P1
Severity: criticalblocker

comment:3 Changed 14 years ago by Juergen Reuter

Very unfortunate. As ThO claims, the problem is the backwards compatibility. Before this problem is not solved (either completely in the O'Caml code or with some configure/Makefile help) we will wait with release 2.0.3. Right now, we do not have a working version with the most recent O'Caml compiler!!!

comment:4 Changed 14 years ago by Christian Speckner

Hm. I must admit that I don't see the problem with backwards compatibility here - it seems the interface of Map was only extended with additional definitions without changing the exisiting ones, so implementing (stubbing) the new defines in the structure will fix the compatibility issue without breaking compatibility with older ocaml versions.

Plus, the new ocaml really is _extremely_ recent (02/08 or so), so we still have some breathing space until we actually run into real-world problems (the only potential issue are people compiling their caml from source, so a note on the Wiki should suffice for now - I'll add one). The only reason I can see why someone would _have_ to go for the new compiler would be support for real-world (non-FPU) ARM systems in the native compiler, and there is no conceivable reason why someone would want to run WHIZARD without a floating point unit :)

comment:5 Changed 14 years ago by Juergen Reuter

Not true: if there are users installing WHIZARD right now, they will grab the most recent version of O'Caml from the web and fall into the trap!

comment:6 in reply to:  4 Changed 14 years ago by ohl

Status: newassigned

Replying to cnspeckn:

Hm. I must admit that I don't see the problem with backwards compatibility here - it seems the interface of Map was only extended with additional definitions without changing the exisiting ones, so implementing (stubbing) the new defines in the structure will fix the compatibility issue without breaking compatibility with older ocaml versions.

That's technically correct, but don't like stubs. Instead I will add a private version of Map.S to trie.mli.

comment:7 Changed 14 years ago by ohl

Resolution: fixed
Status: assignedclosed

Fixed in r2737.

Note: See TracTickets for help on using tickets.