diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e5a17a6f59..ee74c94a8a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,25 +12,23 @@ jobs: os: - ubuntu-latest ocaml-compiler: - - "4.02" - - "4.04" - - "4.06" - "4.08" - "4.10" - "4.12" - "4.14" - "5.0" - "5.2" + - "5.3" include: - os: ubuntu-latest - ocaml-compiler: "5.2" + ocaml-compiler: "5.3" # We don't need to compute coverage for more than one build send-coverage: true # Mdx tests Mdx tests run-mdx: true test-sherlodoc: true - os: macos-latest - ocaml-compiler: "5.2" + ocaml-compiler: "5.3" # - os: windows-latest # ocaml-compiler: "5.2" diff --git a/CHANGES.md b/CHANGES.md index 01c5c54281..07df077637 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,9 @@ +# Unreleased + +### Changed + +- Drop support for OCaml < 4.08 (@jonludlam, #1300) + # 3.0.0~beta1 ### Highlight diff --git a/odoc-parser.opam b/odoc-parser.opam index 4cbd236094..1458575222 100644 --- a/odoc-parser.opam +++ b/odoc-parser.opam @@ -15,12 +15,12 @@ doc: "https://ocaml.github.io/odoc/odoc_parser" flags: [ avoid-version ] depends: [ "dune" {>= "3.7"} - "ocaml" {>= "4.02.0" & < "5.4"} + "ocaml" {>= "4.08.0" & < "5.4"} "astring" "result" "camlp-streams" "ppx_expect" {with-test} - ("ocaml" {< "4.04.1" & with-test} | "sexplib0" {with-test}) + "sexplib0" {with-test} ] build: [ ["dune" "subst"] {dev} diff --git a/odoc.opam b/odoc.opam index 949537a40b..5169c7dea1 100644 --- a/odoc.opam +++ b/odoc.opam @@ -46,21 +46,19 @@ depends: [ "cppo" {build & >= "1.1.0"} "dune" {>= "3.7.0"} "fpath" - "ocaml" {>= "4.02.0" & < "5.4"} + "ocaml" {>= "4.08.0" & < "5.4"} "result" "tyxml" {>= "4.4.0"} "fmt" + "crunch" {>= "1.4.1"} "ocamlfind" {with-test} "yojson" {>= "2.1.0" & with-test} - ("ocaml" {< "4.04.1" & with-test} | "sexplib0" {with-test}) + "sexplib0" {with-test} "conf-jq" {with-test} - "ppx_expect" {with-test} "bos" {with-test} - "crunch" {>= "1.4.1"} - - ("ocaml" {< "4.07.0" & with-test} | "bisect_ppx" {with-test & > "2.5.0"}) + "bisect_ppx" {with-test & > "2.5.0"} ] conflicts: [ "ocaml-option-bytecode-only" ] diff --git a/src/xref2/paths.md b/src/xref2/paths.md index 9ce9231dc8..836b7b1103 100644 --- a/src/xref2/paths.md +++ b/src/xref2/paths.md @@ -581,10 +581,14 @@ val sg : Odoc_model.Lang.Signature.t = ihash = 818126955; ikey = "r_Root.p"... (* string length 13; truncated *)}, - ...); - ihash = ...; ikey = ...}; - ihash = ...; ikey = ...}, - ...); + F); + ihash = 748202139; + ikey = + "m_F.r_Ro"... (* string length 17; truncated *)}; + ihash = 709672416; + ikey = + "___resul"... (* string length 29; truncated *)}, + N); ihash = ...; ikey = ...}; source_loc = ...; doc = ...; type_ = ...; canonical = ...; hidden = ...}); diff --git a/src/xref2/test.md b/src/xref2/test.md index 46b1bf17c6..cdc29a2dee 100644 --- a/src/xref2/test.md +++ b/src/xref2/test.md @@ -618,7 +618,7 @@ we look up `A` from the environment: let sg = get_ok @@ Tools.expansion_of_module env (Component.Delayed.get m) in Tools.prefix_signature (`Module p, sg);; Line 4, characters 38-40: -Error: This expression has type Tools.expansion +Error: The value sg has type Tools.expansion but an expression was expected of type Component.Signature.t ``` diff --git a/test/xref2/resolve/test.md b/test/xref2/resolve/test.md index 7b8d862f24..8eaa3e6659 100644 --- a/test/xref2/resolve/test.md +++ b/test/xref2/resolve/test.md @@ -527,14 +527,22 @@ Basic resolution 3, module type: Root); ihash = 818126955; ikey = "r_Root.p_None"}, u); - ihash = 15973539; - ikey = "t_u.r_Root.p_"... (* string length 17; truncated *)}; + ihash = 15973539; ikey = "t_u.r_Root.p_None"}; source_loc = None; doc = {Odoc_model__.Comment.elements = []; suppress_warnings = false}; canonical = None; equation = {Odoc_model.Lang.TypeDecl.Equation.params = []; private_ = false; - manifest = Some (Odoc_model.Lang.TypeExpr.Constr (...)); + manifest = + Some + (Odoc_model.Lang.TypeExpr.Constr + (`Resolved + (`Type + (`Identifier + {Odoc_model__Paths_types.iv = ...; ihash = ...; + ikey = ...}, + ...)), + ...)); constraints = ...}; representation = ...}); ...]; @@ -732,26 +740,32 @@ Basic resolution 4, module type: ({Odoc_model__Paths_types.iv = `Module ({Odoc_model__Paths_types.iv = - `Root ...; ihash = ...; - ikey = ...}, - ...); - ihash = ...; ikey = ...}, - ...); - ihash = ...; ikey = ...}, - ...); - ihash = ...; ikey = ...}; - source_loc = ...; doc = ...; canonical = ...; - equation = ...; representation = ...}); - ...]; - compiled = ...; removed = ...; doc = ...}); - canonical = ...; hidden = ...}); - ...]; - compiled = ...; removed = ...; doc = ...}); - p_path = ...}); - canonical = ...; hidden = ...}); - ...]; - compiled = ...; removed = ...; doc = ...}; - expansion = ...; linked = ...; source_loc = ...; canonical = ...} + `Root + (Some + {Odoc_model__Paths_types.iv + = `Page (None, ...); + ihash = ...; + ikey = ...}, + ...); + ihash = ...; ikey = ...}, + ...); + ihash = ...; ikey = ...}, + ...); + ihash = ...; ikey = ...}, + ...); + ihash = ...; ikey = ...}; + source_loc = ...; doc = ...; canonical = ...; + equation = ...; representation = ...}); + ...]; + compiled = ...; removed = ...; doc = ...}); + canonical = ...; hidden = ...}); + ...]; + compiled = ...; removed = ...; doc = ...}); + p_path = ...}); + canonical = ...; hidden = ...}); + ...]; + compiled = ...; removed = ...; doc = ...}; + expansion = ...; linked = ...; source_loc = ...; canonical = ...} ``` This example is rather more interesting: @@ -974,8 +988,7 @@ and then we can look up the type `t`. ikey = "m_B.mt_M.r_Root.p_None"}, t); ihash = 484865120; - ikey = - "t_t.m_B.mt_M.r_Root.p_No"... (* string length 26; truncated *)}; + ikey = "t_t.m_B.mt_M.r_Root.p_None"}; source_loc = None; doc = {Odoc_model__.Comment.elements = []; @@ -991,13 +1004,21 @@ and then we can look up the type `t`. doc = {Odoc_model__.Comment.elements = []; suppress_warnings = false}}); - p_path = `Resolved (`Identifier ...)}); - canonical = ...; hidden = ...}); - ...]; - compiled = ...; removed = ...; doc = ...})}; - ...]; - compiled = ...; removed = ...; doc = ...}; - expansion = ...; linked = ...; source_loc = ...; canonical = ...} + p_path = + `Resolved + (`Identifier + {Odoc_model__Paths_types.iv = + `ModuleType + ({Odoc_model__Paths_types.iv = ...; + ihash = ...; ikey = ...}, + ...); + ihash = ...; ikey = ...})}); + canonical = ...; hidden = ...}); + ...]; + compiled = ...; removed = ...; doc = ...})}; + ...]; + compiled = ...; removed = ...; doc = ...}; + expansion = ...; linked = ...; source_loc = ...; canonical = ...} ``` ```ocaml @@ -1188,7 +1209,17 @@ and then we can look up the type `t`. {Odoc_model__Paths_types.iv = `Type ({Odoc_model__Paths_types.iv = - `Module (...); + `Module + ({Odoc_model__Paths_types.iv + = + `Module + ({Odoc_model__Paths_types.iv + = ...; + ihash = ...; + ikey = ...}, + ...); + ihash = ...; ikey = ...}, + ...); ihash = ...; ikey = ...}, ...); ihash = ...; ikey = ...}; @@ -1388,11 +1419,13 @@ Ensure a substitution is taken into account during resolution: (Some {Odoc_model__Paths_types.iv = `Page (None, None); ihash = 236059787; ikey = "p_None"}, - ...); - ihash = ...; ikey = ...}, - ...); - ihash = ...; ikey = ...}; - source_loc = ...; doc = ...; type_ = ...; canonical = ...; + Root); + ihash = 818126955; + ikey = "r_Root.p"... (* string length 13; truncated *)}, + B); + ihash = 814134997; + ikey = "m_B.r_Ro"... (* string length 17; truncated *)}; + source_loc = None; doc = ...; type_ = ...; canonical = ...; hidden = ...}); ...]; compiled = ...; removed = ...; doc = ...}; @@ -1578,11 +1611,13 @@ Ensure a destructive substitution is taken into account during resolution: (Some {Odoc_model__Paths_types.iv = `Page (None, None); ihash = 236059787; ikey = "p_None"}, - ...); - ihash = ...; ikey = ...}, - ...); - ihash = ...; ikey = ...}; - source_loc = ...; doc = ...; type_ = ...; canonical = ...; + Root); + ihash = 818126955; + ikey = "r_Root.p"... (* string length 13; truncated *)}, + B); + ihash = 814134997; + ikey = "m_B.r_Ro"... (* string length 17; truncated *)}; + source_loc = None; doc = ...; type_ = ...; canonical = ...; hidden = ...}); ...]; compiled = ...; removed = ...; doc = ...}; @@ -1743,10 +1778,14 @@ Resolve a module alias: `Page (None, None); ihash = 236059787; ikey = "p_None"}, Root); - ihash = ...; ikey = ...}, - ...); - ihash = ...; ikey = ...}, - ...)), + ihash = 818126955; + ikey = + "r_Root.p"... (* string length 13; truncated *)}, + B); + ihash = 814134997; + ikey = + "m_B.r_Ro"... (* string length 17; truncated *)}, + false)), ...)), ...)); constraints = ...}; @@ -1908,13 +1947,16 @@ Resolve a module alias: Root); ihash = 818126955; ikey = - "r_Root.p"... (* string length 13; truncated *)}, + "r_Root.p_No"... (* string length 13; truncated *)}, B); ihash = 814134997; ikey = "m_B.r_Ro"... (* string length 17; truncated *)}, false))), None); - canonical = ...; hidden = ...}); + canonical = None; hidden = false}); + Odoc_model.Lang.Signature.Type (Odoc_model.Lang.Signature.Ordinary, + {Odoc_model.Lang.TypeDecl.id = ...; source_loc = ...; doc = ...; + canonical = ...; equation = ...; representation = ...}); ...]; compiled = ...; removed = ...; doc = ...}; expansion = ...; linked = ...; source_loc = ...; canonical = ...} @@ -2097,10 +2139,17 @@ Resolve a functor: Root); ihash = 818126955; ikey = - "r_Root.p"... (* string length 13; truncated *)}, + "r_Root.p_"... (* string length 13; truncated *)}, S); - ihash = 527535255; ikey = ...})}}, - ...)); + ihash = 527535255; + ikey = + "mt_S.r_R"... (* string length 18; truncated *)})}}, + Odoc_model.Lang.ModuleType.Functor + (Odoc_model.Lang.FunctorParameter.Named + {Odoc_model.Lang.FunctorParameter.id = + {Odoc_model__Paths_types.iv = ...; ihash = ...; ikey = ...}; + expr = ...}, + ...))); canonical = ...; hidden = ...}); ...]; compiled = ...; removed = ...; doc = ...}; @@ -2307,10 +2356,18 @@ Resolve a functor: Root); ihash = 818126955; ikey = - "r_Root.p"... (* string length 13; truncated *)}, + "r_Root.p_"... (* string length 13; truncated *)}, S); - ihash = 527535255; ikey = ...})}}, - ...))}; + ihash = 527535255; + ikey = + "mt_S.r_R"... (* string length 18; truncated *)})}}, + Odoc_model.Lang.ModuleType.Path + {Odoc_model.Lang.ModuleType.p_expansion = + Some + (Odoc_model.Lang.ModuleType.Signature + {Odoc_model.Lang.Signature.items = [...]; compiled = ...; + removed = ...; doc = ...}); + p_path = ...}))}; ...]; compiled = ...; removed = ...; doc = ...}; expansion = ...; linked = ...; source_loc = ...; canonical = ...} @@ -2524,14 +2581,17 @@ Functor app nightmare: Type); ihash = 359972898; ikey = - "mt_Type.r_R"... (* string length 21; truncated *)})}}, + "mt_Type.r_Root.p_N"... (* string length 21; truncated *)})}}, Odoc_model.Lang.ModuleType.Functor (Odoc_model.Lang.FunctorParameter.Named {Odoc_model.Lang.FunctorParameter.id = {Odoc_model__Paths_types.iv = `Parameter - ({Odoc_model__Paths_types.iv = ...; ihash = ...; - ikey = ...}, + ({Odoc_model__Paths_types.iv = + `Result + {Odoc_model__Paths_types.iv = `Module (...); + ihash = ...; ikey = ...}; + ihash = ...; ikey = ...}, ...); ihash = ...; ikey = ...}; expr = ...},