paketo-buildpacks / libpak

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

Better error messages for mulit-arch dependencies that partially don't exist #328

Open dmikusa opened 4 months ago

dmikusa commented 4 months ago

Describe the Enhancement

If a dependency exists, but not for the present architecture then print a message indicating this, instead of the present error which says that it just doesn't exist (can be confusing).

Possible Solution

  1. Look for the dependency for the current arch. If found, then it gets installed.
  2. If not found, look for the dependency under amd64. If it’s found, then assume we don’t have an arm64 dependency available. Log the error.
  3. If it's not found, then we have a dependency that really just doesn't exist.

The logic here is that if we have an amd64 dependency (which is the full set of available dependencies), then it’s a valid dependency but we just don’t have one for arm64. If there is no amd64 dependency, then you’ve just asked for something we don’t supply and we give the present error message.

Perhaps we could generalize this a bit more and say, if it's not found under some other architecture then it truly is missing. That way if more architectures are added in the future, then we'll just support that correctly.

Motivation

Multi-arch support.