-
Notifications
You must be signed in to change notification settings - Fork 176
Add logic for rebuilding modules when dependencies change #515
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
Conversation
|
@anbe42 before proceeding with implementing the tests, the |
|
Simplified a bit the versions in the example. |
|
I need a bit time to think about that ... so here are just some things that came into my mind while brainstorming about it. First of all, that reminds me of #406, although I was looking at the orthogonal dimension: rebuild all modules (for a single kernel) if the kernel headers change (but $kernelver does not change). The problem you want to solve effectively means we need to rebuild multiple modules for multiple kernels... I have no idea what this means in the context of modules with multiple versions installed concurrently. That is a concept "we do not use" in Debian. If something is going to introduce a circular dependency, can we detect and reject that at |
I'm not sure I understand. I fail to find a use case for modules with multiple versions installed concurrently, I also never saw it in the RHEL world. The whole reasoning behind this, is to have the opportunity to rebuild
That's actually a good idea. Since I don't see any particular objections on the general idea behind this, I'll fix the current tests, add more tests and then |
|
There is also #499 that still needs to be investigated ... Let's for now assume we only have simple dependency graphs out in the wild (only short linear lists, no trees or dags), but still have the code ready for general graphs. For complicated graphs I'm afraid I'measily able to come up with command orders where things break. Right now when upgrading a module A, we unbuild that (which may make module B with BUILD_DEPENDS=A temporarily unbuildable), so if the package manager triggers building B, we may run into failures ... When rebuilding modules, we should preserve the original state they were in: added/built/installed. |
Good. Lets try not to break this functionality, without trying to understand the need for it ;-) |
That sounds interesting. How do you plan to model this dependency, since the driver (which contains -peermem) has no dependencies yet? Currently it builds a a dummy -peermem module if the mellanox bits are missing from the kernel (and in Debian we have a patch which at least says so when attempting to load the module). Right now this sounds more like you need an "Enhances" (a package relationship supported by the .deb format, roughly a reverse Recommends). Or an OPTIONAL_BUILD_DEPENDS which does no harm when missing, but can cause rebuilds when available ... |
Never happened to me, so I can't comment.
You mean when the package manager updates both packages? The RPM scriptlets and the i-don't-know-the-correct-name in the deb packages get executed anyway in sequence, so at the worst case the module is built two times. Or am I missing something?
Interesting. Never thought of the use case of having a module just "added" on the system. In my mind that's just an interim state because you want to have the modules installed, otherwise you would not be fiddling with DKMS packages at all. |
I don't think we need all of this. What I was actually thinking is way simpler, in that particular case (which seems to be only the DGX stations from NVIDIA so far), it's up to the admin (or the DGX iso installer) to add the dependencies. The point of the extra Example: Custom per-installation configuration is actually already happening for a few other modules that have different parameters for building depending on the context. |
You have one example with a flat single |
|
Another completely different approach would be an installation specific script that is pulled in by DKMS in one of the various stages. This way nothing changes in DKMS but you can still achieve the same, I'll prototype that as well internally and see what's the best/cleaner approach. |
|
Another option would be to leave the logic in DKMS but make it happen by another toggle. ex. |
d61882c to
b6efa51
Compare
5cf8b84 to
96612d9
Compare
4bbf196 to
c69ec20
Compare
|
Added tests to check:
Now it will have a few days of testing in NVIDIA with various use cases before marking it ready for review. |
|
Btw, I'm open to rename |
c6660b0 to
529a2a8
Compare
|
Merging this. Added another safeguard when |
Force the rebuild of modules when
BUILD_DEPENDS_REBUILDis set and modules declared inBUILD_DEPENDSchange.When a module is updated, all modules that depend on it need to be automatically rebuilt in the correct order.
This is all gated through
BUILD_DEPENDS_REBUILD, which should be set on a per installation basis, for example:Whenever
<module1>is built andBUILD_DEPENDSis set, the version of the dependent module is saved in:In case this changes, a new function
check_and_rebuild_dependent_modules()that is called at the end ofdo_install()does the following:Makes a first pass to collect all modules that need to be rebuilt by:
BUILD_DEPENDSspecifiedThen it does a second pass to rebuild modules in dependency order by:
If the user runs a
build/installcommand with the--forceparameter for a module whereBUILD_DEPENDSandBUILD_DEPENDS_REBUILDare specified, the program will behave as before, bypassing the check and not saving the dependency in the file.Sample run: