Skip to content

Commit 14abe7e

Browse files
art-wLeonidas-from-XIV
authored andcommitted
No x-maintenance-intent in opam files for dune<3.18
Signed-off-by: ArthurW <arthur@tarides.com> Signed-off-by: Marek Kubica <marek@tarides.com>
1 parent 9a92f71 commit 14abe7e

File tree

10 files changed

+44
-85
lines changed

10 files changed

+44
-85
lines changed

otherlibs/dune-site/test/run.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ Test with an opam like installation
169169
]
170170
["dune" "install" "-p" name "--create-install-files" name]
171171
]
172-
x-maintenance-intent: ["(latest)"]
173172

174173
$ dune build -p a --promote-install-files=false @install
175174

otherlibs/dune-site/test/run_2_9.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ Test with an opam like installation
157157
]
158158
["dune" "install" "-p" name "--create-install-files" name]
159159
]
160-
x-maintenance-intent: ["(latest)"]
161160

162161
$ dune build -p a --promote-install-files="false" @install
163162

src/dune_rules/opam_create.ml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,15 @@ let insert_odoc_dep depends =
196196
loop [] depends
197197
;;
198198

199+
let maintenance_intent dune_version info =
200+
if dune_version < (3, 18)
201+
then None
202+
else (
203+
match Package_info.maintenance_intent info with
204+
| None -> Some [ "(latest)" ]
205+
| x -> x)
206+
;;
207+
199208
let opam_fields project (package : Package.t) =
200209
let dune_version = Dune_project.dune_version project in
201210
let package_name = Package.name package in
@@ -228,10 +237,7 @@ let opam_fields project (package : Package.t) =
228237
in
229238
let list_fields =
230239
[ "maintainer", Package_info.maintainers info
231-
; ( "x-maintenance-intent"
232-
, match Package_info.maintenance_intent info with
233-
| None -> Some [ "(latest)" ]
234-
| x -> x )
240+
; "x-maintenance-intent", maintenance_intent dune_version info
235241
; "authors", Package_info.authors info
236242
; ( "license"
237243
, match Package_info.license info with

test/blackbox-tests/test-cases/describe/describe.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1373,5 +1373,4 @@ opam file listing
13731373
\"@doc\" {with-doc}
13741374
]
13751375
]
1376-
x-maintenance-intent: [\"(latest)\"]
13771376
"))

test/blackbox-tests/test-cases/dune-package.t/run.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ Install as opam does
177177
"@doc" {with-doc}
178178
]
179179
]
180-
x-maintenance-intent: ["(latest)"]
181180

182181
$ (cd a; "dune" "build" "-p" a "@install")
183182

test/blackbox-tests/test-cases/dune-project-meta/basic-generate.t

Lines changed: 34 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,19 @@ Simple test
44
The `dune build` should generate the opam file
55

