-
Notifications
You must be signed in to change notification settings - Fork 143
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
DnfContext: make dnf_context_module_install like dnf module install
#1207
DnfContext: make dnf_context_module_install like dnf module install
#1207
Conversation
I can split this further into separate PRs if desired. |
If the overall approach looks sane, I can work on adding tests. |
fb28b70
to
27b34c9
Compare
dnf module install
Hmm, I'm trying to understand from the integration tests logs what part failed, but the output is quite large. In the tail of the output, I see:
And quickly grepping the results from the other behave tests, they all say |
@jlebon it's an occasional "infra" failure (of the overlay FS), you can search the logs for "OCI" to find it. Sorry about the inconvenience, it's hitting us quite often and I just can't seem to figure out what to do about it. I'll try to report to podman, but I don't have a reproducer outside of GitHub Actions. We could try to switch to docker... Also @martinpitt would you have any idea? I'll re-run the jobs for you (you can do it by clicking on the button in top right corner yourself), the failing action for future reference is here: https://github.com/rpm-software-management/libdnf/pull/1207/checks?check_run_id=2530538673 |
The re-run failed again with
I'm afraid I have no idea what |
Ahh yup, OK that error is a recent podman regression I think: containers/podman#10293 (I hit the same thing locally with my pet container after updating to https://bodhi.fedoraproject.org/updates/FEDORA-2021-fc15685f73). |
@martinpitt @jlebon I'm quite sure it's not containers/podman#10293, apparently you can get the "OCI not found" error message in multiple various cases, I've observed this (almost) from the beginning of using GitHub Actions, but somehow the frequency seems to be increasing. It's non-deterministic, sometimes it works, sometimes it happens once in the hundreds of Re-running again, off to attempt a podman bug report. |
Reported here: containers/podman#10321 |
@jlebon I will take a look in next days. |
I also suggest that module profile installed by C API will be impossible to remove by |
Prep for next patch.
A few things I wrote down to help find my way around the modularity code.
As a library, we need to be able to report errors directly to the application and not log it ourselves. Applications should take care of displaying the errors to users. Additionally, let's not log critical errors for things which are due to user-input, such as a non-existent module name. In rpm-ostree for example, we run enable `G_DEBUG=fatal-warnings` in some test scenarios to ensure that we don't trigger any warnings. This then causes rpm-ostree to crash if doing `rpm-ostree module install badname`. This patch changes things so that instead of logging errors, we concatenate them together and return them through the GError API. = changelog = msg: Improve error-reporting for modular functions type: bugfix
27b34c9
to
3ff36c8
Compare
Updated! I squashed some of the commits together to make review easier. I didn't rebase it so you can use the inter-diff to see what changed.
Can you expand on this? I think I understand what you mean, but I couldn't find in the code what marks a module's install reason. Worth noting that in rpm-ostree at least, we always re-assemble the rootfs from scratch, so there isn't a need to remove modules the same way: we just stop adding it in the new rootfs (we do support removing base packages, but to do that at the modular level would first require fixing #1207 (comment); until then, just removing the modular RPMs directly should work fine). Obviously, I do want this code to be leveraged by |
@jlebon I suggest that the PR looks good to me. It enhance behaviour of
The difference is that dnf module install commands shares implementation with To investigate stored reasons you can use |
We were copying the map and modifying the copy rather than the original. This caused issues in callers which assume that the argument passed was modified so that only a single stream was retained.
This significantly revamps `dnf_context_module_install`. It fixes some issues noticed during review, but also aligns the logic closer to what `dnf module install` does.
3ff36c8
to
6d9b1ad
Compare
Thanks, I've added some tests to this now so this is ready to go! And doing that uncovered a bug. 🎉 Split that out as a separate commit. |
This significantly revamps
dnf_context_module_install
. It fixes someissues noticed during review, but also aligns the logic closer to what
dnf module install
does.