Do not copy over .install files

This commit is contained in:
Jérémie Dimino 2017-02-26 21:39:03 +00:00
parent b27591aa7e
commit e52cca99cb
1 changed files with 15 additions and 9 deletions

View File

@ -260,16 +260,22 @@ let setup_copy_rules t ~all_non_target_source_files ~all_targets_by_dir =
String_map.iter (Context.all ()) ~f:(fun ~key:_ ~data:(ctx : Context.t) ->
let ctx_dir = ctx.build_dir in
Pset.iter all_non_target_source_files ~f:(fun path ->
let build = Build.copy ~src:path ~dst:(Path.append ctx_dir path) in
(* We temporarily allow overrides while setting up copy rules
from the source directory so that artifact that are already
present in the source directory are not re-computed.
let ctx_path = Path.append ctx_dir path in
if is_target t ctx_path &&
String.is_suffix (Path.basename ctx_path) ~suffix:".install" then
(* Do not copy over .install files that are generated by a rule. *)
()
else
let build = Build.copy ~src:path ~dst:ctx_path in
(* We temporarily allow overrides while setting up copy rules
from the source directory so that artifact that are already
present in the source directory are not re-computed.
This allows to keep generated files in tarballs. Maybe we
should allow it on a case-by-case basis though. *)
compile_rule t (Pre_rule.make build)
~all_targets_by_dir
~allow_override:true))
This allows to keep generated files in tarballs. Maybe we
should allow it on a case-by-case basis though. *)
compile_rule t (Pre_rule.make build)
~all_targets_by_dir
~allow_override:true))
let create ~file_tree ~rules =
let all_source_files =