Skip to content

Commit

Permalink
Revert "Fix #7296:"
Browse files Browse the repository at this point in the history
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 a1a1929.
  • Loading branch information
andrewrk committed Jan 4, 2021
1 parent ef2fa67 commit fc38b42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions lib/std/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,12 @@ pub const Builder = struct {
const install_prefix = self.install_prefix orelse "/usr";
self.install_path = fs.path.join(self.allocator, &[_][]const u8{ dest_dir, install_prefix }) catch unreachable;
} else {
self.install_path = self.install_prefix orelse blk: {
const p = if (self.release_mode) |mode| switch (mode) {
.Debug => "debug",
.ReleaseSafe => "release",
.ReleaseFast => "release",
.ReleaseSmall => "release",
} else "debug";
const install_prefix = self.install_prefix orelse blk: {
const p = self.cache_root;
self.install_prefix = p;
break :blk self.pathFromRoot(p);
break :blk p;
};
self.install_path = install_prefix;
}
self.lib_dir = fs.path.join(self.allocator, &[_][]const u8{ self.install_path, "lib" }) catch unreachable;
self.exe_dir = fs.path.join(self.allocator, &[_][]const u8{ self.install_path, "bin" }) catch unreachable;
Expand Down
2 changes: 1 addition & 1 deletion lib/std/special/build_runner.zig
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ pub fn main() !void {
}
}

try runBuild(builder);
builder.resolveInstallPrefix();
try runBuild(builder);

if (builder.validateUserInputDidItFail())
return usageAndErr(builder, true, stderr_stream);
Expand Down

0 comments on commit fc38b42

Please sign in to comment.