From 9ba1bec19f41dcf71fdc6967c22b5a4460bc5e04 Mon Sep 17 00:00:00 2001 From: Xavier Clerc Date: Sun, 5 Dec 2021 14:41:27 +0000 Subject: [PATCH 1/4] 4.13 --- jupyter/src/repl/caml_args.cppo.ml | 9 +++++++++ jupyter/src/repl/lwt_async_rewrite.cppo.ml | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/jupyter/src/repl/caml_args.cppo.ml b/jupyter/src/repl/caml_args.cppo.ml index 8dafcc4..afa79b2 100644 --- a/jupyter/src/repl/caml_args.cppo.ml +++ b/jupyter/src/repl/caml_args.cppo.ml @@ -151,8 +151,17 @@ module Options = Main_args.Make_bytetop_options (struct let _version () = print_version () let _vnum () = print_version_num () let _no_version = set Clflags.noversion +#if OCAML_VERSION < (4,13,0) let _w s = Warnings.parse_options false s +#else + let _w s = Warnings.parse_options false s |> Option.iter Location.(prerr_alert none) +#endif + +#if OCAML_VERSION < (4,13,0) let _warn_error s = Warnings.parse_options true s +#else + let _warn_error s = Warnings.parse_options true s |> Option.iter Location.(prerr_alert none) +#endif let _warn_help = Warnings.help_warnings let _dparsetree = set Clflags.dump_parsetree let _dtypedtree = set Clflags.dump_typedtree diff --git a/jupyter/src/repl/lwt_async_rewrite.cppo.ml b/jupyter/src/repl/lwt_async_rewrite.cppo.ml index f8bb294..e9e7aff 100644 --- a/jupyter/src/repl/lwt_async_rewrite.cppo.ml +++ b/jupyter/src/repl/lwt_async_rewrite.cppo.ml @@ -163,8 +163,10 @@ let rewrite phrase = if List.exists is_eval pstr then #if OCAML_VERSION < (4,08,0) let tstr, _, _ = Typemod.type_structure !Toploop.toplevel_env pstr Location.none in -#else +#elif OCAML_VERSION < (4,13,0) let tstr, _, _, _ = Typemod.type_structure !Toploop.toplevel_env pstr Location.none in +#else + let tstr, _, _, _ = Typemod.type_structure !Toploop.toplevel_env pstr in #endif Parsetree.Ptop_def (List.map2 rewrite_str_item pstr tstr.Typedtree.str_items) else From 11553e6b980dd8ef2e399d49988224c8b4e351f8 Mon Sep 17 00:00:00 2001 From: Xavier Clerc Date: Tue, 21 Dec 2021 18:15:17 +0000 Subject: [PATCH 2/4] Fix conflict. --- jupyter/src/repl/lwt_async_rewrite.cppo.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jupyter/src/repl/lwt_async_rewrite.cppo.ml b/jupyter/src/repl/lwt_async_rewrite.cppo.ml index e9e7aff..4ed98ee 100644 --- a/jupyter/src/repl/lwt_async_rewrite.cppo.ml +++ b/jupyter/src/repl/lwt_async_rewrite.cppo.ml @@ -163,7 +163,7 @@ let rewrite phrase = if List.exists is_eval pstr then #if OCAML_VERSION < (4,08,0) let tstr, _, _ = Typemod.type_structure !Toploop.toplevel_env pstr Location.none in -#elif OCAML_VERSION < (4,13,0) +#elif OCAML_VERSION < (4,12,0) let tstr, _, _, _ = Typemod.type_structure !Toploop.toplevel_env pstr Location.none in #else let tstr, _, _, _ = Typemod.type_structure !Toploop.toplevel_env pstr in From 9db74c75fd3a864f71e2f51d0c519ad5a9504ea1 Mon Sep 17 00:00:00 2001 From: Xavier Clerc Date: Tue, 21 Dec 2021 18:15:32 +0000 Subject: [PATCH 3/4] Add Travis job for 4.13. --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 84db4b4..02bb172 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,6 +48,10 @@ matrix: env: OCAML_VERSION=4.10.0 ARCHIMEDES=1 - os: linux env: OCAML_VERSION=4.11.0 ARCHIMEDES=1 + - os: linux + env: OCAML_VERSION=4.12.0 ARCHIMEDES=1 + - os: linux + env: OCAML_VERSION=4.13.0 ARCHIMEDES=1 # allow_failures: # - os: linux # env: OPAM_VERSION=2.0.4 OCAML_VERSION=4.09.0 From 72af696a10aca767df4b0441e2d77db207d67c95 Mon Sep 17 00:00:00 2001 From: Xavier Clerc Date: Mon, 27 Dec 2021 10:33:57 +0000 Subject: [PATCH 4/4] Update REPL test for 4.13. --- test/repl/test_evaluation.ml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/repl/test_evaluation.ml b/test/repl/test_evaluation.ml index fea5cca..e01f473 100644 --- a/test/repl/test_evaluation.ml +++ b/test/repl/test_evaluation.ml @@ -165,7 +165,21 @@ let test__long_error_message ctxt = let test__exception ctxt = let status, actual = eval "failwith \"FAIL\"" in let msg = - if Sys.ocaml_version >= "4.11" + if Sys.ocaml_version >= "4.13" + then "\x1b[31mException: Failure \"FAIL\".\n\ + Raised at Stdlib.failwith in file \"stdlib.ml\", line 29, characters 17-33\n\ + Called from Stdlib__Fun.protect in file \"fun.ml\", line 33, characters 8-15\n\ + Re-raised at Stdlib__Fun.protect in file \"fun.ml\", line 38, characters 6-52\n\ + Called from Topeval.load_lambda in file \"toplevel/byte/topeval.ml\", line 89, characters 4-150\n\ + \x1b[0m" + else if Sys.ocaml_version >= "4.12" + then "\x1b[31mException: Failure \"FAIL\".\n\ + Raised at Stdlib.failwith in file \"stdlib.ml\", line 29, characters 17-33\n\ + Called from Stdlib__fun.protect in file \"fun.ml\", line 33, characters 8-15\n\ + Re-raised at Stdlib__fun.protect in file \"fun.ml\", line 38, characters 6-52\n\ + Called from Toploop.load_lambda in file \"toplevel/toploop.ml\", line 212, characters 4-150\n\ + \x1b[0m" + else if Sys.ocaml_version >= "4.11" then "\x1b[31mException: Failure \"FAIL\".\n\ Raised at Stdlib.failwith in file \"stdlib.ml\", line 29, characters 17-33\n\ Called from Toploop.load_lambda in file \"toplevel/toploop.ml\", line 212, characters 17-27\n\x1b[0m"