Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
anthonydahanne opened this issue Apr 22, 2024 · 2 comments
Closed
Labels
type:bug A general bug

Comments

@anthonydahanne
Copy link
Member

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:

  • configure tests with a dynamic PURL that would adapt to the machine running the tests (ends with arch=arm64 if the tests run on arm64)
  • default arch in the piece of code above to empty string and if it's empty string, then consider the dependency to be resolved on all arch.
  • do nothing and wait for the proper detection mechanism for arch (Implement RFC 0059 - Update metadata to be consistent with RFC standard #327)
@anthonydahanne anthonydahanne added the type:bug A general bug label Apr 22, 2024
@anthonydahanne
Copy link
Member Author

To have my tests passing, I simply added:

purl = "pkg:generic/springframework/[email protected]"

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

anthonydahanne added a commit to paketo-buildpacks/spring-boot that referenced this issue Apr 22, 2024
* update .gitignore
* add purl to test so that it does not fail on arm64, see: paketo-buildpacks/libpak#335
anthonydahanne added a commit to paketo-buildpacks/spring-boot that referenced this issue Apr 22, 2024
* update .gitignore
* add purl to test so that it does not fail on arm64, see: paketo-buildpacks/libpak#335
@dmikusa
Copy link
Contributor

dmikusa commented Apr 25, 2024

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, #335 (comment) 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.

@dmikusa dmikusa closed this as completed Apr 25, 2024
anthonydahanne added a commit to paketo-buildpacks/spring-boot that referenced this issue May 1, 2024
* update .gitignore
* add purl to test so that it does not fail on arm64, see: paketo-buildpacks/libpak#335
anthonydahanne added a commit to paketo-buildpacks/spring-boot that referenced this issue May 1, 2024
* update .gitignore
* add purl to test so that it does not fail on arm64, see: paketo-buildpacks/libpak#335
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants