buildpacks / libcnb

A non-opinionated language binding for the Cloud Native Buildpack Buildpack and Extension specifications
Apache License 2.0
31 stars 13 forks source link

Add support for buildpacks API 0.10 #260

Closed dmikusa closed 3 months ago

dmikusa commented 1 year ago

This could probably be broken down into more tasks, but at a high level we need to add support for 0.10.

https://buildpacks.io/docs/reference/spec/migration/buildpack-api-0.9-0.10/

loewenstein commented 11 months ago

Doesn't it need to be about 0.8 -> 0.9 -> 0.10, i.e. using https://buildpacks.io/docs/reference/spec/migration/buildpack-api-0.8-0.9/ and then https://buildpacks.io/docs/reference/spec/migration/buildpack-api-0.9-0.10/?

nicolasbender commented 4 months ago

This could probably be broken down into more tasks

Could you provide more details for these subtasks, please? We haven't found any relevant changes from 0.9 -> 0.10 affecting libcnb. Out of interest: Why was v2 of libcnb created in the first place?

dmikusa commented 4 months ago

@loewenstein 0.9 is already supported, so we just need to add 0.10 support. It needs to be an additive change.

@nicolasbender

Out of interest: Why was v2 of libcnb created in the first place?

In a nutshell, breaking API changes. We reworked the core build/detect mechanism. It was previously done with structs at its heart, and we changed it to be function-based now. I believe it'll be more flexible, but this was also done in conjunction with the Paketo team to position them to be able to use libcnb as the base for their packit library.

Aside from that, we made some changes to the way logging works as well, so it's more pluggable. We've removed some other cruft like old buildpack API compatibility. We've fixed some other minor annoyances in the APIs as well.

loewenstein commented 4 months ago
  • The migration guide doesn't elaborate on runtime image extensions, but this needs to be spiked to see if there are any required changes to support this. For example, there might be struct/toml changes.

Is libcnb supposed to support authoring extensions?

c0d1ngm0nk3y commented 4 months ago

It was previously done

But why wasn't v2 then released earlier? v1 doesn't support the Buildpack API 0.10 either, does it?

dmikusa commented 4 months ago

v1 supports 0.8. That is the highest it will ever go because going above that requires breaking API changes.

https://github.com/buildpacks/libcnb/blob/release-1.x/build.go#L95-L99

Yes, we support extensions in v2. There are a couple under Paketo Community using it, but we haven't had a huge demand for it. I was hoping that it would stabilize more before we release libcnb v2 and it looks like it has so that's another milestone complete towards v2 release.