Skip to content

Commit

Permalink
No longer call chmod on symbolic links (#4233)
Browse files Browse the repository at this point in the history
By using stat instead of lstat in refresh_and_chmod

Fix #4195

Signed-off-by: Danny Willems <[email protected]>
  • Loading branch information
dannywillems authored and rgrinberg committed Mar 7, 2021
1 parent 1916c9e commit 7269719
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ Unreleased

- Add a META rule for 'compiler-libs.native-toplevel' (#4175, @altgr)

- No longer call `chmod` on symbolic links (fixes #4195, @dannywillems)

2.8.2 (21/01/2021)
------------------

- Fixed wrong workspace discovery from `dune ocaml-merlin` (#4127, fixes #4125,
Expand Down
2 changes: 1 addition & 1 deletion src/dune_engine/cached_digest.ml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ let refresh fn =
refresh_ stats fn

let refresh_and_chmod fn =
let stats = Path.stat fn in
let stats = Path.lstat fn in
let () =
(* We remove write permissions to uniformize behavior regardless of whether
the cache is activated. No need to be zealous in case the file is not
Expand Down
2 changes: 2 additions & 0 deletions src/stdune/path.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1263,6 +1263,8 @@ let local_part = function

let stat t = Unix.stat (to_string t)

let lstat t = Unix.lstat (to_string t)

include (Comparator.Operators (T) : Comparator.OPS with type t := t)

let path_of_local = of_local
Expand Down
2 changes: 2 additions & 0 deletions src/stdune/path.mli
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ val local_part : t -> Local.t

val stat : t -> Unix.stats

val lstat : t -> Unix.stats

(* it would be nice to call this [Set.of_source_paths], but it's annoying to
change the [Set] signature because then we don't comply with [Path_intf.S] *)
val set_of_source_paths : Source.Set.t -> Set.t
Expand Down

0 comments on commit 7269719

Please sign in to comment.