Skip to content

Commit 263bf0b

Browse files
art-wLeonidas-from-XIV
authored andcommitted
No x-maintenance-intent in opam files for dune<3.18
Signed-off-by: ArthurW <[email protected]> Signed-off-by: Marek Kubica <[email protected]>
1 parent e777da3 commit 263bf0b

File tree

10 files changed

+44
-85
lines changed

10 files changed

+44
-85
lines changed

otherlibs/dune-site/test/run.t

-1
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

-1
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

+10-4
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

-1
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

-1
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

+34-71
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
> (dune (and :build (> 1.5)))
@@ -35,7 +33,6 @@ The `dune build` should generate the opam file
3533
> A really long multi line description that spans across lines to
3634
> make sure that the rendering of long strings stays compatible.
3735
> ")
38-
> (allow_empty)
3936
> (depends
4037
> (cohttp (>= 1.0.2))
4138
> (conduit-async (>= 1.0.3))
@@ -49,7 +46,6 @@ The `dune build` should generate the opam file
4946
> A really long description that is supposed to start with a
5047
> newline since it doesn't escape the line break.
5148
> ")
52-
> (allow_empty)
5349
> (depends
5450
> (cohttp (>= 1.0.2))
5551
> (conduit-lwt (>= 1.0.3))
@@ -62,114 +58,81 @@ The `dune build` should generate the opam file
6258
$ cat cohttp.opam
6359
# This file is generated by dune, edit dune-project instead
6460
opam-version: "2.0"
61+
build: [
62+
["dune" "subst"] {pinned}
63+
["dune" "build" "-p" name "-j" jobs]
64+
["dune" "runtest" "-p" name "-j" jobs] {with-test}
65+
["dune" "build" "-p" name "@doc"] {with-doc}
66+
]
67+
authors: ["Anil Madhavapeddy" "Rudi Grinberg"]
68+
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
69+
homepage: "https://github.com/mirage/ocaml-cohttp"
70+
license: "ISC"
6571
version: "1.0.0"
72+
dev-repo: "git+https://github.com/mirage/ocaml-cohttp.git"
6673
synopsis: "An OCaml library for HTTP clients and servers"
6774
description: "A longer description"
68-
authors: ["Anil Madhavapeddy" "Rudi Grinberg"]
69-
license: "ISC"
70-
homepage: "https://github.com/mirage/ocaml-cohttp"
71-
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
7275
depends: [
73-
"dune" {>= "3.18"}
7476
"alcotest" {with-test}
7577
"dune" {build & > "1.5"}
7678
"foo" {dev & > "1.5" & < "2.0"}
7779
"uri" {>= "1.9.0"}
7880
"uri" {< "2.0.0"}
7981
"fieldslib" {> "v0.12"}
8082
"fieldslib" {< "v0.13"}
81-
"odoc" {with-doc}
8283
]
83-
build: [
84-
["dune" "subst"] {dev}
85-
[
86-
"dune"
87-
"build"
88-
"-p"
89-
name
90-
"-j"
91-
jobs
92-
"@install"
93-
"@runtest" {with-test}
94-
"@doc" {with-doc}
95-
]
96-
]
97-
dev-repo: "git+https://github.com/mirage/ocaml-cohttp.git"
98-
x-maintenance-intent: ["(latest)"]
9984

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

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

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

-3
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

-1
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

-1
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

-1
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)