paketo-buildpacks / libpak

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

No arch dependencies (such as jar files) should not be filtered out #335

Closed anthonydahanne closed 4 months ago

anthonydahanne commented 4 months ago

With the support for dual arch, such filters were added:

https://github.com/paketo-buildpacks/libpak/blob/620bd46eb3bf74d4af08246b0815bd0589e53f7b/buildpack.go#L511C1-L518C4

Now, I'm running tests for spring-boot buildpack currently, and my system arch is arm64

During my test run, I'm asserting Spring-Cloud-Bindings jar is downloaded, but because of:

            // filter out deps that do not match the current running architecture
        arch, err := archFromPURL(c.PURL)

no PURL was given, so it defaults to amd64

        if err != nil {
            return BuildpackDependency{}, fmt.Errorf("unable to compare arch\n%w", err)
        }
        if arch != archFromSystem() {
            continue
        }

and now my dependency is skipped

I'm no longer sure what the best course of action is:

anthonydahanne commented 4 months ago

To have my tests passing, I simply added:

purl = "pkg:generic/springframework/spring-cloud-bindings@2.0.0"

to the test setup, for my dependency; because if the purl is not empty, archFromSystem() will take the OS arch

dmikusa commented 4 months ago

I'm going to close this out because I think it's working as designed at the moment. You need to have something in the PURL and for reference, if anyone else sees this issue, https://github.com/paketo-buildpacks/libpak/issues/335#issuecomment-2070720907 is what you should add.

Also, we're hopefully going to have #327 implemented soon and that should clear up some of this as well.