buildpacks / lifecycle

Reference implementation of the Cloud Native Buildpacks lifecycle
https://buildpacks.io
Apache License 2.0
186 stars 105 forks source link

Extender-lib PoC buildpack/extension provides/requires resolution not as expected. #841

Closed BarDweller closed 2 years ago

BarDweller commented 2 years ago

Summary

This applies only to the extender-lib poc branch

If an extension 'provides' something 'required' by buildpacks, and a buildpack also 'provides' the same thing, then today both the extension AND the buildpack will be put in the build plan, and both will provide the same resource. This feels like a bug?


Reproduction

Steps
  1. create an extension in the poc that 'provides' fish via the buildplan during detect
  2. create a buildpack in the poc that 'provides' fish via the buildplan during detect
  3. create a buildpack in the poc that 'requires' fish via the buildplan during detect
  4. notice that the extension and both buildpacks are considered as participating following detect.
Current behavior

extension and buildpack both attempt to provide same resource

Expected

buildpack doing the provide would not be selected, as the extension (which will always run first, and thus win) will already have supplied it.


Context

lifecycle version

0.8

platform version(s)

n/a

anything else?
natalieparellano commented 2 years ago

@BarDweller thanks for reporting! Could you check if the issue is fixed on this branch: https://github.com/buildpacks/lifecycle/pull/844

BarDweller commented 2 years ago

After discussion, this is currently working as expected =)