Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation failure on SMLNJ 110.95 #17

Closed
aske opened this issue Dec 1, 2019 · 1 comment
Closed

Compilation failure on SMLNJ 110.95 #17

aske opened this issue Dec 1, 2019 · 1 comment

Comments

@aske
Copy link

aske commented Dec 1, 2019

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
Copy link
Member

kavon commented Dec 3, 2019

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.

@kavon kavon closed this as completed Dec 3, 2019
kavon added a commit that referenced this issue Feb 5, 2020
kavon added a commit that referenced this issue Feb 5, 2020
kavon added a commit that referenced this issue Feb 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants