Closed mokou closed 1 year ago
Rebuilding should be skipped only if there are no new modules.
Ah, is that the intention? I thought it was just to prevent ZNC from crashing at launch on an update.
To pick up new modules automaticaly? Yes, it's intended. Otherwise, adding modules would require writing a custom Dockerfile with something like this (pseudocode)
FROM znc
COPY foo.cpp
RUN znc-buildmod foo.cpp
It's still possible to do it this way with autobuilding modules, but not required.
I thought your reason for #16 is to optimize startup time in the common case when no modules were added. And that is a good optimization... Just not as implemented in this PR.
Note that znc-buildmod doesn't prevent crash on startup after upgrade:
Fortunately, ZNC doesn't crash on module version mismatch, because it compares version number of module and of itself, and a couple of other things before actually loading the module. See https://github.com/znc/znc/blob/2f4b158fd1d1c03eee5f73777bcb55b0d6c535b5/src/Modules.cpp#L1958-L1977 It's still possible to make it crash while loading a bad module, but not in the common case.
Right, that's the exact scenario that caused my ZNC to fail to start on the recent update from 1.7 to 1.7.1, so I'm not sure if that works for all modules. Either way I'll make the changes to this tomorrow.
Closes #16