Skip to content

Add recursive directory contents when using RunStep.addDirectoryArg and friends #20935

@ikskuh

Description

@ikskuh

.directory_source => |file| {
const file_path = file.lazy_path.getPath2(b, step);
try argv_list.append(b.fmt("{s}{s}", .{ file.prefix, file_path }));
man.hash.addBytes(file.prefix);
man.hash.addBytes(file_path);
},

Right now, the directory path is cached, but not it's contents. This means when using a thing like

const bundle_step = b.addSystemCommand(&.{"tar", "-c"});

bundle_step.addArg("-f");
const asset_bundle_path = bundle_step.addOutputFileArg("result.tar");

bundle_step.addArg("-C");
bundle_step.addDirectoryArg(b.path("./assets"));

// asset_bundle_path is only generated once, no matter if the files inside ./assets ever change

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorzig build systemstd.Build, the build runner, `zig build` subcommand, package management

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions