ocaml-omake / omake

The new home of OMake - docs, downloads, mailing list etc. see:
http://projects.camlcity.org/projects/omake.html
GNU General Public License v2.0
67 stars 25 forks source link

fix for "unbound method: sort" #142

Closed gerdstolpmann closed 2 years ago

gerdstolpmann commented 2 years ago

On some platforms omake outputs a message like

*** omake error:
   File /opt/opam/4.12.0/lib/omake/build/OCaml.om: line 511, characters 42-100
   unbound method: sort

and then the dependencies are apparently wrong, leading to unpredictable followup errors (e.g. "the file is not a bytecode file", or just exception: End_of_file).

The root cause is a problem in OCamlScannerPostproc where it is now tried to take the table of vmounts into account. However, there is a simple programming error in this function, as you cannot sort the vmount map directly, but only the array of the keys of the map. (NB. not all platforms are affected, but only those where the builtin ocamldep-postproc is unavailable - we are seeing this on Mac but not on Linux.)