Skip to content

Commit

Permalink
No longer call chmod on symbolic links
Browse files Browse the repository at this point in the history
Use stat instead of lstat in refresh_and_chmod

Fix ocaml#4195

Signed-off-by: Danny Willems <[email protected]>
  • Loading branch information
dannywillems authored and jeremiedimino committed Feb 16, 2021
1 parent ba9ce82 commit cbc5dbe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ 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)
------------------

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 cbc5dbe

Please sign in to comment.