Skip to content

Commit

Permalink
Change minimum version to 4.03.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dra27 committed Jul 22, 2021
1 parent 59eb601 commit 9018314
Show file tree
Hide file tree
Showing 43 changed files with 68 additions and 490 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion doc/modules
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion opam-client.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
2 changes: 1 addition & 1 deletion opam-core.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion opam-devel.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
2 changes: 1 addition & 1 deletion opam-format.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
2 changes: 1 addition & 1 deletion opam-installer.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
2 changes: 1 addition & 1 deletion opam-repository.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
]
2 changes: 1 addition & 1 deletion opam-solver.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
2 changes: 1 addition & 1 deletion opam-state.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down
14 changes: 6 additions & 8 deletions src/client/opamCLIVersion.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
(* *)
(**************************************************************************)

open OpamCompat

type t = int * int

let supported_versions = [(2, 0); (2, 1)]
Expand Down Expand Up @@ -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 =
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/client/opamCliMain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
(**************************************************************************)

open Cmdliner
open OpamTypes
open OpamStateTypes
open OpamTypesBase
open OpamStd.Op
Expand All @@ -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))
Expand Down
1 change: 0 additions & 1 deletion src/client/opamCommands.ml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ open Cmdliner
open OpamArg
open OpamTypes
open OpamStateTypes
open OpamTypesBase
open OpamStd.Op

let self_upgrade_exe opamroot =
Expand Down
1 change: 0 additions & 1 deletion src/client/opamListCommand.ml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
(* *)
(**************************************************************************)

open OpamCompat
open OpamParserTypes.FullPos
open OpamTypes
open OpamStateTypes
Expand Down
41 changes: 5 additions & 36 deletions src/core/opamCompat.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
41 changes: 5 additions & 36 deletions src/core/opamCompat.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
4 changes: 1 addition & 3 deletions src/core/opamConsole.ml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
(* *)
(**************************************************************************)

open OpamCompat

(* Global configuration *)

let debug () = abs OpamCoreConfig.(!r.debug_level) > 0
Expand Down Expand Up @@ -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 ->
Expand Down
Loading

0 comments on commit 9018314

Please sign in to comment.