Skip to content

Commit

Permalink
fix: Do not depend on dune in dune-project in dune init template
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Leonidas-from-XIV authored and maiste committed Nov 19, 2024
1 parent 83d2ed4 commit 4756e94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion bin/dune_init.ml
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@ module Component = struct
[ { Package_dependency.name = Package.Name.of_string "ocaml"
; constraint_ = None
}
; { name = Package.Name.of_string "dune"; constraint_ = None }
]
in
let packages = Package.Name.Map.singleton (Package.name package) package in
Expand Down
8 changes: 4 additions & 4 deletions test/blackbox-tests/test-cases/dune-init.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ In particular, the `dune-project` file has the expected content:
(name new_exec_proj)
(synopsis "A short synopsis")
(description "A longer description")
(depends ocaml dune)
(depends ocaml)
(tags
("add topics" "to describe" your project)))

Expand All @@ -384,8 +384,8 @@ And the opam file will be generated as expected
doc: "https://url/to/documentation"
bug-reports: "https://github.com/username/reponame/issues"
depends: [
"ocaml"
$dune {>= "3.17"}
"ocaml"
"odoc" {with-doc}
]
build: [
Expand Down Expand Up @@ -467,7 +467,7 @@ In particular, the `dune-project` file has the expected content:
(name new_lib_proj)
(synopsis "A short synopsis")
(description "A longer description")
(depends ocaml dune)
(depends ocaml)
(tags
("add topics" "to describe" your project)))

Expand All @@ -494,8 +494,8 @@ And the opam file will be generated as expected
doc: "https://url/to/documentation"
bug-reports: "https://github.com/username/reponame/issues"
depends: [
"ocaml"
"dune" {>= "3.17"}
"ocaml"
"odoc" {with-doc}
]
build: [
Expand Down

0 comments on commit 4756e94

Please sign in to comment.