A reference to an existing or future path.

Fields

path: []const u8,

A source file path relative to build root. This should not be an absolute path, but in an older iteration of the zig build system API, it was allowed to be absolute. Absolute paths should use cwd_relative.

generated: *const GeneratedFile,

A file that is generated by an interface. Those files usually are not available until built by a build step.

cwd_relative: []const u8,

An absolute path or a path relative to the current working directory of the build runner process. This is uncommon but used for system environment paths such as --zig-lib-dir which ignore the file system path of build.zig and instead are relative to the directory from which zig build was invoked. Use of this tag indicates a dependency on the host system.

Functions

fn addStepDependencies(self: LazyPath, other_step: *Step) void

Adds dependencies this file source implies to the given step.

fn dupe(self: LazyPath, b: *Build) LazyPath

Duplicates the file source for a given builder.

fn getDisplayName(self: LazyPath) []const u8

Returns a string that can be shown to represent the file source. Either returns…

Returns a string that can be shown to represent the file source. Either returns the path or "generated".

fn getPath(self: LazyPath, src_builder: *Build) []const u8

Returns an absolute path. Intended to be used during the make phase only.

fn getPath2(self: LazyPath, src_builder: *Build, asking_step: ?*Step) []const u8

Returns an absolute path. Intended to be used during the make phase only.

Returns an absolute path. Intended to be used during the make phase only.

asking_step is only used for debugging purposes; it’s the step being run that is asking for the path.

fn relative(path: []const u8) LazyPath

Returns a new file source that will have a relative path to the build root guara…

Returns a new file source that will have a relative path to the build root guaranteed. Asserts the parameter is not an absolute path.