Skip to content

Remove support for OCaml < 4.08 #1300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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"

6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Unreleased

### Changed

- Drop support for OCaml < 4.08 (@jonludlam, #1300)

# 3.0.0~beta1

### Highlight
4 changes: 2 additions & 2 deletions odoc-parser.opam
Original file line number Diff line number Diff line change
@@ -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}
10 changes: 4 additions & 6 deletions odoc.opam
Original file line number Diff line number Diff line change
@@ -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" ]
12 changes: 8 additions & 4 deletions src/xref2/paths.md
Original file line number Diff line number Diff line change
@@ -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 = ...});
2 changes: 1 addition & 1 deletion src/xref2/test.md
Original file line number Diff line number Diff line change
@@ -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
```

176 changes: 118 additions & 58 deletions test/xref2/resolve/test.md
Original file line number Diff line number Diff line change
@@ -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 = ...},