zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit d3ecbbebd33fffc2e283d0c6524c3647c894fa1b (tree)
parent 3dafc5b9a322124c325447a37fa117b093795448
Author: Isaac Freund <ifreund@ifreund.xyz>
Date:   Fri,  1 Jan 2021 22:56:43 +0100

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.

Diffstat:
Mlib/std/build.zig | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

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