authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-04-10 16:38:24-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-04-10 18:35:14-07:00
log38698f4f6aabb20639642afa58b17f31a43e162b
tree76d5a9f1c01b7e77cc530a961406d6edb903849f
parentd2ad3f5074877475c8f0ec0fbbb323a05fe8cf78

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

2 files changed, 0 insertions(+), 5 deletions(-)

lib/std/Build/CompileStep.zig-2
...@@ -111,7 +111,6 @@ vcpkg_bin_path: ?[]const u8 = null,...@@ -111,7 +111,6 @@ vcpkg_bin_path: ?[]const u8 = null,
111/// This may be set in order to override the default install directory111/// This may be set in order to override the default install directory
112override_dest_dir: ?InstallDir,112override_dest_dir: ?InstallDir,
113installed_path: ?[]const u8,113installed_path: ?[]const u8,
114install_step: ?*InstallArtifactStep,
115114
116/// Base address for an executable image.115/// Base address for an executable image.
117image_base: ?u64 = null,116image_base: ?u64 = null,
...@@ -390,7 +389,6 @@ pub fn create(owner: *std.Build, options: Options) *CompileStep {...@@ -390,7 +389,6 @@ pub fn create(owner: *std.Build, options: Options) *CompileStep {
390 .output_dir = null,389 .output_dir = null,
391 .override_dest_dir = null,390 .override_dest_dir = null,
392 .installed_path = null,391 .installed_path = null,
393 .install_step = null,
394 .force_undefined_symbols = StringHashMap(void).init(owner.allocator),392 .force_undefined_symbols = StringHashMap(void).init(owner.allocator),
395393
396 .output_path_source = GeneratedFile{ .step = &self.step },394 .output_path_source = GeneratedFile{ .step = &self.step },
lib/std/Build/InstallArtifactStep.zig-3
...@@ -17,8 +17,6 @@ h_dir: ?InstallDir,...@@ -17,8 +17,6 @@ h_dir: ?InstallDir,
17dest_sub_path: ?[]const u8,17dest_sub_path: ?[]const u8,
1818
19pub fn create(owner: *std.Build, artifact: *CompileStep) *InstallArtifactStep {19pub fn create(owner: *std.Build, artifact: *CompileStep) *InstallArtifactStep {
20 if (artifact.install_step) |s| return s;
21
22 const self = owner.allocator.create(InstallArtifactStep) catch @panic("OOM");20 const self = owner.allocator.create(InstallArtifactStep) catch @panic("OOM");
23 self.* = InstallArtifactStep{21 self.* = InstallArtifactStep{
24 .step = Step.init(.{22 .step = Step.init(.{
...@@ -44,7 +42,6 @@ pub fn create(owner: *std.Build, artifact: *CompileStep) *InstallArtifactStep {...@@ -44,7 +42,6 @@ pub fn create(owner: *std.Build, artifact: *CompileStep) *InstallArtifactStep {
44 .dest_sub_path = null,42 .dest_sub_path = null,
45 };43 };
46 self.step.dependOn(&artifact.step);44 self.step.dependOn(&artifact.step);
47 artifact.install_step = self;
4845
49 owner.pushInstalledFile(self.dest_dir, artifact.out_filename);46 owner.pushInstalledFile(self.dest_dir, artifact.out_filename);
50 if (self.artifact.isDynamicLibrary()) {47 if (self.artifact.isDynamicLibrary()) {