Skip to content

Commit

Permalink
backport #11204: fix: regression in 11200 (#11216)
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 <me@rgrinberg.com>
Signed-off-by: Etienne Marais <dev@maiste.fr>
Co-authored-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
maiste and rgrinberg authored Dec 17, 2024
1 parent 8835ad5 commit 324e1b5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 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)
4 changes: 4 additions & 0 deletions test/blackbox-tests/test-cases/github11200.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Running `dune subst` should succeed in an empty directory.
Regression test for https://github.com/ocaml/dune/issues/11200

$ dune subst

0 comments on commit 324e1b5

Please sign in to comment.