Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
Include all errors when dune tagged as build dep
Browse files Browse the repository at this point in the history
Previously, we incorrectly left out other errors when dune is tagged as
a build dependency. This commit fixes it.
  • Loading branch information
punchagan committed Sep 4, 2024
1 parent 9fe59d2 commit 4c2ff93
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/lint.ml
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ module Checks = struct
if OpamVersionCompare.compare dep ver >= 0 then []
else [ (pkg, BadDuneConstraint (dep, ver)) ]
in
if is_build then [ (pkg, DuneIsBuild) ] else errors
if is_build then (pkg, DuneIsBuild) :: errors else errors
| None -> []

let check_maintainer_email ~pkg opam =
Expand Down
1 change: 1 addition & 0 deletions test/lint.t
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Test the following:
Linting opam-repository at $TESTCASE_ROOT/. ...
Warning in b.0.0.2: Dubious use of 'dune subst'. 'dune subst' should always only be called with {dev} (i.e. ["dune" "subst"] {dev}) If your opam file has been autogenerated by dune, you need to upgrade your dune-project to at least (lang dune 2.7).
Warning in b.0.0.2: The package tagged dune as a build dependency. Due to a bug in dune (https://github.com/ocaml/dune/issues/2147) this should never be the case. Please remove the {build} tag from its filter.
Error in b.0.0.2: Failed to download the archive. Details: $TESTCASE_ROOT/b.0.0.2.tgz
Error in b.0.0.2: error 3: File format error in 'unknown-field' at line 11, column 0: Invalid field unknown-field
Error in b.0.0.2: error 60: Upstream check failed: "Source not found: $TESTCASE_ROOT/b.0.0.2.tgz"
[1]
Expand Down
2 changes: 1 addition & 1 deletion test/patches/b-incorrect-opam.patch
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ index 0000000..a47aabf
+ ["dune" "subst"]
+]
+url {
+ src: "./b.0.0.2.tgz"
+ src: "b.0.0.2.tgz"
+ checksum: ["sha256=e26dfd7fa9731d0d43239c8b7d36bd3d79b0f709f1cdfa2ada7a7ab5d79d1911"]
+}
+depends: [
Expand Down

0 comments on commit 4c2ff93

Please sign in to comment.