Skip to content

RFE: More methods to trigger CPP preprocessing #6744

@solacelost

Description

@solacelost

Currently, buildah will preprocess Containerfiles that end in .in using cpp -E. This behavior has been around a long time and has a dedicated function to try to robustly find cpp in $PATH and there have been a few issues over the years enhancing its behavior. That function is only called if the file suffix matches exactly, though.

I've been (ab)using this feature for a while, as it's pretty easy for bootc Containerfiles to get very long and I found that splitting it up into multiple #include statements helped keep things much better organized.

I was recently working on getting Konflux to build my bootc image when I hit a behavior that breaks this - it copies the provided Containerfile to a randomly-suffixed temp file for manipulation. I've raised the topic over there as I think it probably does need tweaked, since the file extension suffix does specifically matter to buildah in this case.

I also think it would be useful to have other methods to trigger the preprocessing function for buildah, though. Arbitrary file names should be able to be preprocessed in the same way, if a command line argument or environment variable were provided to specify it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions