| ... | ... | @@ -659,7 +659,7 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { |
| 659 | 659 | _ = try man.addFile(lazy_path.getPath2(b, step), null); |
| 660 | 660 | } |
| 661 | 661 | |
| 662 | | if (try step.cacheHit(&man) and !has_side_effects) { |
| 662 | if (!has_side_effects and try step.cacheHit(&man)) { |
| 663 | 663 | // cache hit, skip running command |
| 664 | 664 | const digest = man.final(); |
| 665 | 665 | |
| ... | ... | @@ -678,7 +678,10 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { |
| 678 | 678 | |
| 679 | 679 | const dep_output_file = run.dep_output_file orelse { |
| 680 | 680 | // We already know the final output paths, use them directly. |
| 681 | | const digest = man.final(); |
| 681 | const digest = if (has_side_effects) |
| 682 | man.hash.final() |
| 683 | else |
| 684 | man.final(); |
| 682 | 685 | |
| 683 | 686 | try populateGeneratedPaths( |
| 684 | 687 | arena, |
| ... | ... | @@ -710,7 +713,7 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { |
| 710 | 713 | } |
| 711 | 714 | |
| 712 | 715 | try runCommand(run, argv_list.items, has_side_effects, output_dir_path, prog_node); |
| 713 | | try step.writeManifest(&man); |
| 716 | if (!has_side_effects) try step.writeManifest(&man); |
| 714 | 717 | return; |
| 715 | 718 | }; |
| 716 | 719 | |
| ... | ... | @@ -741,9 +744,17 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { |
| 741 | 744 | |
| 742 | 745 | try runCommand(run, argv_list.items, has_side_effects, tmp_dir_path, prog_node); |
| 743 | 746 | |
| 744 | | try man.addDepFilePost(std.fs.cwd(), dep_output_file.generated_file.getPath()); |
| 747 | const dep_file_dir = std.fs.cwd(); |
| 748 | const dep_file_basename = dep_output_file.generated_file.getPath(); |
| 749 | if (has_side_effects) |
| 750 | try man.addDepFile(dep_file_dir, dep_file_basename) |
| 751 | else |
| 752 | try man.addDepFilePost(dep_file_dir, dep_file_basename); |
| 745 | 753 | |
| 746 | | const digest = man.final(); |
| 754 | const digest = if (has_side_effects) |
| 755 | man.hash.final() |
| 756 | else |
| 757 | man.final(); |
| 747 | 758 | |
| 748 | 759 | const any_output = output_placeholders.items.len > 0 or |
| 749 | 760 | run.captured_stdout != null or run.captured_stderr != null; |
| ... | ... | @@ -778,7 +789,7 @@ fn make(step: *Step, prog_node: *std.Progress.Node) !void { |
| 778 | 789 | }; |
| 779 | 790 | } |
| 780 | 791 | |
| 781 | | try step.writeManifest(&man); |
| 792 | if (!has_side_effects) try step.writeManifest(&man); |
| 782 | 793 | |
| 783 | 794 | try populateGeneratedPaths( |
| 784 | 795 | arena, |