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

Drop support for OCaml < 4.08 #556

Merged
merged 3 commits into from
Jan 28, 2025
Merged

Conversation

NathanReb
Copy link
Collaborator

No description provided.

@NathanReb
Copy link
Collaborator Author

Not having 4.08 build in the CI is going to be a problem here. Not sure who to contact about that on the ocaml-ci side.

@NathanReb
Copy link
Collaborator Author

I'm a bit surprised as when I run the tests locally I get the following diff:

$ dune runtest
File "test/driver/exception_handling/run.t", line 1, characters 0-0:
diff --git a/_build/.sandbox/7bf643a7b13fe8b4ac90a5ba1f2309f0/default/test/driver/exception_handling/run.t b/_build/.sandbox/7bf643a7b13fe8b4ac90a5ba1f2309f0/default/test/driver/exception_handling/run.t.corrected
index 3fc684ec..cc421bae 100644
--- a/_build/.sandbox/7bf643a7b13fe8b4ac90a5ba1f2309f0/default/test/driver/exception_handling/run.t
+++ b/_build/.sandbox/7bf643a7b13fe8b4ac90a5ba1f2309f0/default/test/driver/exception_handling/run.t.corrected
@@ -143,10 +143,10 @@ when the -embed-errors flag is not passed
 
   $ echo "let _ = [%gen_raise_exc] + [%gen_raise_exc]" > impl.ml
   $ ./extender.exe impl.ml
-  Fatal error: exception Failure("A raised exception")
+  Fatal error: exception (Failure "A raised exception")
   [2]
   $ ./extender.exe -embed-errors impl.ml
-  Fatal error: exception Failure("A raised exception")
+  Fatal error: exception (Failure "A raised exception")
   [2]
 
  In the case of derivers
@@ -155,7 +155,7 @@ when the -embed-errors flag is not passed
   $ echo "type b = int [@@deriving deriver_raised_exception]" >> impl.ml
   $ echo "type b = int [@@deriving deriver_raised_exception2]" >> impl.ml
   $ ./deriver.exe -embed-errors impl.ml
-  Fatal error: exception Failure("A raised exception")
+  Fatal error: exception (Failure "A raised exception")
   [2]
 
  In the case of Constant types
@@ -203,10 +203,10 @@ when the -embed-errors flag is not passed
 
   $ echo "let _ = [%gen_raise_exc] + [%gen_raise_exc]" > impl.ml
   $ ./whole_file_exception.exe impl.ml
-  Fatal error: exception Failure("An exception in a whole file transform")
+  Fatal error: exception (Failure "An exception in a whole file transform")
   [2]
   $ ./whole_file_exception.exe -embed-errors impl.ml
-  Fatal error: exception Failure("An exception in a whole file transform")
+  Fatal error: exception (Failure "An exception in a whole file transform")
   [2]

@patricoferris could you try to build this branch locally on a 4.08 switch to see if you get the same resulsts?

@patricoferris
Copy link
Collaborator

I got the same problem, but I had to jump through a lot of hoops first. It would seem dependencies we have for our benchmarks are giving us grief here: https://ocaml.ci.dev/github/ocaml-ppx/ppxlib/commit/ccfc1007f7f6bbc3482621b103bb5c990bd502f9/variant/debian-12-4.08_opam-2.3#L245-245

After I installed base on 4.08.1 I managed to reproduce your issues @NathanReb. But now, after I remove base it is still failing like we see here... I don't know why the CI is not failing...

@patricoferris
Copy link
Collaborator

To recreate the CI success:

$ opam sw create 4.08.1
$ opam pin . -yn --with-version=dev
$ opam install ppxlib ppxlib-tools
# This doesn't have the test deps
$ opam install cinaps 
# No findlib apparently 
$ opam install ocamlfind 
$ dune runtest
No such package: base
$ dune runtest

Then I went for a opam install base and ran dune runtest and got the same errors.

@NathanReb
Copy link
Collaborator Author

ah right so base actually is an undeclared test dependency of ours but the relevant tests fail silently when it's not installed.

Thanks for your help, I'll look into it!

@NathanReb
Copy link
Collaborator Author

Ok circling back to this. I had initially misunderstood your comments.

  1. The No such package: base comes from a different test, I removed the #require that was causing this as it was not necessary anyway.
  2. The test failure I copied above does not happen if base is not installed initially but it consistently appears once it has been installed even if we remove it. I do still see the errors after removing base myself. This is quite puzzling.

@NathanReb
Copy link
Collaborator Author

Indeed, starting from a fresh switch worked and the tests pass but as soon as I install base it fails again, even though we don't link base.

@NathanReb
Copy link
Collaborator Author

I'm not sure how base is messing up with the exception printing here but it so specific and only relevant to one test that I don't think it's worth investigating this any further, especially since everything works perfectly well when installing our deps and test deps only.

Let's merge!

@NathanReb NathanReb merged commit e26c25f into ocaml-ppx:main Jan 28, 2025
5 of 6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants