Skip to content

Commit 55f5607

Browse files
fix: Do not depend on dune in dune-project in dune init template
Dune automatically adds the right constraint anyway, with the right version constraint. All Dune project implicitely depend on Dune anyway and the tests show that the opam files correctly include Dune. This helps with #11106 but also avoids the bug where Dune couldn't solve a package because it depended on Dune and in the Dune Package Management we explicitely remove the dependency. Signed-off-by: Marek Kubica <marek@tarides.com>
1 parent d8f7631 commit 55f5607

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

bin/dune_init.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ module Component = struct
404404
[ { Package_dependency.name = Package.Name.of_string "ocaml"
405405
; constraint_ = None
406406
}
407-
; { name = Package.Name.of_string "dune"; constraint_ = None }
408407
]
409408
in
410409
let packages = Package.Name.Map.singleton (Package.name package) package in

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ In particular, the `dune-project` file has the expected content:
357357
(name new_exec_proj)
358358
(synopsis "A short synopsis")
359359
(description "A longer description")
360-
(depends ocaml dune)
360+
(depends ocaml)
361361
(tags
362362
("add topics" "to describe" your project)))
363363

@@ -384,8 +384,8 @@ And the opam file will be generated as expected
384384
doc: "https://url/to/documentation"
385385
bug-reports: "https://github.com/username/reponame/issues"
386386
depends: [
387-
"ocaml"
388387
$dune {>= "3.17"}
388+
"ocaml"
389389
"odoc" {with-doc}
390390
]
391391
build: [
@@ -467,7 +467,7 @@ In particular, the `dune-project` file has the expected content:
467467
(name new_lib_proj)
468468
(synopsis "A short synopsis")
469469
(description "A longer description")
470-
(depends ocaml dune)
470+
(depends ocaml)
471471
(tags
472472
("add topics" "to describe" your project)))
473473

@@ -494,8 +494,8 @@ And the opam file will be generated as expected
494494
doc: "https://url/to/documentation"
495495
bug-reports: "https://github.com/username/reponame/issues"
496496
depends: [
497-
"ocaml"
498497
"dune" {>= "3.17"}
498+
"ocaml"
499499
"odoc" {with-doc}
500500
]
501501
build: [

0 commit comments

Comments
 (0)