[implementation][scripts] Add config::build function to copy php-dist…#1321
Conversation
|
@pacostas @jericop - Do you know what is interpreting the This is a difference I've noticed between this build system and libpak. With libpak, there is support to include files like I'm just trying to understand how this gets handled with github-config. The issue here with PHP config files is similar. @benjaminguttmann-avtq had them originally listed like I'd rather have a rule like, if you have a file in |
|
For what it's worth, the node-engine buildpack does seem to do something similar, https://github.com/paketo-buildpacks/node-engine/blob/a8e19c0b115e9ffeab77410b11e102b1d795c94e/scripts/build.sh#L108. It may not be something a lot of buildpacks use, but I think there is some sort of pattern here that would be nice to cover in a generic way. |
The include files is used by jam and by pack CLI, to properly first build the .tgz file, which has the following structure and then from the .tgz file pack cli will create the .cnb files, with the help of the include-files and the buildpack.toml in general.
Do you have an example, as I see that almost all the java repos use the same pattern on include as on the node-engine : Also the Redme file on the e.g. spring-boot, I believe will not be on the .cnb file but only on the .tgz file (if libpak uses the .tgz as a middle process kind of thing) Can you please confirm that?
Yes, this is possible. In general we can support wildcards for copying files, or we can even add another metadata called excluded files. So for example we could do This definitely will be more handy when we create a buildpack.toml file, although, this does not mean that what this PR does, wouldnt be necessasry, as jam or pack, does not know how to build the specific dependencies of each buildpacks, unless we could put some instructions on the buildpack.toml on how to build the specific buildpack. |
|
Also, what we specify on the include-files, is not what exists on the repo, is what exists under the .tgz file, which is what the build script produced. So practically, on the include-files we specify the files after the build script has run, and this makes it a little bit confusing on what we should write on the include-files, as the paths (specifically the levels of the directories) do not exactly match with what the repo has, but what the .tgz has. we would expect to have this output on the .cnb file but instead we have this e.g. on the amd64 or on the arm64 |
|
Also previously I mentioned
practically we have that, is the although, I believe the problem is that the |
Yes, so that is a good example: The way this actually reads is The So if you look at what's in the buildpack image for spring-boot, you'll see those files:
With the libpak-based buildpacks, we do not create the I think the packit based buildpacks have done this because historically tooling they use in CI looked at those assets, but I think we've moved away from that recently (see https://github.com/paketo-buildpacks/nginx/blob/main/integration.json#L6 which now points to images instead of the cnb files).
With the libpak based buildpacks, our My preference would be to do the same with jam, if we're in agreement to add this support to it. i.e. not add it into the scripts. It's in one place, well tested, and keeps the build script simpler. |
That is one difference between jam and create-package, create-package calls pack from inside, while jam does not call pack instead outpus a .tgz and then another external command has to call pack
I think the only change in order to do that, is to add the function on the jam CLI that will tell, if its not under For removing the I can create a PR, but I might need some time (like a week) for that as it includes quite some testing. I'm happy to merge this PR though, not to block the python progress. |
👍
I don't think we need to remove them. They're not hurting anything and like you said may still be used by other things. My only concern is that you mentioned some things possibly being out-of-sync between the image/cnb/tgz files. That would not be great, ideally we'd want those to all be the same.
Thank you @pacostas. I'm fine with that time frame, but I'll let @benjaminguttmann-avtq decide on how to proceed. We can merge this to unblock, wait for the jam fix, and then revert this change or we can wait for the jam fix and close this. Also, @benjaminguttmann-avtq if you have interest in submitting a PR for jam that's an option too. That's an option too. Thanks all! |
|
I am happy to wait.. I will focus meanwhile on getting the ruby CNB side of things up-to-date. And yeah, not sure if I understood enough already what needs to be done in jam .. so @pacostas for providing that fix :) |
|
Related PR paketo-buildpacks/jam#525 |

… config
Summary
This adds a config::build function to ensure the config needed for php-dist is present under the path /os/arch/config/XY as the build otherwise fails as can be seen in this test run: https://github.com/paketo-buildpacks/php-dist/actions/runs/22901160138/job/66447799817?pr=1025
Adding the function fixes that issue as you can in this run: https://github.com/paketo-buildpacks/php-dist/actions/runs/22906721803/job/66467450176?pr=1026
The noble tests is what I am actually trying to fix in my PR in php-dist, but that does not have anything to do with the build.sh
Use Cases
Checklist