| 1 | const InstallFile = @This(); |
| 2 | |
| 3 | const std = @import("std"); |
| 4 | const Configuration = std.Build.Configuration; |
| 5 | |
| 6 | const Step = @import("../Step.zig"); |
| 7 | const Maker = @import("../../Maker.zig"); |
| 8 | |
| 9 | pub fn make( |
| 10 | install_file: *InstallFile, |
| 11 | step_index: Configuration.Step.Index, |
| 12 | maker: *Maker, |
| 13 | progress_node: std.Progress.Node, |
| 14 | ) Step.ExtendedMakeError!void { |
| 15 | _ = install_file; |
| 16 | _ = progress_node; |
| 17 | const arena = maker.graph.arena; // TODO don't leak into process arena |
| 18 | const step = maker.stepByIndex(step_index); |
| 19 | const conf = &maker.scanned_config.configuration; |
| 20 | const conf_step = step_index.ptr(conf); |
| 21 | const conf_if = conf_step.extended.get(conf.extra).install_file; |
| 22 | |
| 23 | try step.singleUnchangingWatchInput(maker, arena, conf_if.source.get(conf)); |
| 24 | const p = try maker.installLazyPathSub(arena, conf_if.source, conf_if.dest_dir, conf_if.dest_sub_path.slice(conf), step_index); |
| 25 | step.result_cached = p == .fresh; |
| 26 | } |