Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ocaml/dune
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9f4055bdf1a4559de63c8b9b3cc6d8c47ab7cfb2
Choose a base ref
..
head repository: ocaml/dune
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: be4fc2be6dfa5c5a7b2b532d453f3c30df3b7cff
Choose a head ref
4 changes: 4 additions & 0 deletions bin/subst.ml
Original file line number Diff line number Diff line change
@@ -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 *)
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)
2 changes: 1 addition & 1 deletion src/dune_rules/setup.defaults.ml
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ let roots : string option Install.Roots.t =
; libexec_root = None
}

let prefix : string option = None
let toolchains = `Enabled
let pkg_build_progress = `Disabled
let lock_dev_tool = `Disabled
let prefix = None
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
55 changes: 0 additions & 55 deletions test/blackbox-tests/test-cases/nix-result-in-tree.t/run.t

This file was deleted.

16 changes: 16 additions & 0 deletions test/blackbox-tests/test-cases/read-only-symlink-target.t/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Nix can leave a symlink to a store path in the tree, often called 'result'.
'dune fmt' crashes because of that.

$ RESULT=`mktemp -d`
$ echo "let x = 2" > "$RESULT/foo.ml"
$ chmod -R a-w "$RESULT"
$ ln -s "$RESULT" result

This command should succeed:

$ dune fmt 2>/dev/null
[1]

Allow Dune to remove temporary files (calling Dune crashes without this):

$ chmod -R u+w "$RESULT"