| Anonymous | Login | Signup for a new account | 2013-05-18 12:31 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
| 0004231 | OCaml | OCaml general | public | 2007-03-15 10:56 | 2012-01-12 10:33 | |||||||
| Reporter | frisch | |||||||||||
| Assigned To | lefessan | |||||||||||
| Priority | normal | Severity | minor | Reproducibility | always | |||||||
| Status | resolved | Resolution | duplicate | |||||||||
| Platform | OS | OS Version | ||||||||||
| Product Version | ||||||||||||
| Target Version | Fixed in Version | |||||||||||
| Summary | 0004231: Link multiple casse le système de types | |||||||||||
| Description | Variante de l'autre bug d'hier, cette fois sans Dynlink... | |||||||||||
| Steps To Reproduce | abstract.mli = sub/abstract.mli: type t val x: t val f: t -> unit abstract.ml: type t = int let x = 10 let f x = Printf.printf "Abstract 1 : %i\n" x api.ml: let r : Abstract.t list ref = ref [] x.ml: let () = Api.r := Abstract.x :: !Api.r; List.iter Abstract.f !Api.r sub/abstract.ml: type t = string let x = "foo" let f x = Printf.printf "Abstract 2 : %s\n" x $ ocamlc -c abstract.mli abstract.ml sub/abstract.mli sub/abstract.ml api.ml x.ml $ ocamlc -o main abstract.ml api.ml x.ml sub/abstract.ml x.ml $ ./main zsh: segmentation fault ./main | |||||||||||
| Tags | No tags attached. | |||||||||||
| Attached Files | ||||||||||||
Relationships |
|||||||||||||||||||||
|
|||||||||||||||||||||
Notes |
|
|
(0003975) frisch (developer) 2007-03-15 11:17 |
On peut faire pareil avec ocamlopt, mais il faut ruser un peu plus à cause (grace?) au test "Files ... and ... both define a module named ...". Heureusement, -pack est là pour nous sauver ! abstract.mli = sub/abstract.mli: type t val x: t val f: t -> unit abstract.ml: type t = int let x = 10 let f x = Printf.printf "Abstract 1 : %i\n" x sub/abstract.ml: type t = string let x = "foo" let f x = Printf.printf "Abstract 2 : %s\n" x api.ml: let r : Abstract.t list ref = ref [] x.ml = sub/x.ml: let () = Api.r := Abstract.x :: !Api.r; List.iter Abstract.f !Api.r compilation: $ ocamlopt -c abstract.mli abstract.ml api.ml x.ml $ cd sub $ ocamlopt -c -for-pack P -I .. x.ml $ ocamlopt -c -for-pack P -I .. abstract.mli $ ocamlopt -c -for-pack P -I .. abstract.ml $ ocamlopt -pack -o p.cmx abstract.cmx x.cmx $ cd .. $ ocamlopt -o main api.cmx abstract.cmx x.cmx sub/p.cmx $ ./main zsh: segmentation fault ./main |
|
(0003976) frisch (developer) 2007-03-15 13:31 |
Après discussion avec Nicolas et Benoit, proposition: (1) interdire (comme le fait déjà ocamlopt) de linker deux modules avec le même nom; (2) interdire le -pack si un des modules packés dépend d'un .cmi d'un module non packé dont la signature mentionne un des modules packés (dans l'exemple, le x.cmo packé dépend de api.cmi, dont la signature mentionne Abstract; or on packe un module de nom Abstract, d'où risque de collision). Je *pense* que ça suffit. |
|
(0006646) lefessan (developer) 2012-01-11 20:11 |
Je ferme ce bug report, car il a été ressoumis en anglais comme 0005461 |
|
(0006653) frisch (developer) 2012-01-12 07:42 |
As far as I can see, 0005461 fixes only the bytecode case. In one the notes here, I give an example with ocamlopt, using -pack. |
|
(0006658) lefessan (developer) 2012-01-12 10:15 |
Je suis d'accord, mais tu parles dans les commentaires de 0005461 du problème avec -pack aussi. Du coup, je préférerais que les deux aspects soient traités dans l'autre bug en anglais. Ou alors, qu'on soumette un nouveau bug report pour le problème avec -pack. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2007-03-15 10:56 | frisch | New Issue | |
| 2007-03-15 11:17 | frisch | Note Added: 0003975 | |
| 2007-03-15 13:31 | frisch | Note Added: 0003976 | |
| 2007-11-10 13:53 | xleroy | Status | new => acknowledged |
| 2009-07-22 09:18 | frisch | Relationship added | related to 0004839 |
| 2009-07-22 09:19 | frisch | Relationship added | related to 0004229 |
| 2012-01-04 07:29 | frisch | Relationship added | has duplicate 0005461 |
| 2012-01-11 20:11 | lefessan | Note Added: 0006646 | |
| 2012-01-11 20:11 | lefessan | Relationship replaced | duplicate of 0005461 |
| 2012-01-11 20:11 | lefessan | Status | acknowledged => resolved |
| 2012-01-11 20:11 | lefessan | Resolution | open => duplicate |
| 2012-01-11 20:11 | lefessan | Assigned To | => lefessan |
| 2012-01-11 20:12 | lefessan | Status | resolved => closed |
| 2012-01-12 07:42 | frisch | Note Added: 0006653 | |
| 2012-01-12 07:42 | frisch | Status | closed => feedback |
| 2012-01-12 07:42 | frisch | Resolution | duplicate => reopened |
| 2012-01-12 10:15 | lefessan | Note Added: 0006658 | |
| 2012-01-12 10:33 | frisch | Relationship added | related to 0005473 |
| 2012-01-12 10:33 | frisch | Status | feedback => resolved |
| 2012-01-12 10:33 | frisch | Resolution | reopened => duplicate |
| Copyright © 2000 - 2011 MantisBT Group |