-
Notifications
You must be signed in to change notification settings - Fork 153
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
repo_add_solv() doesn't load comps data correctly #492
Comments
The testcase writer only dumps the data relevant for the solver, so I'm not surprised that all the comps specific data is missing. |
Right, that explains why the data aren't in the testcase dump, and we actually know the translations and other data are loading correctly, so that was misleading from me, sorry. But it appears they are not being loaded from the
|
That's because you use repodata_write, not repo_write. So you also write non solving-related data, i.e. no dependencies, package name and the like. |
Hmm. Sorry, I don't follow, I'm getting lost in the fine differences. We use I've scoured the documentation but haven't found much on this, more details would be appreciated. |
The comps data is not an "extension", the groups/environments are mapped to pseudo packages. |
Ok, but what are the implications then? I think it's plain to see I don't understand what's going on. Could you provide more comprehensive explanation please? Also, you say we're using the wrong |
I guess the data is dropped because the corresponding packages do not exist. The "comps" data is like the "primary" data, you can't load it as extension as it contains packages. A repo consists of packages with dependencies plus one or more repodata areas that are supposed to extend existing packages (solvables in libsolv speech). It's different for updateinfo, because here updates are not represented as packages. This could have been done for the comps data as well, but libsolv didn't do that because the idea at that time was to include comps in the package solving process. I.e. you could ask the solver to install a comps group. |
OTOH you can make this work with loading the comps file as a pseudo extension. But you need to use repo_write for writing and you need to limit the solvables to the corresponding comps range. |
(I.e. use the repowriter_set_solvablerange() function) |
Oh wait, I confused updateinfo with deltainfo. So it is the same as with updateinfo, where "patch:XXX" pseudo packages get created. |
See the special casing of updateinfo in your SolvRepo::write_ext function. Note that it also calls repo_write, not repodata_write. You really should switch to a repowriter here, that code is a horrible hack. And that main_end/main_nsolvables doesn't work if you have both comps and updateinfo data. |
Thanks, yes, I'm trying to wrap my head around this and I'm looking at the updateinfo handling, it's ugly already and would get much worse with comps as another special case. |
Why is the updateinfo/comps data stored as extension? |
So how would I do this with the repowriter that would work for both updateinfo and comps. After loading each of those, I could store EDIT: That seems what |
For comps I just did it in ignorance analogous to the other extensions. For updateinfo it's the way it's been done, I'm not sure anyone on the team currently knows any more details. For dnf 5 we'll certainly welcome any simplification. Are you questioning why they have their own |
@mlschroe you're leaving me hanging. I've made some meager attempts in the meanwhile here: https://github.com/lukash/libdnf/commit/a8fe1af11cebc2667d6c6cfdfeae9873f5559f5e But it's not doing what I expect it to be doing. I'd rather prefer not to spend hours or days with trial and error or analyzing libsolv sources. Given there's no documentation, please kindly provide me with enough information to solve this effectively. |
That commit looks good to me, what exactly does not work? Just use dump_solv on the written solv file to check if the written data is missing something or contains excess data. For updateinfo writing I would also limit the repodata range to the updateinfo repodata, otherwise you might get things like the deltarpm data. And you also should set updateinfo_solvables_start/end when loading the updateinfo from the solv file. |
On a simple test repo it seems to be including the main solvables in the solv dump: original code solv dump
my commit solv dump
However when I run it on fedora-updates, the resulting solv file is actually a bit smaller with my commit (11MB vs 13MB), so there seems to be more to it. The dumps of these files have over a million lines, I haven't been able to make any sense of it yet. |
Seems like updateinfo_solvables_start and updateinfo_solvables_end are incorrect or not set when you call repowriter_set_solvablerange. Can you please add a debug statement to verify this? |
I've already checked that, I have that log message there (in the commit it's at the time of loading the data, but I did add one right before the call as well), it says:
Which seems correct. Should I come up with a standalone reproducer? |
That doesn't seem correct. Package 3 is "pkg-libs" (the second package in the primary.xml), not the first package from the updateinfo. The correct range would be 5-9. |
Oh, it's because you use
|
Well that was a stupid mistake. Sorry about that and thanks for noticing. I also had to limit the repodata to just the updateinfo as you've mentioned, otherwise I was getting some more data in the solv file, but now the results are identical for both the test repo and fedora-updates. Again, thanks! |
@mlschroe I think I managed to completely remove the hackish way in which we were limiting the solvables for writing the cache files, I've posted a PR: rpm-software-management/libdnf#1471 The comps are now also loading properly. I'd be grateful if you skimmed through to see if there's still anything out of place. Thank you! |
Looks good to me! |
Great, thanks for the help! Closing. |
Minimal test case:
comps.xml
:dump.c
:Loads the
comps.xml
into a Pool, writes a.solv
file and also dumps a testcase for inspection. The testcase contains some data for the group but it seems to be completely missing at least the translations and probably other data is missing too.load.c
:Loads the written
solv.solv
and again dumps the testcase, in this case the testcase is almost empty.All the files tarballed: comps.tar.gz
The text was updated successfully, but these errors were encountered: