On Wed, Jul 16, 2003 at 11:19:41PM +0200, Denis Barbier wrote: > On Wed, Jul 16, 2003 at 11:05:46PM +0200, Sven Luther wrote: > [...] > > > As I am pretty inexperienced with ocaml, I dare asking this question: > > > when multiple ocaml versions are installed, could ocamlrun be a wrapper > > > and call the right version? E.g. if the program was compiled against > > > ocaml 3.07, it calls ocamlrun-3.07. > > > This way bytecodes have a #!/usr/bin/ocamlrun shebang line like other > > > distros, and they are not broken when ocaml is upgraded. > > > Of course I have no idea whether this is doable. > > > > No, this does not work. When you upgrade the ocaml compiler suite, you > > have to recompile all the programs so that they will run with the new > > ocamlrun. the ocamlc compiler embeds the #!/usr/bin/ocamlrun line > > corresponding on where its actual compiler is. Thus in the suffix > > version, ocamlc-3.07 will embedd ocqamlrun-3.07, even if it was called > > trough a ocamlc symlink. > > Sven, you misunderstood my point, I will try to explain it better. > Given that ocamlc-3.06 ships ocamlrun-3.06 and ocamlc-3.07 ships > ocamlrun-3.07, imagine now that /usr/bin/ocamlrun is a shell > script (for instance) which detects the ocaml version needed to run > the bytecode and calls the right version. > This is somewhat similar to the autoconf wrapper.
Ok, this could work, but i don't like it. You would have to guess the right version from the bytecode file. I cannot easily get this with either objinfo or file, and even the the .cmo and such don't have a direct reference to the ocaml version, just the object format version. I would have to look at the code or something to see if this was easily possible, or ask the ocaml team about it. I don't really have time for it now though. Mmm, maybe Stefano knows. Friendly, Sven Luther

