Commit 38698f4f6a

Andrew Kelley <andrew@ziglang.org>
2023-04-11 01:38:24
std.Build.CompileStep: delete install_step field
This was used to ensure that an artifact would only be installed once, but this is not only unnecessary, but actively harmful, in the face of dependencies. see #15079
1 parent d2ad3f5
Changed files (2)
lib/std/Build/CompileStep.zig
@@ -111,7 +111,6 @@ vcpkg_bin_path: ?[]const u8 = null,
 /// This may be set in order to override the default install directory
 override_dest_dir: ?InstallDir,
 installed_path: ?[]const u8,
-install_step: ?*InstallArtifactStep,
 
 /// Base address for an executable image.
 image_base: ?u64 = null,
@@ -390,7 +389,6 @@ pub fn create(owner: *std.Build, options: Options) *CompileStep {
         .output_dir = null,
         .override_dest_dir = null,
         .installed_path = null,
-        .install_step = null,
         .force_undefined_symbols = StringHashMap(void).init(owner.allocator),
 
         .output_path_source = GeneratedFile{ .step = &self.step },
lib/std/Build/InstallArtifactStep.zig
@@ -17,8 +17,6 @@ h_dir: ?InstallDir,
 dest_sub_path: ?[]const u8,
 
 pub fn create(owner: *std.Build, artifact: *CompileStep) *InstallArtifactStep {
-    if (artifact.install_step) |s| return s;
-
     const self = owner.allocator.create(InstallArtifactStep) catch @panic("OOM");
     self.* = InstallArtifactStep{
         .step = Step.init(.{
@@ -44,7 +42,6 @@ pub fn create(owner: *std.Build, artifact: *CompileStep) *InstallArtifactStep {
         .dest_sub_path = null,
     };
     self.step.dependOn(&artifact.step);
-    artifact.install_step = self;
 
     owner.pushInstalledFile(self.dest_dir, artifact.out_filename);
     if (self.artifact.isDynamicLibrary()) {