Skip to content

Commit

Permalink
Handle corrupt Systeml.sig when moving build from Moscow ML to Poly.
Browse files Browse the repository at this point in the history
This is analogous to what was done in b151b8f (Jul 2009), which coped
with building a Moscow ML setup on top of a build that used to be
Poly. There the claim was made that the reverse situation (the one
fixed in this commit) didn't need anything done to it. That was
because poly's Systeml.ui was being generated afresh with every
configure, right up until 331d321 (Jan 2014).
  • Loading branch information
mn200 committed Aug 4, 2014
1 parent c00b123 commit 5acc417
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tools-poly/configure.sml
Expand Up @@ -260,14 +260,21 @@ let
val sigfile = fullPath [holdir, "tools", "Holmake", "Systeml.sig"]
val uifile = fullPath [holdir, "sigobj", "Systeml.ui"]
fun to_sigobj s = bincopy s (fullPath [holdir, "sigobj", Path.file s])
val uifile_content =
fullPath [holdir, "sigobj", "Systeml.sig"] ^ "\n"
in
if not (canread uifile) orelse
Time.>(modTime sigfile, modTime uifile)
Time.>(modTime sigfile, modTime uifile) orelse
OS.FileSys.fileSize uifile > size uifile_content
(* if the file is this large it's been generated by Moscow ML, or is
otherwise wrong *)
then
let
val oo = TextIO.openOut uifile
in
TextIO.output (oo, fullPath [holdir, "sigobj", "Systeml.sig"] ^ "\n");
(* note how this is "compiling" straight into sigobj, rather than
doing anything in the source directory, tools/Holmake *)
TextIO.output (oo, uifile_content);
TextIO.closeOut oo;
print "sig "
end
Expand Down

0 comments on commit 5acc417

Please sign in to comment.