authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-01-04 13:49:17-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-01-04 13:49:17-07:00
logfc38b42521027b2ddcba688ba07bd2f6eb2737bc
treed870747af3732783404aede8b4f575258e1efb45
parentef2fa67ef018a4a49124a40e60941149efd34553

Revert "Fix #7296:"

This broke build scripts that wanted to refer to `exe_dir` or `install_path`. There has also been some pushback and discussion on this breaking change. I think it should be re-evaluated. This reverts commit a1a1929cf4ff979bdaba17f858d4ce8647e87a65.

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

lib/std/build.zig+4-8
...@@ -200,16 +200,12 @@ pub const Builder = struct {...@@ -200,16 +200,12 @@ pub const Builder = struct {
200 const install_prefix = self.install_prefix orelse "/usr";200 const install_prefix = self.install_prefix orelse "/usr";
201 self.install_path = fs.path.join(self.allocator, &[_][]const u8{ dest_dir, install_prefix }) catch unreachable;201 self.install_path = fs.path.join(self.allocator, &[_][]const u8{ dest_dir, install_prefix }) catch unreachable;
202 } else {202 } else {
203 self.install_path = self.install_prefix orelse blk: {203 const install_prefix = self.install_prefix orelse blk: {
204 const p = if (self.release_mode) |mode| switch (mode) {204 const p = self.cache_root;
205 .Debug => "debug",
206 .ReleaseSafe => "release",
207 .ReleaseFast => "release",
208 .ReleaseSmall => "release",
209 } else "debug";
210 self.install_prefix = p;205 self.install_prefix = p;
211 break :blk self.pathFromRoot(p);206 break :blk p;
212 };207 };
208 self.install_path = install_prefix;
213 }209 }
214 self.lib_dir = fs.path.join(self.allocator, &[_][]const u8{ self.install_path, "lib" }) catch unreachable;210 self.lib_dir = fs.path.join(self.allocator, &[_][]const u8{ self.install_path, "lib" }) catch unreachable;
215 self.exe_dir = fs.path.join(self.allocator, &[_][]const u8{ self.install_path, "bin" }) catch unreachable;211 self.exe_dir = fs.path.join(self.allocator, &[_][]const u8{ self.install_path, "bin" }) catch unreachable;
lib/std/special/build_runner.zig+1-1
...@@ -134,8 +134,8 @@ pub fn main() !void {...@@ -134,8 +134,8 @@ pub fn main() !void {
134 }134 }
135 }135 }
136136
137 try runBuild(builder);
138 builder.resolveInstallPrefix();137 builder.resolveInstallPrefix();
138 try runBuild(builder);
139139
140 if (builder.validateUserInputDidItFail())140 if (builder.validateUserInputDidItFail())
141 return usageAndErr(builder, true, stderr_stream);141 return usageAndErr(builder, true, stderr_stream);