ManticoreProject / manticore

Parallel ML compiler
http://manticore.cs.uchicago.edu
MIT License
71 stars 7 forks source link

Compilation failure on SMLNJ 110.95 #17

Closed aske closed 5 years ago

aske commented 5 years ago

smlnj 110.95 (probably 110.94 too, as it switched the type of source-file positions from Position.int to Int.int) can't build the latest revision of manticore:

[compiling driver/(x86_64-linux.cm):../codegen/(sources.cm):(wrapper.cm):(group.cm):../common/(sources.cm):error.sml]
common/error.sml:137.39-137.59 Error: operator and operand do not agree [tycon mismatch]
  operator domain: (Int64.int * Int64.int) option *
                   (Int64.int * Int64.int) option
  operand:         span option * span option
  in expression:
    lt ((fn <pat> => <exp>) e1,(fn <pat> => <exp>) e2)
Compilation failed.

It works with the following change:

diff --git a/src/tools/mc/common/error.sml b/src/tools/mc/common/error.sml
index e880c5f18..370ce05eb 100644
--- a/src/tools/mc/common/error.sml
+++ b/src/tools/mc/common/error.sml
@@ -129,9 +129,9 @@ structure Error :> sig
      fun lt (NONE, NONE) = false
        | lt (NONE, _) = true
        | lt (_, NONE) = false
-       | lt (SOME(l1, r1), SOME(l2, r2)) = (case Position.compare(l1, l2)
+       | lt (SOME(l1, r1), SOME(l2, r2)) = (case Int.compare(l1, l2)
         of LESS => true
-         | EQUAL => (Position.compare(r1, r2) = LESS)
+         | EQUAL => (Int.compare(r1, r2) = LESS)
          | GREATER => false
        (* end case *))
      fun cmp (e1 : error, e2 : error) = lt(#pos e1, #pos e2)

I'm not sure if it's the right approach as it would break compilation with smlnj versions before 110.94 (and I didn't see any pragmas/etc for backwards-compatibility of this sort; though I'm really new to SML and might've missed it). What's your usual approach to this?

kavon commented 5 years ago

Thanks for bringing this to our attention.

I'm not sure if it's the right approach as it would break compilation with smlnj versions before 110.94

We don't have a backwards compatibility policy and favor the latest version available once something breaks. I've pushed this patch to trunk and updated our test machine and configure scripts to use 110.95 or newer.