paketo-buildpacks / libpak

An opinionated extension to the libcnb Cloud Native Buildpack Library
Apache License 2.0
15 stars 17 forks source link

Adds `--target-arch` flag #331

Closed dmikusa closed 4 months ago

dmikusa commented 4 months ago

Summary

Adds a --target-arch flag which causes the tool to only create a build pack for the target architecture. By default, it builds all architectures. It still supports the old format of buildpack which does not include arch information in the include-files field.

Use Cases

Resolves #330

I'm moving:

In addition, filter the metadata dependencies and only include those for the specified arch.

into #326 because it'll be easier to add there, cause it's not doing dependencies for multi-arch yet.

Checklist

braunsonm commented 4 months ago

@dmikusa can you clarify:

I'm moving: into https://github.com/paketo-buildpacks/libpak/issues/326 because it'll be easier to add there, cause it's not doing dependencies for multi-arch yet.

So at this stage - create-package will download dependencies you won't need in your build output? But will they be included in the final pack output?

dmikusa commented 4 months ago

@braunsonm - Yes. For now, it will download everything that is in the metadata in buildpack.toml. You can filter dependencies with create-package, but presently it only works by id and by version, not by arch. That's what's going to be added as part of #326.

You could do something like the yj command I shared with you on Slack to apply a filter to buildpack.toml prior to running and create-package and that might help. I'm hoping to get #326 wrapped up in the next week or so. Then we can cut a release and get this shipped.

braunsonm commented 4 months ago

I see.

I think we'll wait until that issue is also fixed before adopting this... for now we are going to have to keep pinning to old versions. Thanks for the quick turn around at least on this part of the issue.