-
Notifications
You must be signed in to change notification settings - Fork 9
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
external: kernel version from depsolve (COMPOSER-2354) #205
Conversation
fc29bef
to
7f3fb3b
Compare
The issue I see (beside api surface) is that currently we support changing the kernel name in images easily, so I expect in our otk files we will have something like:
and with that we would need lookup inside usage of defines, yes? I.e. something like
which iirc we do not support currently. We could of course but I'm not sure we should for this use-case since we now need to write a new feature and have a much bigger api surface. If there is a good use-case for exposing all versions and all details for the versions (i.e. version/epoch/release/arch) beside the kernel then of course we should consider this. |
cc @achilleas-k and @ondrejbudai |
I responded on the previous PR but let me copy my comment here: The only call to the equivalent function in images that's not for looking up the kernel is to check if I can imagine a case where this might be useful. We've never had to do this but perhaps a stage's options might change depending on the version of a given package (in the build root or in the OS). I lean towards simplicity for these externals, but I also like the generalisation of being able to "query" for any package's version by name. It feels useful, so my instinct right now is to generalise it so it's easier to grow in the future. |
Have we considered a separate external that consumes the output of the depsolver to look up package info by name? |
Kinda, I don't think it particularly adds much unless we want to find a package in multiple package sets (for example). However it does allow us to parametrize the package name more easily as @mvo5 brought up. This might be necessary for custom kernels? |
data["tree"]["const"]["versions"] = {} | ||
|
||
for package in packages: | ||
data["tree"]["const"]["versions"][package["name"]] = package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do it like this then the internal json representation of a "package" in dnfjson becomes an (external) API that we will need to maintain, i.e. we can never rename/remove/change e.g. remote_location
or checksum
. I would suggest to change it so that we only expose what is required for the kernel use-case instead as this is easier to maintain/keep compatible.
Fwiw, this is orthogonal to my point that I'm not sure we should expose the details for all packages by default (but limiting what we expose would certainly reduce it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Storing packages by their names can cause issues with multi-arch images (x86_64 and i686) but I wouldn't worry about this too much.
I agree with Michael that directly exposing dnf-json's output creates a risky depedency, so I suggest exposing just VRA for now. :) We can always go bigger later.
Otherwise this lgtm. ;)
Provide a map keyed by package name of the depsolve result that can be used by omnifests to look up package information. Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
Use the kernel version from the depsolve. Note: this assumes a `.os` package set to exist. Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
Summarizing (also tagging @mvo5), expose all packages but only their Version-Release-Architecture right? |
6788348
to
88b0d09
Compare
If we do this we still have the issue that any kernel name like (my-kernel) that is not a valid var in otk could not be represeted AFAICT. So |
This is still an option yes. There's also a separate parallel discussion about names in #213 which would alleviate or make that harder :) |
Right, if we merge this as is we will be force to solve #213 quickly too because otherwise this feature here will not work for certain package names. So I'm not sure we should before we have a plan for that. |
I opened #226 with an alternative idea that uses an external (iirc achilleas suggested this) |
We're going #226. |
Provide a (wide) API from the depsolve to query package versions; this is split out from #196 and needs separate discussion; previously:
@mvo5:
@supakeen: