Skip to content

Commit

Permalink
refactor(pkg): add missing loc (ocaml#9477)
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <[email protected]>
  • Loading branch information
rgrinberg authored Dec 13, 2023
1 parent 3e94d5d commit f3959e9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/dune_rules/package.ml
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,7 @@ let to_local_package t =
with
| OpamPp.Bad_version (_, message) ->
User_error.raise
~loc:(Loc.in_file (Path.source file))
[ Pp.textf
"Unable to parse opam file %s as local dune package."
(Path.Source.to_string file)
Expand Down
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/pkg/opam-file-errors.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Tests for error messages while reading package metadata from opam files
Empty files are not allowed as they lack the format version.
$ touch x.opam
$ dune pkg lock
File "x.opam", line 1, characters 0-0:
Error: Unable to parse opam file x.opam as local dune package.
unsupported or missing file format version; should be 2.0 or older
[1]
Expand Down

0 comments on commit f3959e9

Please sign in to comment.