authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-01-01 22:56:43+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-01-01 18:57:23-08:00
logd3ecbbebd33fffc2e283d0c6524c3647c894fa1b
treed88768dacb930dd0431110174adf1b34b913446f
parent3dafc5b9a322124c325447a37fa117b093795448

std/build: assert that install paths are relative

If absolute paths are passed they will work unless $DESTDIR is set, which causes subtly broken build.zig's.

1 files changed, 1 insertions(+), 0 deletions(-)

lib/std/build.zig+1
......@@ -1100,6 +1100,7 @@ pub const Builder = struct {
11001100 }
11011101
11021102 pub fn getInstallPath(self: *Builder, dir: InstallDir, dest_rel_path: []const u8) []const u8 {
1103 assert(!fs.path.isAbsolute(dest_rel_path)); // Install paths must be relative to the prefix
11031104 const base_dir = switch (dir) {
11041105 .Prefix => self.install_path,
11051106 .Bin => self.exe_dir,