Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ikskuh opened this issue Aug 4, 2024 · 1 comment
Labels
bug Observed behavior contradicts documented or intended behavior zig build system std.Build, the build runner, `zig build` subcommand, package management
Milestone

Comments

@ikskuh
Copy link
Contributor

ikskuh commented Aug 4, 2024

.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
@andrewrk andrewrk added the zig build system std.Build, the build runner, `zig build` subcommand, package management label Aug 12, 2024
@andrewrk
Copy link
Member

I fixed this already in WriteFile step. Similar logic can be used.

@andrewrk andrewrk added the bug Observed behavior contradicts documented or intended behavior label Aug 12, 2024
@andrewrk andrewrk added this to the 0.14.0 milestone Aug 12, 2024
@andrewrk andrewrk modified the milestones: 0.14.0, 0.15.0 Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior zig build system std.Build, the build runner, `zig build` subcommand, package management
Projects
None yet
Development

No branches or pull requests

2 participants