File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -340,7 +340,8 @@ module File_ops_real (W : sig
340340 | Dune_package -> process_dune_package ~get_location: conf.get_location
341341 in
342342 copy_special_file ~src ~package ~ic ~oc ~f )
343- | None -> Dune_rules.Artifact_substitution. copy_file ~conf ~src ~dst ~chmod ()
343+ | None ->
344+ Dune_rules.Artifact_substitution. copy_file ~conf ~executable ~src ~dst ~chmod ()
344345 ;;
345346
346347 let remove_file_if_exists dst =
Original file line number Diff line number Diff line change 1+ - Stop signing source files with substitutions. Sign only binaries instead
2+ (#8361 , fixes #8360 , @anmonteiro )
Original file line number Diff line number Diff line change @@ -649,7 +649,15 @@ let replace_if_different ~delete_dst_if_it_is_a_directory ~src ~dst =
649649 if not up_to_date then Path. rename src dst
650650;;
651651
652- let copy_file ~conf ?chmod ?(delete_dst_if_it_is_a_directory = false ) ~src ~dst () =
652+ let copy_file
653+ ~conf
654+ ?(executable = false )
655+ ?chmod
656+ ?(delete_dst_if_it_is_a_directory = false )
657+ ~src
658+ ~dst
659+ ()
660+ =
653661 (* We create a temporary file in the same directory to ensure it's on the same
654662 partition as [dst] (otherwise, [Path.rename temp_file dst] won't work). The
655663 prefix ".#" is used because Dune ignores such files and so creating this
@@ -664,7 +672,9 @@ let copy_file ~conf ?chmod ?(delete_dst_if_it_is_a_directory = false) ~src ~dst
664672 let open Fiber.O in
665673 Path. parent dst |> Option. iter ~f: Path. mkdir_p;
666674 let * has_subst = copy_file_non_atomic ~conf ?chmod ~src ~dst: temp_file () in
667- let + () = run_sign_hook conf ~has_subst temp_file in
675+ let + () =
676+ if executable then run_sign_hook conf ~has_subst temp_file else Fiber. return ()
677+ in
668678 replace_if_different ~delete_dst_if_it_is_a_directory ~src: temp_file ~dst )
669679 ~finally: (fun () ->
670680 Path. unlink_no_err temp_file;
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ val decode : string -> t option
5757 and then atomically renamed to [dst]. *)
5858val copy_file
5959 : conf:conf
60+ -> ?executable:bool
6061 -> ?chmod:(int -> int )
6162 -> ?delete_dst_if_it_is_a_directory:bool
6263 -> src:Path. t
You can’t perform that action at this time.
0 commit comments