diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04b0d7ebef9..4cc9fe72bb0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,7 +75,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - ocamlv: [ 4.02.3, 4.03.0, 4.04.2, 4.05.0, 4.06.1, 4.07.1, 4.08.1, 4.09.1, 4.10.2, 4.11.2, 4.12.0 ] + ocamlv: [ 4.03.0, 4.04.2, 4.05.0, 4.06.1, 4.07.1, 4.08.1, 4.09.1, 4.10.2, 4.11.2, 4.12.0 ] include: - os: macos-latest ocamlv: 4.12.0 diff --git a/configure b/configure index 59d8c0e217a..73fb7f5fa78 100755 --- a/configure +++ b/configure @@ -2185,7 +2185,7 @@ if test -x bootstrap/ocaml/bin/ocamlc -o -x bootstrap/ocaml/bin/ocamlopt ; then fi # XXX This isn't strictly correct for Windows -MIN_OCAML_VERSION=4.02.3 +MIN_OCAML_VERSION=4.03.0 # checking for ocamlc if test -n "$ac_tool_prefix"; then @@ -3504,7 +3504,7 @@ CPATH=$CPATH LIBRARY_PATH=$LIBRARY_PATH -# Check that OCaml version is greater or equal to 4.02.3 +# Check that OCaml version is greater or equal to 4.03.0 # Native Windows builds require at least 4.06.0 for the Unicode runtime. for ac_prog in gawk mawk nawk awk do @@ -3585,7 +3585,7 @@ x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version if test "$ax_compare_version" = "true" ; then - as_fn_error $? "Your version of OCaml: $OCAMLVERSION is not supported" "$LINENO" 5 + as_fn_error $? "Your version of OCaml ($OCAMLVERSION) is not supported" "$LINENO" 5 fi diff --git a/configure.ac b/configure.ac index b786aae4cc8..c87b5b297a5 100644 --- a/configure.ac +++ b/configure.ac @@ -15,7 +15,7 @@ AS_IF([ test -x bootstrap/ocaml/bin/ocamlc -o -x bootstrap/ocaml/bin/ocamlopt ], ]) # XXX This isn't strictly correct for Windows -MIN_OCAML_VERSION=4.02.3 +MIN_OCAML_VERSION=4.03.0 AC_PROG_OCAML if test "x$OCAMLC" = "xno"; then @@ -86,13 +86,13 @@ AC_SUBST(LIB_PREFIX,$LIB_PREFIX) AC_SUBST(CPATH,$CPATH) AC_SUBST(LIBRARY_PATH,$LIBRARY_PATH) -# Check that OCaml version is greater or equal to 4.02.3 +# Check that OCaml version is greater or equal to 4.03.0 # Native Windows builds require at least 4.06.0 for the Unicode runtime. AS_IF([test "x${enable_version_check}" != "xno"], [ AS_IF([ test ${WIN32} -eq 1 ],[MIN_OCAML_VERSION=4.06.0]) AX_COMPARE_VERSION( [$OCAMLVERSION], [lt], [$MIN_OCAML_VERSION], - AC_MSG_ERROR([Your version of OCaml: $OCAMLVERSION is not supported])) + AC_MSG_ERROR([Your version of OCaml ($OCAMLVERSION) is not supported])) ]) AC_MSG_CHECKING([for compiler type]) diff --git a/doc/modules b/doc/modules index 4054065b115..bb6f19c9620 100644 --- a/doc/modules +++ b/doc/modules @@ -11,7 +11,7 @@ src │   ├── opamJson.ml Wrapper on Jsonm; only needed for some debug options │   ├── opamStd.ml Generic stdlib functions (String, List, Option, Sys submodules...) │   ├── opamConsole.ml Console output, ANSI color, logging and user querying -│   ├── opamCompat.ml.4.01/4.02 Compatibility layer (Bytes, etc.) for different OCaml versions +│   ├── opamCompat.ml Compatibility layer for different OCaml versions │   │   # system handling │   ├── opamProcess.ml Process and job handling, with logs, termination status, etc. │   ├── opamSystem.ml Bindings of lots of filesystem and system operations diff --git a/master_changes.md b/master_changes.md index 698af60023e..6b11787bb5d 100644 --- a/master_changes.md +++ b/master_changes.md @@ -77,6 +77,7 @@ Prefixes used to help generate release notes, changes, and blog posts: ## Build * Bump src_exts and fix build compat with Dune 2.9.0 [#4752 @dra27] * Upgrade to dose3 >= 6.1 and vendor dose3 7.0.0 [#4760 @kit-ty-kate] + * Change minimum required OCaml to 4.03.0 [#4770 @dra27] ## Infrastructure * diff --git a/opam-client.opam b/opam-client.opam index 45bfbee35d8..65492ea91e2 100644 --- a/opam-client.opam +++ b/opam-client.opam @@ -26,7 +26,7 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ] depends: [ - "ocaml" {>= "4.02.3"} + "ocaml" {>= "4.03.0"} "opam-state" {= version} "opam-solver" {= version} "base64" {>= "3.1.0"} diff --git a/opam-core.opam b/opam-core.opam index 35f04ab4a91..5f15ff3a5c5 100644 --- a/opam-core.opam +++ b/opam-core.opam @@ -26,7 +26,7 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ] depends: [ - "ocaml" {>= "4.02.3"} + "ocaml" {>= "4.03.0"} "base-unix" "base-bigarray" "ocamlgraph" diff --git a/opam-devel.opam b/opam-devel.opam index 9ee69c0e91f..94657675f3c 100644 --- a/opam-devel.opam +++ b/opam-devel.opam @@ -26,7 +26,7 @@ build: [ [make "%{name}%.install"] ] depends: [ - "ocaml" {>= "4.02.3"} + "ocaml" {>= "4.03.0"} "opam-client" {= version} "cmdliner" {>= "0.9.8"} "dune" {>= "1.11.0"} diff --git a/opam-format.opam b/opam-format.opam index eac89aee9ad..09ee763f6a2 100644 --- a/opam-format.opam +++ b/opam-format.opam @@ -26,7 +26,7 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ] depends: [ - "ocaml" {>= "4.02.3"} + "ocaml" {>= "4.03.0"} "opam-core" {= version} "opam-file-format" {>= "2.1.3"} "re" {>= "1.9.0"} diff --git a/opam-installer.opam b/opam-installer.opam index 90a7beb77a7..7be49878f2a 100644 --- a/opam-installer.opam +++ b/opam-installer.opam @@ -28,7 +28,7 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ] depends: [ - "ocaml" {>= "4.02.3"} + "ocaml" {>= "4.03.0"} "opam-format" {= version} "cmdliner" {>= "0.9.8"} "dune" {>= "1.11.0"} diff --git a/opam-repository.opam b/opam-repository.opam index 9f9f5e4656e..b1d4c7608fb 100644 --- a/opam-repository.opam +++ b/opam-repository.opam @@ -26,7 +26,7 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ] depends: [ - "ocaml" {>= "4.02.3"} + "ocaml" {>= "4.03.0"} "opam-format" {= version} "dune" {>= "1.11.0"} ] diff --git a/opam-solver.opam b/opam-solver.opam index e44dd609275..2d5a18b4294 100644 --- a/opam-solver.opam +++ b/opam-solver.opam @@ -26,7 +26,7 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ] depends: [ - "ocaml" {>= "4.02.3"} + "ocaml" {>= "4.03.0"} "opam-format" {= version} "mccs" {>= "1.1+9"} "dose3" {>= "6.1"} diff --git a/opam-state.opam b/opam-state.opam index 995985d3fed..4027953dc9e 100644 --- a/opam-state.opam +++ b/opam-state.opam @@ -26,7 +26,7 @@ build: [ ["dune" "build" "-p" name "-j" jobs] ] depends: [ - "ocaml" {>= "4.02.3"} + "ocaml" {>= "4.03.0"} "opam-repository" {= version} "re" {>= "1.9.0"} "dune" {>= "1.11.0"} diff --git a/src/client/opamCLIVersion.ml b/src/client/opamCLIVersion.ml index 728e1683613..8c941bfcc23 100644 --- a/src/client/opamCLIVersion.ml +++ b/src/client/opamCLIVersion.ml @@ -8,8 +8,6 @@ (* *) (**************************************************************************) -open OpamCompat - type t = int * int let supported_versions = [(2, 0); (2, 1)] @@ -41,9 +39,9 @@ let of_json = function | `String x -> of_string_opt x | _ -> None -let ( >= ) = Stdlib.( >= ) -let ( < ) = Stdlib.( < ) -let compare = Stdlib.compare +let ( >= ) = OpamCompat.Stdlib.( >= ) +let ( < ) = OpamCompat.Stdlib.( < ) +let compare = OpamCompat.Stdlib.compare let previous cli = let f previous version = @@ -66,9 +64,9 @@ module Sourced = struct end module Op = struct - let ( @>= ) (c,_) = Stdlib.( >= ) c - let ( @< ) (c,_) = Stdlib.( < ) c - let ( @= ) (c,_) = Stdlib.( = ) c + let ( @>= ) (c,_) = OpamCompat.Stdlib.( >= ) c + let ( @< ) (c,_) = OpamCompat.Stdlib.( < ) c + let ( @= ) (c,_) = OpamCompat.Stdlib.( = ) c end module O = struct diff --git a/src/client/opamCliMain.ml b/src/client/opamCliMain.ml index 6d95049bae1..4a4c822f568 100644 --- a/src/client/opamCliMain.ml +++ b/src/client/opamCliMain.ml @@ -10,7 +10,6 @@ (**************************************************************************) open Cmdliner -open OpamTypes open OpamStateTypes open OpamTypesBase open OpamStd.Op @@ -24,7 +23,7 @@ exception InvalidFlagContent of string * (string * string) option exception InvalidNewFlag of OpamCLIVersion.Sourced.t * string * OpamCLIVersion.t let raise_invalid_cli : - (OpamCLIVersion.Sourced.t, string option) OpamCompat.Result.t -> 'a + (OpamCLIVersion.Sourced.t, string option) result -> 'a = function | Ok ocli -> raise (InvalidCLI ocli) | Error None -> raise (InvalidFlagContent ("cli", None)) diff --git a/src/client/opamCommands.ml b/src/client/opamCommands.ml index 7ebfd1aab45..e296f074d0f 100644 --- a/src/client/opamCommands.ml +++ b/src/client/opamCommands.ml @@ -13,7 +13,6 @@ open Cmdliner open OpamArg open OpamTypes open OpamStateTypes -open OpamTypesBase open OpamStd.Op let self_upgrade_exe opamroot = diff --git a/src/client/opamListCommand.ml b/src/client/opamListCommand.ml index 0e30772c14f..9ce2ff2a031 100644 --- a/src/client/opamListCommand.ml +++ b/src/client/opamListCommand.ml @@ -9,7 +9,6 @@ (* *) (**************************************************************************) -open OpamCompat open OpamParserTypes.FullPos open OpamTypes open OpamStateTypes diff --git a/src/core/opamCompat.ml b/src/core/opamCompat.ml index f0f944b38e2..d3086e6e74b 100644 --- a/src/core/opamCompat.ml +++ b/src/core/opamCompat.ml @@ -8,30 +8,9 @@ (* *) (**************************************************************************) -module String = -#if OCAML_VERSION >= (4, 3, 0) - String -#else -struct - include String +module String = String - let lowercase_ascii = lowercase - let uppercase_ascii = uppercase - let capitalize_ascii = capitalize -end -#endif - -module Char = -#if OCAML_VERSION >= (4, 3, 0) - Char -#else -struct - include Char - - let lowercase_ascii = lowercase - let uppercase_ascii = uppercase -end -#endif +module Char = Char module Printexc = #if OCAML_VERSION >= (4, 5, 0) @@ -55,17 +34,7 @@ struct end #endif -module Uchar = -#if OCAML_VERSION >= (4, 3, 0) - Uchar -#else -struct - type t = int - - let of_int i = i - external to_int : t -> int = "%identity" -end -#endif +module Uchar = Uchar module Buffer = #if OCAML_VERSION >= (4, 6, 0) @@ -117,13 +86,13 @@ module Result = #else struct type ('a, 'e) t -#if OCAML_VERSION >= (4, 3, 0) = ('a, 'e) result -#endif = Ok of 'a | Error of 'e end #endif #if OCAML_VERSION < (4, 7, 0) module Stdlib = Pervasives +#else +module Stdlib = Stdlib #endif diff --git a/src/core/opamCompat.mli b/src/core/opamCompat.mli index ff1920fad8a..48c0b4ca999 100644 --- a/src/core/opamCompat.mli +++ b/src/core/opamCompat.mli @@ -8,30 +8,9 @@ (* *) (**************************************************************************) -module String -#if OCAML_VERSION >= (4, 3, 0) -= String -#else -: sig - include module type of struct include String end +module String = String - val lowercase_ascii : string -> string - val uppercase_ascii : string -> string - val capitalize_ascii : string -> string -end -#endif - -module Char -#if OCAML_VERSION >= (4, 3, 0) -= Char -#else -: sig - include module type of struct include Char end - - val lowercase_ascii: char -> char - val uppercase_ascii: char -> char -end -#endif +module Char = Char module Printexc #if OCAML_VERSION >= (4, 5, 0) @@ -57,17 +36,7 @@ module Unix end #endif -module Uchar -#if OCAML_VERSION >= (4, 3, 0) -= Uchar -#else -: sig - type t - - val of_int : int -> t - external to_int : t -> int = "%identity" -end -#endif +module Uchar = Uchar module Buffer #if OCAML_VERSION >= (4, 6, 0) @@ -97,13 +66,13 @@ module Result #else : sig type ('a, 'e) t -#if OCAML_VERSION >= (4, 3, 0) = ('a, 'e) result -#endif = Ok of 'a | Error of 'e end #endif #if OCAML_VERSION < (4, 7, 0) module Stdlib = Pervasives +#else +module Stdlib = Stdlib #endif diff --git a/src/core/opamConsole.ml b/src/core/opamConsole.ml index 9098ea01459..c8eb45d2746 100644 --- a/src/core/opamConsole.ml +++ b/src/core/opamConsole.ml @@ -9,8 +9,6 @@ (* *) (**************************************************************************) -open OpamCompat - (* Global configuration *) let debug () = abs OpamCoreConfig.(!r.debug_level) > 0 @@ -165,7 +163,7 @@ let utf8_symbol main ?(alternates=[]) s = main in let b = Buffer.create 4 in - Buffer.add_utf_8_uchar b scalar; + OpamCompat.Buffer.add_utf_8_uchar b scalar; Buffer.contents b with Failure _ | Not_found -> diff --git a/src/core/opamConsole.mli b/src/core/opamConsole.mli index be08f5d8dcb..39c8412d2c7 100644 --- a/src/core/opamConsole.mli +++ b/src/core/opamConsole.mli @@ -46,30 +46,30 @@ val acolor : text_style -> unit -> string -> string val acolor_w : int -> text_style -> Format.formatter -> string -> unit module Symbols : sig - val rightwards_arrow : OpamCompat.Uchar.t - val box_drawings_light_down_and_right : OpamCompat.Uchar.t - val box_drawings_light_horizontal : OpamCompat.Uchar.t - val box_drawings_light_vertical : OpamCompat.Uchar.t - val box_drawings_light_up_and_right : OpamCompat.Uchar.t - val box_drawings_light_right : OpamCompat.Uchar.t - val circled_division_slash : OpamCompat.Uchar.t - val asterisk_operator : OpamCompat.Uchar.t - val north_east_arrow : OpamCompat.Uchar.t - val south_east_arrow : OpamCompat.Uchar.t - val clockwise_open_circle_arrow : OpamCompat.Uchar.t - val greek_small_letter_lambda : OpamCompat.Uchar.t - val latin_capital_letter_o_with_stroke : OpamCompat.Uchar.t - val six_pointed_black_star : OpamCompat.Uchar.t - val upwards_arrow : OpamCompat.Uchar.t - val downwards_arrow : OpamCompat.Uchar.t - val up_down_arrow : OpamCompat.Uchar.t - val downwards_double_arrow : OpamCompat.Uchar.t - val downwards_black_arrow : OpamCompat.Uchar.t - val black_down_pointing_triangle : OpamCompat.Uchar.t + val rightwards_arrow : Uchar.t + val box_drawings_light_down_and_right : Uchar.t + val box_drawings_light_horizontal : Uchar.t + val box_drawings_light_vertical : Uchar.t + val box_drawings_light_up_and_right : Uchar.t + val box_drawings_light_right : Uchar.t + val circled_division_slash : Uchar.t + val asterisk_operator : Uchar.t + val north_east_arrow : Uchar.t + val south_east_arrow : Uchar.t + val clockwise_open_circle_arrow : Uchar.t + val greek_small_letter_lambda : Uchar.t + val latin_capital_letter_o_with_stroke : Uchar.t + val six_pointed_black_star : Uchar.t + val upwards_arrow : Uchar.t + val downwards_arrow : Uchar.t + val up_down_arrow : Uchar.t + val downwards_double_arrow : Uchar.t + val downwards_black_arrow : Uchar.t + val black_down_pointing_triangle : Uchar.t end val utf8_symbol: - OpamCompat.Uchar.t -> ?alternates:OpamCompat.Uchar.t list -> string -> string + Uchar.t -> ?alternates:Uchar.t list -> string -> string (** Logging *) diff --git a/src/core/opamCoreConfig.ml b/src/core/opamCoreConfig.ml index 53687d73104..065fe911d53 100644 --- a/src/core/opamCoreConfig.ml +++ b/src/core/opamCoreConfig.ml @@ -8,8 +8,6 @@ (* *) (**************************************************************************) -open OpamCompat - module E = struct type OpamStd.Config.E.t += diff --git a/src/core/opamDirTrack.ml b/src/core/opamDirTrack.ml index e556b1f34d0..c40c3b28170 100644 --- a/src/core/opamDirTrack.ml +++ b/src/core/opamDirTrack.ml @@ -8,7 +8,6 @@ (* *) (**************************************************************************) -open OpamCompat open OpamStd.Op open OpamProcess.Job.Op diff --git a/src/core/opamFilename.ml b/src/core/opamFilename.ml index 567f019108c..011c0156813 100644 --- a/src/core/opamFilename.ml +++ b/src/core/opamFilename.ml @@ -400,7 +400,6 @@ let flock flag ?dontblock file = OpamSystem.flock flag ?dontblock (to_string fil let with_flock flag ?dontblock file f = let lock = OpamSystem.flock flag ?dontblock (to_string file) in try - let open OpamCompat in let (fd, ch) = match OpamSystem.get_lock_fd lock with | exception Not_found -> @@ -410,14 +409,14 @@ let with_flock flag ?dontblock file f = else "/dev/null" in - let ch = Stdlib.open_out null in + let ch = OpamCompat.Stdlib.open_out null in Unix.descr_of_out_channel ch, Some ch | fd -> fd, None in let r = f fd in OpamSystem.funlock lock; - OpamStd.Option.iter Stdlib.close_out ch; + OpamStd.Option.iter OpamCompat.Stdlib.close_out ch; r with e -> OpamStd.Exn.finalise e @@ fun () -> diff --git a/src/core/opamHash.ml b/src/core/opamHash.ml index 3bbf3770596..bb9fb310a2a 100644 --- a/src/core/opamHash.ml +++ b/src/core/opamHash.ml @@ -8,8 +8,6 @@ (* *) (**************************************************************************) -open OpamCompat - type kind = [ `MD5 | `SHA256 | `SHA512 ] let default_kind = `MD5 diff --git a/src/core/opamProcess.ml b/src/core/opamProcess.ml index cde94f23868..e413068df29 100644 --- a/src/core/opamProcess.ml +++ b/src/core/opamProcess.ml @@ -9,8 +9,6 @@ (* *) (**************************************************************************) -open OpamCompat - let log ?level fmt = OpamConsole.log "PROC" ?level fmt @@ -644,7 +642,7 @@ let exit_status p return = (verbose_print_cmd p; List.iter verbose_print_out stdout; List.iter verbose_print_out stderr; - flush Stdlib.stdout); + flush OpamCompat.Stdlib.stdout); let info = make_info ?code ?signal ~cmd:p.p_name ~args:p.p_args ~cwd:p.p_cwd ~metadata:p.p_metadata diff --git a/src/core/opamStd.ml b/src/core/opamStd.ml index c50e9264820..64d7517face 100644 --- a/src/core/opamStd.ml +++ b/src/core/opamStd.ml @@ -9,8 +9,6 @@ (* *) (**************************************************************************) -open OpamCompat - module type SET = sig include Set.S val map: (elt -> elt) -> t -> t @@ -990,7 +988,7 @@ module OpamSys = struct let registered_at_exit = ref [] let at_exit f = - Stdlib.at_exit f; + OpamCompat.Stdlib.at_exit f; registered_at_exit := f :: !registered_at_exit let exec_at_exit () = List.iter @@ -1369,7 +1367,7 @@ module Exn = struct let finalise e f = let bt = Printexc.get_raw_backtrace () in f (); - Printexc.raise_with_backtrace e bt + OpamCompat.Printexc.raise_with_backtrace e bt let finally f k = match k () with diff --git a/src/core/opamStubs.mli b/src/core/opamStubs.mli index 1f95183133d..cbbcd67a5d2 100644 --- a/src/core/opamStubs.mli +++ b/src/core/opamStubs.mli @@ -89,7 +89,7 @@ val delete_glyph_checker : handle * handle -> unit (** Windows only. Given [(dc, font)], deletes the font object and releases the DC. *) -val has_glyph : handle * handle -> OpamCompat.Uchar.t -> bool +val has_glyph : handle * handle -> Uchar.t -> bool (** Windows only. [has_glyph (dc, font) scalar] returns [true] if [font] contains a glyph for [scalar]. diff --git a/src/core/opamSystem.ml b/src/core/opamSystem.ml index 6e570e0e2de..02c51707583 100644 --- a/src/core/opamSystem.ml +++ b/src/core/opamSystem.ml @@ -9,8 +9,6 @@ (* *) (**************************************************************************) -open OpamCompat - type install_warning = [ `Add_exe | `Install_dll | `Install_script | `Install_unknown | `Cygwin | `Cygwin_libraries ] type install_warning_fn = string -> install_warning -> unit diff --git a/src/crowbar/opam-crowbar.opam b/src/crowbar/opam-crowbar.opam index d35609dcfb3..0ebf667c5cf 100644 --- a/src/crowbar/opam-crowbar.opam +++ b/src/crowbar/opam-crowbar.opam @@ -8,7 +8,7 @@ homepage: "https://opam.ocaml.org" bug-reports: "https://github.com/ocaml/opam/issues" dev-repo: "git+https://github.com/ocaml/opam.git" depends: [ - "ocaml" {>= "4.02.3"} + "ocaml" {>= "4.05.0"} "crowbar" "afl" ] diff --git a/src/format/opamFile.ml b/src/format/opamFile.ml index 7324a9e67a6..f6c7bd33757 100644 --- a/src/format/opamFile.ml +++ b/src/format/opamFile.ml @@ -1054,8 +1054,6 @@ module type BestEffortArg = sig include SyntaxFileArg (* Version of file format, as understood by [opam-file-format] *) - (* This attribute can be deleted when 4.02 is ditched *) - [@@@ocaml.warning "-32"] val file_format_version: OpamVersion.t [@@ocaml.warning "-32"] (* Construct the syntax pp, under some conditions. If [condition] is given, diff --git a/src/format/opamPackage.ml b/src/format/opamPackage.ml index 86105a1ddbb..582b25e99ca 100644 --- a/src/format/opamPackage.ml +++ b/src/format/opamPackage.ml @@ -9,7 +9,6 @@ (* *) (**************************************************************************) -open OpamCompat open OpamStd.Op let log fmt = OpamConsole.log "PACKAGE" fmt diff --git a/src/format/opamPp.ml b/src/format/opamPp.ml index 6188ddcce26..fd5d3b68343 100644 --- a/src/format/opamPp.ml +++ b/src/format/opamPp.ml @@ -247,7 +247,7 @@ let fallback pp1 pp2 = OpamStd.Exn.fatal e; let bt = Printexc.get_raw_backtrace () in try pp2.parse ~pos x with _ -> - Printexc.raise_with_backtrace e bt + OpamCompat.Printexc.raise_with_backtrace e bt in { pp1 with parse } diff --git a/src/repository/opamLocal.ml b/src/repository/opamLocal.ml index d1a8c89cfaa..ba5bcd40bb3 100644 --- a/src/repository/opamLocal.ml +++ b/src/repository/opamLocal.ml @@ -10,7 +10,6 @@ (**************************************************************************) open OpamTypes -open OpamTypesBase open OpamProcess.Job.Op let log fmt = OpamConsole.log "RSYNC" fmt diff --git a/src/repository/opamVCS.mli b/src/repository/opamVCS.mli index af051e32c9f..82b8d98a5c0 100644 --- a/src/repository/opamVCS.mli +++ b/src/repository/opamVCS.mli @@ -75,4 +75,4 @@ module type VCS = sig end (** Create a backend from a [VCS] implementation. *) -module Make(VCS : VCS) : OpamRepositoryBackend.S [@@ocaml.warning "-67"] (* TODO: Remove this once we get past OCaml 4.02 *) +module Make(VCS : VCS) : OpamRepositoryBackend.S diff --git a/src/state/dune b/src/state/dune index 33dc0ef2a4d..ae310108174 100644 --- a/src/state/dune +++ b/src/state/dune @@ -4,12 +4,11 @@ (libraries opam-repository re) (synopsis "OCaml Package Manager instance management library") (modules_without_implementation OpamStateTypes) - (modules :standard \ flags) + (modules :standard) (flags (:standard (:include ../ocaml-flags-standard.sexp) (:include ../ocaml-flags-configure.sexp) - (:include ../ocaml-context-flags.sexp) - (:include flags.sexp))) + (:include ../ocaml-context-flags.sexp))) (wrapped false)) (rule @@ -27,7 +26,6 @@ (action (with-stdout-to %{targets} (progn (echo "(* THIS FILE IS GENERATED. See dune file *)\n\n") - (echo "open OpamCompat\n") (echo "let licenses = OpamStd.String.Set.of_list @@ List.map String.lowercase_ascii @@ [\n") (cat spdx-license-list) (echo "]\n") @@ -46,11 +44,3 @@ (system "curl https://raw.githubusercontent.com/spdx/license-list-data/master/json/exceptions.json | jq -rc '.exceptions | map(\" \\\"\" + .licenseExceptionId + \"\\\";\") | join(\"\\n\")'")))) - -(rule - (with-stdout-to flags.ml - (echo "print_string (if String.sub Sys.ocaml_version 0 5 = \"4.02.\" then \"(-w -50)\" else \"()\")"))) - -(rule - (with-stdout-to flags.sexp - (run ocaml %{dep:flags.ml}))) diff --git a/src/state/opamSpdxList.ml b/src/state/opamSpdxList.ml index a3729aa78fc..478ee0fd2d8 100644 --- a/src/state/opamSpdxList.ml +++ b/src/state/opamSpdxList.ml @@ -1,6 +1,5 @@ (* THIS FILE IS GENERATED. See dune file *) -open OpamCompat let licenses = OpamStd.String.Set.of_list @@ List.map String.lowercase_ascii @@ [ "0BSD"; "AAL"; diff --git a/src/state/opamSysPoll.ml b/src/state/opamSysPoll.ml index 17c45501afb..f66bb661dcc 100644 --- a/src/state/opamSysPoll.ml +++ b/src/state/opamSysPoll.ml @@ -8,7 +8,6 @@ (* *) (**************************************************************************) -open OpamCompat open OpamStd.Option.Op let command_output c = diff --git a/src_ext/dune-extlib-src b/src_ext/dune-extlib-src index 6c5f4dd01ab..9aea1fb94e6 100644 --- a/src_ext/dune-extlib-src +++ b/src_ext/dune-extlib-src @@ -1,8 +1,7 @@ (library (name extlib) (public_name extlib) - ; -no-strict-sequence not added until 4.03! - (flags (:standard \ -strict-sequence) -w -3) + (flags :standard -no-strict-sequence -w -3) (modules (:standard \ configure install base64 unzip uChar uTF8)) (preprocess (action (run %{bin:cppo} %{read-lines:compat-level} %{input-file}))) (wrapped false)) diff --git a/src_ext/patches/base64/bring-back-ocaml-402-support.patch b/src_ext/patches/base64/bring-back-ocaml-402-support.patch deleted file mode 100644 index 2b47a912c69..00000000000 --- a/src_ext/patches/base64/bring-back-ocaml-402-support.patch +++ /dev/null @@ -1,65 +0,0 @@ -diff -Naur a/src/base64.ml b/src/base64.ml ---- a/src/base64.ml 2021-02-08 10:46:48.000000000 +0000 -+++ b/src/base64.ml 2021-07-22 17:33:45.000000000 +0000 -@@ -19,6 +19,10 @@ - * - *) - -+type ('a, 'b) result = ('a, 'b) Result.result = -+ | Ok of 'a -+ | Error of 'b -+ - type alphabet = { emap : int array; dmap : int array } - - type sub = string * int * int -diff -Naur a/src/base64.mli b/src/base64.mli ---- a/src/base64.mli 2021-02-08 10:46:48.000000000 +0000 -+++ b/src/base64.mli 2021-07-22 17:28:56.000000000 +0000 -@@ -69,7 +69,7 @@ - ?off:int -> - ?len:int -> - string -> -- (sub, [> `Msg of string ]) result -+ (sub, [> `Msg of string ]) Result.t - (** Same as {!decode_exn} but it returns a result type instead to raise an - exception. Then, it returns a {!sub} string. Decoded input [(str, off, len)] - will starting to [off] and will have [len] bytes - by this way, we ensure to -@@ -81,7 +81,7 @@ - ?off:int -> - ?len:int -> - string -> -- (string, [> `Msg of string ]) result -+ (string, [> `Msg of string ]) Result.t - (** Same as {!decode_exn}, but returns an explicit error message {!result} if it - fails. *) - -@@ -91,7 +91,7 @@ - ?off:int -> - ?len:int -> - string -> -- (string, [> `Msg of string ]) result -+ (string, [> `Msg of string ]) Result.t - (** [encode s] encodes the string [s] into base64. If [pad] is false, no - trailing padding is added. [pad] defaults to [true], and [alphabet] to - {!default_alphabet}. -@@ -109,7 +109,7 @@ - ?off:int -> - ?len:int -> - string -> -- (sub, [> `Msg of string ]) result -+ (sub, [> `Msg of string ]) Result.t - (** Same as {!encode} but return a {!sub}-string instead a plain result. By this - way, we ensure to allocate only one time result. *) - -diff -Naur a/src/dune b/src/dune ---- a/src/dune 2021-02-08 10:46:48.000000000 +0000 -+++ b/src/dune 2021-07-22 17:28:18.000000000 +0000 -@@ -2,7 +2,7 @@ - (name base64) - (modules unsafe base64) - (public_name base64) -- (libraries bytes)) -+ (libraries bytes result)) - - (rule - (copy %{read:../config/which-unsafe-file} unsafe.ml)) diff --git a/src_ext/patches/cmdliner.common/0001-Restore-4.02.3-support.patch b/src_ext/patches/cmdliner.common/0001-Restore-4.02.3-support.patch deleted file mode 100644 index 87768375ae4..00000000000 --- a/src_ext/patches/cmdliner.common/0001-Restore-4.02.3-support.patch +++ /dev/null @@ -1,225 +0,0 @@ -diff -Naur a/_tags b/_tags ---- a/_tags 2019-06-14 09:55:03.000000000 +0000 -+++ b/_tags 2019-11-21 14:29:33.000000000 +0000 -@@ -1,3 +1,3 @@ --true : bin_annot, safe_string -+true : bin_annot, safe_string, package(bytes), package(result) - : include - : include -\ No newline at end of file -diff -Naur a/pkg/META b/pkg/META ---- a/pkg/META 2019-06-14 09:55:03.000000000 +0000 -+++ b/pkg/META 2019-11-21 14:29:33.000000000 +0000 -@@ -1,6 +1,6 @@ - version = "v1.0.4" - description = "Declarative definition of command line interfaces" --requires = "" -+requires = "bytes result" - archive(byte) = "cmdliner.cma" - archive(native) = "cmdliner.cmxa" - plugin(byte) = "cmdliner.cma" -diff -Naur a/src/cmdliner.ml b/src/cmdliner.ml ---- a/src/cmdliner.ml 2019-06-14 09:55:03.000000000 +0000 -+++ b/src/cmdliner.ml 2019-11-21 14:29:33.000000000 +0000 -@@ -4,11 +4,12 @@ - cmdliner v1.0.4 - ---------------------------------------------------------------------------*) - -+let stdlib_compare = compare -+open Result -+ - module Manpage = Cmdliner_manpage - module Arg = Cmdliner_arg - module Term = struct -- type ('a, 'b) stdlib_result = ('a, 'b) result -- - include Cmdliner_term - - (* Deprecated *) -@@ -112,7 +113,7 @@ - ('a, [ term_escape - | `Exn of exn * Printexc.raw_backtrace - | `Parse of string -- | `Std_help of Manpage.format | `Std_version ]) stdlib_result -+ | `Std_help of Manpage.format | `Std_version ]) Result.result - - let run ~catch ei cl f = try (f ei cl :> 'a eval_result) with - | exn when catch -> -@@ -242,7 +243,7 @@ - Error (Cmdliner_base.err_unknown ~kind:"command" maybe ~hints) - | `Ambiguous -> - let ambs = Cmdliner_trie.ambiguities index maybe in -- let ambs = List.sort compare ambs in -+ let ambs = List.sort stdlib_compare ambs in - Error (Cmdliner_base.err_ambiguous ~kind:"command" maybe ~ambs) - - let eval_choice -diff -Naur a/src/cmdliner.mli b/src/cmdliner.mli ---- a/src/cmdliner.mli 2019-06-14 09:55:03.000000000 +0000 -+++ b/src/cmdliner.mli 2019-11-21 14:29:33.000000000 +0000 -@@ -26,6 +26,8 @@ - - (** {1:top Interface} *) - -+open Result -+ - (** Man page specification. - - Man page generation is automatically handled by [Cmdliner], -@@ -1373,6 +1375,7 @@ - - (* Command line interface *) - -+open Result - open Cmdliner - - let lines = -diff -Naur a/src/cmdliner_arg.ml b/src/cmdliner_arg.ml ---- a/src/cmdliner_arg.ml 2019-06-14 09:55:03.000000000 +0000 -+++ b/src/cmdliner_arg.ml 2019-11-21 14:29:33.000000000 +0000 -@@ -6,6 +6,8 @@ - - let rev_compare n0 n1 = compare n1 n0 - -+open Result -+ - (* Invalid_argument strings **) - - let err_not_opt = "Option argument without name" -diff -Naur a/src/cmdliner_arg.mli b/src/cmdliner_arg.mli ---- a/src/cmdliner_arg.mli 2019-06-14 09:55:03.000000000 +0000 -+++ b/src/cmdliner_arg.mli 2019-11-21 14:29:33.000000000 +0000 -@@ -4,6 +4,8 @@ - cmdliner v1.0.4 - ---------------------------------------------------------------------------*) - -+open Result -+ - (** Command line arguments as terms. *) - - type 'a parser = string -> [ `Ok of 'a | `Error of string ] -diff -Naur a/src/cmdliner_base.ml b/src/cmdliner_base.ml ---- a/src/cmdliner_base.ml 2019-06-14 09:55:03.000000000 +0000 -+++ b/src/cmdliner_base.ml 2019-11-21 14:29:33.000000000 +0000 -@@ -280,7 +280,7 @@ - in - parse, print - --let env_bool_parse s = match String.lowercase_ascii s with -+let env_bool_parse s = match String.lowercase s with - | "" | "false" | "no" | "n" | "0" -> `Ok false - | "true" | "yes" | "y" | "1" -> `Ok true - | s -> `Error (err_invalid_val s (alts_str ["true"; "yes"; "false"; "no" ])) -diff -Naur a/src/cmdliner_cline.ml b/src/cmdliner_cline.ml ---- a/src/cmdliner_cline.ml 2019-06-14 09:55:03.000000000 +0000 -+++ b/src/cmdliner_cline.ml 2019-11-21 14:29:33.000000000 +0000 -@@ -4,6 +4,9 @@ - cmdliner v1.0.4 - ---------------------------------------------------------------------------*) - -+let stdlib_compare = compare -+open Result -+ - (* A command line stores pre-parsed information about the command - line's arguments in a more structured way. Given the - Cmdliner_info.arg values mentioned in a term and Sys.argv -@@ -119,7 +122,7 @@ - loop (err :: errs) (k + 1) cl pargs args - | `Ambiguous -> - let ambs = Cmdliner_trie.ambiguities optidx name in -- let ambs = List.sort compare ambs in -+ let ambs = List.sort stdlib_compare ambs in - let err = Cmdliner_base.err_ambiguous "option" name ambs in - loop (err :: errs) (k + 1) cl pargs args - in -diff -Naur a/src/cmdliner_cline.mli b/src/cmdliner_cline.mli ---- a/src/cmdliner_cline.mli 2019-06-14 09:55:03.000000000 +0000 -+++ b/src/cmdliner_cline.mli 2019-11-21 14:29:33.000000000 +0000 -@@ -4,6 +4,8 @@ - cmdliner v1.0.4 - ---------------------------------------------------------------------------*) - -+open Result -+ - (** Command lines. *) - - type t -diff -Naur a/src/cmdliner_docgen.ml b/src/cmdliner_docgen.ml ---- a/src/cmdliner_docgen.ml 2019-11-21 14:29:33.000000000 +0000 -+++ b/src/cmdliner_docgen.ml 2019-11-21 14:29:33.000000000 +0000 -@@ -170,7 +170,7 @@ - | true, true -> (* optional by name *) - let key names = - let k = List.hd (List.sort rev_compare names) in -- let k = String.lowercase_ascii k in -+ let k = String.lowercase k in - if k.[1] = '-' then String.sub k 1 (String.length k - 1) else k - in - compare -@@ -178,8 +178,8 @@ - (key @@ Cmdliner_info.arg_opt_names a1) - | false, false -> (* positional by variable *) - compare -- (String.lowercase_ascii @@ Cmdliner_info.arg_docv a0) -- (String.lowercase_ascii @@ Cmdliner_info.arg_docv a1) -+ (String.lowercase @@ Cmdliner_info.arg_docv a0) -+ (String.lowercase @@ Cmdliner_info.arg_docv a1) - | true, false -> -1 (* positional first *) - | false, true -> 1 (* optional after *) - in -@@ -310,8 +310,8 @@ - - let title ei = - let main = Cmdliner_info.eval_main ei in -- let exec = String.capitalize_ascii (Cmdliner_info.term_name main) in -- let name = String.uppercase_ascii (invocation ~sep:'-' ei) in -+ let exec = String.capitalize (Cmdliner_info.term_name main) in -+ let name = String.uppercase (invocation ~sep:'-' ei) in - let center_header = esc @@ strf "%s Manual" exec in - let left_footer = - let version = match Cmdliner_info.term_version main with -diff -Naur a/src/cmdliner_manpage.ml b/src/cmdliner_manpage.ml ---- a/src/cmdliner_manpage.ml 2019-06-14 09:55:03.000000000 +0000 -+++ b/src/cmdliner_manpage.ml 2019-11-21 14:29:33.000000000 +0000 -@@ -4,6 +4,8 @@ - cmdliner v1.0.4 - ---------------------------------------------------------------------------*) - -+open Result -+ - (* Manpages *) - - type block = -diff -Naur a/src/cmdliner_term.ml b/src/cmdliner_term.ml ---- a/src/cmdliner_term.ml 2019-06-14 09:55:03.000000000 +0000 -+++ b/src/cmdliner_term.ml 2019-11-21 14:29:33.000000000 +0000 -@@ -4,6 +4,8 @@ - cmdliner v1.0.4 - ---------------------------------------------------------------------------*) - -+open Result -+ - type term_escape = - [ `Error of bool * string - | `Help of Cmdliner_manpage.format * string option ] -diff -Naur a/src/cmdliner_term.mli b/src/cmdliner_term.mli ---- a/src/cmdliner_term.mli 2019-06-14 09:55:03.000000000 +0000 -+++ b/src/cmdliner_term.mli 2019-11-21 14:29:33.000000000 +0000 -@@ -4,6 +4,8 @@ - cmdliner v1.0.4 - ---------------------------------------------------------------------------*) - -+open Result -+ - (** Terms *) - - type term_escape = -diff -Naur a/src/dune b/src/dune ---- a/src/dune 2019-06-14 09:55:03.000000000 +0000 -+++ b/src/dune 2019-11-21 14:29:33.000000000 +0000 -@@ -1,4 +1,5 @@ - (library - (public_name cmdliner) -+ (libraries result) - (flags :standard -w -3-6-27-32-35) - (wrapped false)) diff --git a/src_ext/patches/dose3/bring-back-ocaml-402-support.patch b/src_ext/patches/dose3/bring-back-ocaml-402-support.patch deleted file mode 100644 index 77a3f728a50..00000000000 --- a/src_ext/patches/dose3/bring-back-ocaml-402-support.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -Naur a/src/common/util.ml b/src/common/util.ml ---- a/src/common/util.ml 2021-07-22 07:14:19.000000000 +0000 -+++ b/src/common/util.ml 2021-07-22 17:34:13.000000000 +0000 -@@ -90,7 +90,7 @@ - let clean label = - try - let s = Filename.chop_extension (Filename.basename label) in -- String.capitalize_ascii s -+ String.capitalize s - with Invalid_argument _ -> label - - let create ?(enabled = false) label = diff --git a/src_ext/patches/ocamlgraph/restore-4.02-support.patch b/src_ext/patches/ocamlgraph/restore-4.02-support.patch deleted file mode 100644 index 90efc6c8c4d..00000000000 --- a/src_ext/patches/ocamlgraph/restore-4.02-support.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -Naur a/src/dot_lexer.mll b/src/dot_lexer.mll ---- a/src/dot_lexer.mll 2020-10-02 13:47:57.000000000 +0000 -+++ b/src/dot_lexer.mll 2021-03-26 12:32:56.000000000 +0000 -@@ -35,7 +35,7 @@ - "node", NODE; - "edge", EDGE; - ]; -- fun s -> let s = String.lowercase_ascii s in Hashtbl.find h s -+ fun s -> let s = String.lowercase s in Hashtbl.find h s - - } - -diff -Naur a/src/dune b/src/dune ---- a/src/dune 2020-10-02 13:47:57.000000000 +0000 -+++ b/src/dune 2021-03-26 12:33:07.000000000 +0000 -@@ -3,6 +3,7 @@ - (library - (name graph) - (public_name ocamlgraph) -+ (flags :standard -w -3) - (libraries stdlib-shims) - (modules_without_implementation dot_ast sig sig_pack)) -