-
Notifications
You must be signed in to change notification settings - Fork 28
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
cachi2 should also cache bundler of the locked version #755
Comments
FYI the gemlock-parser already has So the only further change needed is with cachi2, regards. |
I believe we don't have any precedents for actually fetching the exact version package manager binary during a prefetch. I do see why you need it, though, so I was wondering if you could use the generic fetcher to simply download the Gem you need from rubygems.org? https://github.com/containerbuildsystem/cachi2/blob/main/docs/generic.md It would essentially require a tiny lockfile to be added to the repo you're building, then Bundler would be properly downloaded and reported in the resulting SBOM. |
@gsaslis Can you please provide your thoughts on ^^^ (#755 (comment)) |
@eskultety / @brunoapimentel I'm a little confused. The generic fetcher docs mention:
Am I correct in understanding that, while this does offer a way to get the right version of bundler in the build, the downside of that approach would be that this version of bundler is not, in fact, recorded correctly in the SBOM ? Or does that sentence refer to something else? With regards to the extra lockfile itself, it does appear unnecessary (since the source of truth for that information already exists with |
Hi Yorgos, documentation tries to stress, that if there is a package manager support for your use case, you should use that one and not the generic fetcher, because you will receive more precise SBOM among the other benefits. Your use case is different and it's OK to use generic fetcher to get required version of bundler and then use ruby/bundler package manager for your project as designed. |
@gsaslis I completely agree with you here - it is far from an ideal UX and UX is something that needs to be one of our top priorities since we're developing this project for our users otherwise, what's the point!? That said, the limitation behind @brunoapimentel's earlier comment comes from some downstream requirements, but if you argued that this IS NOT a downstream space for the project I would not be able argue against. I'm wondering if we could explore a solution where we'd make this a conditional behaviour, i.e. have a backend-specific flag (doesn't make sense globally since not all backends are able to leverage this kind of functionality) and so we could fetch the given version of If the team's consensus (@tmadore, @ben-alkov, @a-ovchinnikov, @slimreaper35, @brunoapimentel) is that we could provide this functionality to the described extent, then patches are always welcome :) if this kind of support is somewhat urgent for you in any way. |
Thanks all for your replies. I do see that - depending on the ecosystem - the necessity of allowing the packaged manager to be prefetched is not the same.
Speaking for ruby/bundler specifically, I don't see why this should be so. Bundler is a ruby library - exactly like all the other ruby libraries that the project relies on. From the UX point of view, if cachi2 prefetches the project dependencies found in And in terms of the SBOM, I would expect the SBOM to include 2 versions of bundler (the system one, if there is one installed in the base image, and the project one, which is the one that is used by the project). With that said, I'd still defer to @akostadinov to drive this forward, as I'll be moving onto other duties soon. |
This issue was originally reported by @akostadinov on the Cachito issue tracker. I am recreating the feature request here.
cachi2 presently does not cache
bundler
because it is usually (or never?) not pinned as a dependency with version in the Gemfile.lock [1].But it is important for the same version of bundler to be installable and used for resolving dependencies.
At the bottom of a Gemfile.lock, there is
BUNDLED WITH
2.3.4
Cachito needs to cache bundler of this version so that builds can install it into the system. Using the
bundler
from the build image does not usually fit.P.S. If
BUNDLED WITH
is not present, only then do not cache bundler. For example if project usesgem install -g
instead ofbundle install
.Acceptance criteria
As an additional piece of information, I wanted to add that the capability to parse the
BUNDLED WITH
information has already been contributed (and merged!) to the upstream projects, so that it can be used by cachi2.The text was updated successfully, but these errors were encountered: