Skip to content
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

ConfigHeader does not automatically register a generated FileSource as a step dependency #16208

Open
distractedlambda opened this issue Jun 25, 2023 · 2 comments · May be fixed by #19704
Open
Labels
bug Observed behavior contradicts documented or intended behavior contributor friendly This issue is limited in scope and/or knowledge of Zig internals. zig build system
Milestone

Comments

@distractedlambda
Copy link

Zig Version

0.11.0-dev.3803+7ad104227

Steps to Reproduce and Observed Behavior

The cmake and autoconf styles of ConfigHeader take a FileSource for the input header, and do indeed work with generated files, but they do not automatically add a dependency on the generation step.

Expected Behavior

I would expect the dependency to be added automatically, as this is almost certainly the user's intention, and is already done elsewhere in the build script API.

@distractedlambda distractedlambda added the bug Observed behavior contradicts documented or intended behavior label Jun 25, 2023
@matu3ba
Copy link
Contributor

matu3ba commented Jun 25, 2023

Polite ping @Jan200101, if you want to poke this and/or #16203. If you prefer not to be pinged, let me know.

@Jan200101
Copy link
Contributor

Jan200101 commented Jun 26, 2023

I'm fine with being pinged.

Already PR'd a fix for 16203 but am unsure how the requested behavior should look like (plus I think this is a feature request / proposal not a bug report).

Would an example of the requested behavior be passing a header through multiple ConfigHeader's and having the implicit dependencies established?

e.g.

const std = @import("std");

pub fn build(b: *std.Build) void {
    // first we pass it through cmake
    const cmake_config = b.addConfigHeader(.{ .style = .{ .cmake = .{ .path = "config.h.in" } } }, .{});

    // then through autoconf
    const autoconf_confing = b.addConfigHeader(.{ .style = .{ .autoconf = .{ .path = cmake_config.getFileSource() } } }, .{});

    const install_autoconf_config = b.addInstallFile(autoconf_confing.getFileSource(), "config-autoconf.h");
    b.getInstallStep().dependOn(&install_autoconf_config.step);
}

@andrewrk andrewrk modified the milestones: 0.11.0, 0.11.1 Jul 22, 2023
@andrewrk andrewrk added the contributor friendly This issue is limited in scope and/or knowledge of Zig internals. label Jul 24, 2023
@andrewrk andrewrk modified the milestones: 0.11.1, 0.12.0 Jan 29, 2024
@andrewrk andrewrk modified the milestones: 0.12.0, 0.13.0 Mar 21, 2024
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 contributor friendly This issue is limited in scope and/or knowledge of Zig internals. zig build system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants