Skip to content

Commit

Permalink
fix: regression in 11200 (#11204)
Browse files Browse the repository at this point in the history
Remove all error checking for empty projects in [$ dune subst]

Signed-off-by: Rudi Grinberg <[email protected]>
  • Loading branch information
rgrinberg authored Dec 13, 2024
1 parent 38c0743 commit 3fc17ee
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 4 additions & 0 deletions bin/subst.ml
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,10 @@ let subst vcs =
|> Memo.return)
in
Some (None, None, Path.Source.Set.to_list files))
>>| Option.bind ~f:(fun ((_, _, files) as s) ->
match files with
| [] -> None
| _ :: _ -> Some s)
>>= Memo.Option.iter ~f:(fun (version, commit, files) ->
let+ (dune_project : Dune_project.t) =
(* CR-soon rgrinberg: unify this check with the above version check *)
Expand Down
2 changes: 2 additions & 0 deletions doc/changes/11204.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Remove useless error message when running `$ dune subst` in empty projects.
(@rgrinberg, #11204, fixes #11200)
5 changes: 0 additions & 5 deletions test/blackbox-tests/test-cases/github11200.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,3 @@ Running `dune subst` should succeed in an empty directory.
Regression test for https://github.com/ocaml/dune/issues/11200

$ dune subst
File ".", line 1, characters 0-0:
Error: There is no dune-project file in the current directory, please add one
with a (name <name>) field in it.
Hint: 'dune subst' must be executed from the root of the project.
[1]

0 comments on commit 3fc17ee

Please sign in to comment.