-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
acceptedThis proposal is planned.This proposal is planned.breakingImplementing this issue could cause existing code to no longer compile or have different behavior.Implementing this issue could cause existing code to no longer compile or have different behavior.contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.zig build systemstd.Build, the build runner, `zig build` subcommand, package managementstd.Build, the build runner, `zig build` subcommand, package management
Milestone
Description
Right now, .{ .path = "xyz" } is both (a bit) clunky and is missing information about the std.Build it is meant to be relative to.
I often use cwd_relative now and just store an absolute path computed with @src(), but i don't think this is the right solution here.
Thus, i propose to change
Line 2051 in d565c5d
| path: []const u8, |
to
path: struct {
rel: []const u8,
root: *std.Build,
}and to make the usage easier, to introduce
pub fn path(build: *std.Build, path: []const u8) LazyPath {
return .{ .path = .{ .root = build, .rel = path } };
}Which would replace .{ .path = "xyz" } with b.path("xyz") which is even shorter than before, but packs more information (which is sometimes required in builds when handling LazyPaths over several build scripts)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
acceptedThis proposal is planned.This proposal is planned.breakingImplementing this issue could cause existing code to no longer compile or have different behavior.Implementing this issue could cause existing code to no longer compile or have different behavior.contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.zig build systemstd.Build, the build runner, `zig build` subcommand, package managementstd.Build, the build runner, `zig build` subcommand, package management