66
$ cat >dune-project <<EOF
7-
> (lang dune 3.18)
7+
> (lang dune 1.10)
88
> (version 1.0.0)
99
> (name cohttp)
1010
> (source (github mirage/ocaml-cohttp))
1111
> (license ISC)
1212
> (authors "Anil Madhavapeddy" "Rudi Grinberg")
13-
> (maintenance_intent "(latest)")
1413
>
1514
> (generate_opam_files true)
1615
>
1716
> (package
1817
> (name cohttp)
1918
> (synopsis "An OCaml library for HTTP clients and servers")
2019
> (description "A longer description")
21-
> (allow_empty)
2220
> (depends
2321
> (alcotest :with-test)
2422
> (foo (and :dev (> 1.5) (< 2.0)))
@@ -34,7 +32,6 @@ The `dune build` should generate the opam file
3432
> A really long multi line description that spans across lines to
3533
> make sure that the rendering of long strings stays compatible.
3634
> ")
37-
> (allow_empty)
3835
> (depends
3936
> (cohttp (>= 1.0.2))
4037
> (conduit-async (>= 1.0.3))
@@ -48,7 +45,6 @@ The `dune build` should generate the opam file
4845
> A really long description that is supposed to start with a
4946
> newline since it doesn't escape the line break.
5047
> ")
51-
> (allow_empty)
5248
> (depends
5349
> (cohttp (>= 1.0.2))
5450
> (conduit-lwt (>= 1.0.3))
@@ -61,113 +57,80 @@ The `dune build` should generate the opam file
6157
$ cat cohttp.opam
6258
# This file is generated by dune, edit dune-project instead
6359
opam-version: "2.0"
60+
build: [
61+
["dune" "subst"] {pinned}
62+
["dune" "build" "-p" name "-j" jobs]
63+
["dune" "runtest" "-p" name "-j" jobs] {with-test}
64+
["dune" "build" "-p" name "@doc"] {with-doc}
65+
]
66+
authors: ["Anil Madhavapeddy" "Rudi Grinberg"]
67+
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
68+
homepage: "https://github.com/mirage/ocaml-cohttp"
69+
license: "ISC"
6470
version: "1.0.0"
71+
dev-repo: "git+https://github.com/mirage/ocaml-cohttp.git"
6572
synopsis: "An OCaml library for HTTP clients and servers"
6673
description: "A longer description"
67-
authors: ["Anil Madhavapeddy" "Rudi Grinberg"]
68-
license: "ISC"
69-
homepage: "https://github.com/mirage/ocaml-cohttp"
70-
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
7174
depends: [
72-
"dune" {>= "3.18"}
7375
"alcotest" {with-test}
7476
"foo" {dev & > "1.5" & < "2.0"}
7577
"uri" {>= "1.9.0"}
7678
"uri" {< "2.0.0"}
7779
"fieldslib" {> "v0.12"}
7880
"fieldslib" {< "v0.13"}
79-
"odoc" {with-doc}
8081
]
81-
build: [
82-
["dune" "subst"] {dev}
83-
[
84-
"dune"
85-
"build"
86-
"-p"
87-
name
88-
"-j"
89-
jobs
90-
"@install"
91-
"@runtest" {with-test}
92-
"@doc" {with-doc}
93-
]
94-
]
95-
dev-repo: "git+https://github.com/mirage/ocaml-cohttp.git"
96-
x-maintenance-intent: ["(latest)"]
9782

9883
$ cat cohttp-async.opam
9984
# This file is generated by dune, edit dune-project instead
10085
opam-version: "2.0"
86+
build: [
87+
["dune" "subst"] {pinned}
88+
["dune" "build" "-p" name "-j" jobs]
89+
["dune" "runtest" "-p" name "-j" jobs] {with-test}
90+
["dune" "build" "-p" name "@doc"] {with-doc}
91+
]
92+
authors: ["Anil Madhavapeddy" "Rudi Grinberg"]
93+
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
94+
homepage: "https://github.com/mirage/ocaml-cohttp"
95+
license: "ISC"
10196
version: "1.0.0"
97+
dev-repo: "git+https://github.com/mirage/ocaml-cohttp.git"
10298
synopsis: "HTTP client and server for the Async library"
10399
description: """
104100
A really long multi line description that spans across lines to
105101
make sure that the rendering of long strings stays compatible.
106102
"""
107-
authors: ["Anil Madhavapeddy" "Rudi Grinberg"]
108-
license: "ISC"
109-
homepage: "https://github.com/mirage/ocaml-cohttp"
110-
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
111103
depends: [
112-
"dune" {>= "3.18"}
113104
"cohttp" {>= "1.0.2"}
114105
"conduit-async" {>= "1.0.3"}
115106
"async" {>= "v0.10.0"}
116107
"async" {< "v0.12"}
117-
"odoc" {with-doc}
118-
]
119-
build: [
120-
["dune" "subst"] {dev}
121-
[
122-
"dune"
123-
"build"
124-
"-p"
125-
name
126-
"-j"
127-
jobs
128-
"@install"
129-
"@runtest" {with-test}
130-
"@doc" {with-doc}
131-
]
132108
]
133-
dev-repo: "git+https://github.com/mirage/ocaml-cohttp.git"
134-
x-maintenance-intent: ["(latest)"]
135109

136110
$ cat cohttp-lwt.opam
137111
# This file is generated by dune, edit dune-project instead
138112
opam-version: "2.0"
113+
build: [
114+
["dune" "subst"] {pinned}
115+
["dune" "build" "-p" name "-j" jobs]
116+
["dune" "runtest" "-p" name "-j" jobs] {with-test}
117+
["dune" "build" "-p" name "@doc"] {with-doc}
118+
]
119+
authors: ["Anil Madhavapeddy" "Rudi Grinberg"]
120+
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
121+
homepage: "https://github.com/mirage/ocaml-cohttp"
122+
license: "ISC"
139123
version: "1.0.0"
124+
dev-repo: "git+https://github.com/mirage/ocaml-cohttp.git"
140125
synopsis: "HTTP client and server for the Lwt library"
141126
description: """
142127
143128
A really long description that is supposed to start with a
144129
newline since it doesn't escape the line break.
145130
"""
146-
authors: ["Anil Madhavapeddy" "Rudi Grinberg"]
147-
license: "ISC"
148-
homepage: "https://github.com/mirage/ocaml-cohttp"
149-
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
150131
depends: [
151-
"dune" {>= "3.18"}
152132
"cohttp" {>= "1.0.2"}
153133
"conduit-lwt" {>= "1.0.3"}
154134
"lwt" {>= "5.0.0"}
155135
"lwt" {< "6.0.0"}
156-
"odoc" {with-doc}
157136
]
158-
build: [
159-
["dune" "subst"] {dev}
160-
[
161-
"dune"
162-
"build"
163-
"-p"
164-
name
165-
"-j"
166-
jobs
167-
"@install"
168-
"@runtest" {with-test}
169-
"@doc" {with-doc}
170-
]
171-
]
172-
dev-repo: "git+https://github.com/mirage/ocaml-cohttp.git"
173-
x-maintenance-intent: ["(latest)"]

test/blackbox-tests/test-cases/dune-project-meta/dune-dep.t

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ the doc dependencies:
191191
]
192192
["dune" "install" "-p" name "--create-install-files" name]
193193
]
194-
x-maintenance-intent: ["(latest)"]
195194

196195
$ cat > dune-project <<EOF
197196
> (lang dune 3.0)
@@ -216,7 +215,6 @@ the doc dependencies:
216215
"@doc" {with-doc}
217216
]
218217
]
219-
x-maintenance-intent: ["(latest)"]
220218

221219
$ cat > dune-project <<EOF
222220
> (lang dune 3.0)
@@ -242,4 +240,3 @@ the doc dependencies:
242240
"@doc" {with-doc}
243241
]
244242
]
245-
x-maintenance-intent: ["(latest)"]

test/blackbox-tests/test-cases/dune-project-meta/github2927.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,3 @@ Reproduction case for #2927
3030
"@doc" {with-doc}
3131
]
3232
]
33-
x-maintenance-intent: ["(latest)"]

test/blackbox-tests/test-cases/dune-project-meta/v11-1.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,3 @@ Generation of opam files with lang dune >= 1.11
2929
"@doc" {with-doc}
3030
]
3131
]
32-
x-maintenance-intent: ["(latest)"]

test/blackbox-tests/test-cases/opam-constraints.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,3 @@ constraints.
6767
"@doc" {with-doc}
6868
]
6969
]
70-
x-maintenance-intent: ["(latest)"]

0 commit comments

Comments
 (0)