From 39d18c9541eea6b8b3eb96d04b6783f254e572e1 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 6 Nov 2017 18:33:48 +0800 Subject: [PATCH 1/8] Enable -safe-string everywhere Useful for testing on OCaml < 4.06.0 --- examples/custom-utop/jbuild | 1 + examples/interact/jbuild | 1 + src/lib/jbuild | 1 + src/top/expunge/jbuild | 1 + src/top/jbuild | 1 + 5 files changed, 5 insertions(+) diff --git a/examples/custom-utop/jbuild b/examples/custom-utop/jbuild index c19d49d..3da432d 100644 --- a/examples/custom-utop/jbuild +++ b/examples/custom-utop/jbuild @@ -2,5 +2,6 @@ (executable ((name myutop) + (flags (:standard -safe-string)) (link_flags (-linkall)) (libraries (utop)))) diff --git a/examples/interact/jbuild b/examples/interact/jbuild index 68e1edd..abe396f 100644 --- a/examples/interact/jbuild +++ b/examples/interact/jbuild @@ -2,5 +2,6 @@ (executable ((name test_program) + (flags (:standard -safe-string)) (link_flags (-linkall)) (libraries (utop)))) diff --git a/src/lib/jbuild b/src/lib/jbuild index a2d849b..62139eb 100644 --- a/src/lib/jbuild +++ b/src/lib/jbuild @@ -4,6 +4,7 @@ ((name uTop) (public_name utop) (wrapped false) + (flags (:standard -safe-string)) (modes (byte)) (libraries (compiler-libs.toplevel findlib.top lambda-term threads)) (preprocess (action (run ${bin:cppo} -V OCAML:${ocaml_version} ${<}))))) diff --git a/src/top/expunge/jbuild b/src/top/expunge/jbuild index d41a15b..0080610 100644 --- a/src/top/expunge/jbuild +++ b/src/top/expunge/jbuild @@ -2,4 +2,5 @@ (executable ((name expunge) + (flags (:standard -safe-string)) (libraries (unix)))) diff --git a/src/top/jbuild b/src/top/jbuild index ff6a8c2..d58293a 100644 --- a/src/top/jbuild +++ b/src/top/jbuild @@ -3,6 +3,7 @@ (executables ((names (utop)) (libraries (utop)) + (flags (:standard -safe-string)) (link_flags (-linkall)))) (rule From fa043105fb4745f6a5b3fa153e92a6845f1db089 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 6 Nov 2017 18:35:25 +0800 Subject: [PATCH 2/8] Add lwt_react to dependencies --- utop.opam | 1 + 1 file changed, 1 insertion(+) diff --git a/utop.opam b/utop.opam index 7f8b2c2..e170a9c 100644 --- a/utop.opam +++ b/utop.opam @@ -15,6 +15,7 @@ depends: [ "ocamlfind" {>= "1.7.2"} "lambda-term" {>= "1.2"} "lwt" + "lwt_react" "camomile" "react" {>= "1.0.0"} "cppo" {build & >= "1.1.2"} From 89c3355a2bcf05feb6954fee3ac1b2940fa073cb Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 6 Nov 2017 18:45:27 +0800 Subject: [PATCH 3/8] Naive fix for 4.06.0 --- src/lib/uTop.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/uTop.ml b/src/lib/uTop.ml index 0af8603..bad3359 100644 --- a/src/lib/uTop.ml +++ b/src/lib/uTop.ml @@ -180,7 +180,10 @@ let discard_formatters pps f = (* Output functions. *) let out_functions = { Format.out_string = (fun _ _ _ -> ()); out_flush = ignore; - out_newline = ignore; out_spaces = ignore; + out_newline = ignore; out_spaces = ignore +#if OCAML_VERSION >= (4, 06, 0) + ; out_indent = ignore +#endif } in (* Replace formatter functions. *) List.iter (fun pp -> Format.pp_set_formatter_out_functions pp out_functions) pps; From ec6b3144ba8e731a26a09b9dbae07d074eba0772 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 6 Nov 2017 18:45:40 +0800 Subject: [PATCH 4/8] Update jbuild workspace Use latest version of 4.04, add 4.05.0, and 4.06.0 --- jbuild-workspace.dev | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/jbuild-workspace.dev b/jbuild-workspace.dev index 14d2539..280b85e 100644 --- a/jbuild-workspace.dev +++ b/jbuild-workspace.dev @@ -1,7 +1,6 @@ ;; This file is used by `make all-supported-ocaml-versions` (context ((switch 4.02.3))) (context ((switch 4.03.0))) -(context ((switch 4.04.1))) -(context ((switch 4.05.0+trunk))) -;; 4.06 support is broken for now -;; (context ((switch 4.06.0+trunk))) +(context ((switch 4.04.2))) +(context ((switch 4.05.0))) +(context ((switch 4.06.0))) From 5926808b126e9175613c91fc11c1ce543cd5a272 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 6 Nov 2017 18:49:49 +0800 Subject: [PATCH 5/8] Fix formatting in descr --- utop.descr | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/utop.descr b/utop.descr index a2cbb91..49ed1af 100644 --- a/utop.descr +++ b/utop.descr @@ -1,6 +1,5 @@ Universal toplevel for OCaml -utop is an improved toplevel for OCaml. It can run in a terminal or in -Emacs. It supports line edition, history, real-time and context -sensitive completion, colors, and more. -It integrates with the tuareg mode in Emacs. +utop is an improved toplevel for OCaml. It can run in a terminal or in Emacs. It +supports line edition, history, real-time and context sensitive completion, +colors, and more. It integrates with the tuareg mode in Emacs. From e383e6ddf0e366f3af6b04f1f120192527017ebd Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Tue, 7 Nov 2017 13:34:14 +0800 Subject: [PATCH 6/8] Remove no longer necessary constraint on the OCaml version We now support >= 4.02.3 --- utop.opam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utop.opam b/utop.opam index e170a9c..f9dbdf6 100644 --- a/utop.opam +++ b/utop.opam @@ -21,4 +21,4 @@ depends: [ "cppo" {build & >= "1.1.2"} "jbuilder" {build & >= "1.0+beta9"} ] -available: [ ocaml-version >= "4.02.3" & ocaml-version < "4.06.0"] +available: [ocaml-version >= "4.02.3"] From 4f18a7b30afcdf419bf84e9c30d214e61ddf4c99 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Tue, 7 Nov 2017 13:34:55 +0800 Subject: [PATCH 7/8] Add build-test to opam file --- utop.opam | 1 + 1 file changed, 1 insertion(+) diff --git a/utop.opam b/utop.opam index f9dbdf6..1645463 100644 --- a/utop.opam +++ b/utop.opam @@ -21,4 +21,5 @@ depends: [ "cppo" {build & >= "1.1.2"} "jbuilder" {build & >= "1.0+beta9"} ] +build-test: [["jbuilder" "runtest" "-p" name "-j" jobs]] available: [ocaml-version >= "4.02.3"] From fb0723fe48b5fc504ca24ed7a2b056e26545e5ec Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Tue, 7 Nov 2017 13:36:23 +0800 Subject: [PATCH 8/8] Update travis --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 1c42081..7f56e12 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,8 @@ env: - OCAML_VERSION=4.02 - OCAML_VERSION=4.03 - OCAML_VERSION=4.04 + - OCAML_VERSION=4.05 + - OCAML_VERSION=4.06 os: - linux - osx