Search code examples
dependenciesrpmrpm-spec

If I update an RPM, do I have to rebuild all RPMs that are based on it


we have a series or RPMs that we build as part of our project with some being dependent on others. Say I have 3 RPMs A.rpm, B.rpm and C.RPM where both B and C depend on A, do I need to rebuild both everytime I update A? If I add a new feature to A to support a feature in B, but the code that is built to generate C has no idea about the new feature. Do I need to rebuild C against the updated A?

Or closer to my actual situation, I have an a library RPM that has about 25 RPMs that depend on it. We've added a new feature to the library to support an update in 1 of the RPMs, do I need to rebuild all other 24 RPMs?

Thanks in advance.


Solution

  • Yes and no. There are two kind of dependencies: generated and implicit ones.

    If you speak about C libraries, then rpmbuild generate dependencies like this:

    $ rpm -R bash
    ...
    libdl.so.2()(64bit)
    ...
    

    And when the package which provides this library is updated, but it keeps the same SONAME, i.e., the same binary interface, then you do not need to rebuild the package which use it (in this example bash). But when there is SONAME bump and the package suddenly provides libdl.so.3, then you have to rebuild the package which requires it.

    If the dependencies are something else, then you do not need to rebuild the package. For example package firefox requires bash, but it is fine with any version. So when bash is being updated, you do not need to rebuild firefox.

    Sometime it happens that you depend on something (python-2.x) and it got very major upgrade (python-3.x), then you need to rebuild the package which requires it. In these rare cases you usually know about it in advance as you have to not only rebuild the package but rewrite the code of the application itself. E.g. migration from python2 to python3 is non-trivial.

    Quick'n'dirty tip for most case scenarios: unless DNF/YUM tell you that you have broken dependencies, you do not need to rebuild your package.