Skip to content

Commit

Permalink
Fix #3026
Browse files Browse the repository at this point in the history
Signed-off-by: Jeremie Dimino <[email protected]>
  • Loading branch information
jeremiedimino committed Jan 22, 2020
1 parent 7e15a1f commit a9cea77
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
- It is now an error to have a preprocessing dependency on a ppx rewriter
library that is not marked as `(kind ppx_rewriter)` (#3039, @snowleopard).

- Fix permissions of files promoted to the source tree when using the
shared cache. In particular, make them writable by the user (#3043,
fixes #3026, @diml)

2.1.3 (16/01/2020)
------------------

Expand Down
7 changes: 6 additions & 1 deletion src/dune/build_system.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1685,8 +1685,13 @@ end = struct
if lifetime = Until_clean then
Promoted_to_delete.add in_source_tree;
Scheduler.ignore_for_watch in_source_tree;
(* The file in the build directory might be read-only if it
comes from the shared cache. However, we want the file in the
source tree to be writable by the user, so we explicitly set
the user writable bit. *)
let chmod n = n lor 0o200 in
Artifact_substitution.copy_file () ~src:path ~dst:in_source_tree
~get_vcs:File_tree.nearest_vcs ))
~get_vcs:File_tree.nearest_vcs ~chmod ))
in
t.rule_done <- t.rule_done + 1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,3 @@ into the file after the second run.
Hello, world!

$ echo plop > file
sh: file: Permission denied
[1]

0 comments on commit a9cea77

Please sign in to comment.