#1551 Linking GPRbuild statically
Closed None Opened 8 years ago by rombobeorn.

= phenomenon =
GPRbuild has a build-time dependency on itself, and uses libraries whose sonames change regularly. In Koji the only practical way of handling this situation is to link GPRbuild statically.

= reason =
GPRbuild is a build tool. Originally it was built with other tools, but the latest version is built with GPRbuild, so the package now has a BuildRequires dependency on itself. GPRbuild is linked to XMLada, and both GPRbuild and XMLada are linked to libgnat, as are all other Ada programs and libraries.

With every major GCC upgrade the soname of libgnat changes, and the previous version of libgnat immediately becomes unavailable in Koji, which causes all dynamically linked Ada programs and libraries to stop working until they get rebuilt. Every XMLada upgrade also brings a soname change that would break a dynamically linked GPRbuild until it got rebuilt. But rebuilding requires a working GPRbuild.

If the breakage is to be worked around using shared libraries, then compatibility libraries must be provided until the rebuild is done. Either the GCC and XMLada packages must temporarily contain two versions of the source tarball and build them both, which would complicate the spec a lot, or else separate compatibility packages of GCC and XMLada must be made, which would require a review process every time.

First the old version of libgnat must be provided for GPRbuild to load when it runs. Then XMLada must be rebuilt and linked to the new libgnat before GPRbuild can be rebuilt. Therefore a compatibility instance of XMLada must be provided – the same XMLada verion but linked to the old libgnat, because otherwise both versions of libgnat would be loaded into GPRbuild the next time it runs.

For that to be possible, the compatibility version of libgnat must include not only the binary library, but also the old version of the entire content of libgnat-devel, so that the compatibility instance of XMLada can be compiled. That in turn means that the old version of the compiler itself must be provided, because GNAT performs consistency checks and won't link code compiled with one version of GNAT to a library compiled with another version of GNAT.

All together this would be an enormous amount of trouble, and much of it would befall the GCC maintainer.

There would be much less of a problem if the existing packages would remain available until the rebuild is done, but that is apparently not possible in Koji.

Linking GPRbuild statically to libgnat and XMLada resolves the problem completely, as GPRbuild then remains functional when libraries are upgraded, and can rebuild the other packages and itself.

= recommendation =
Given the analysis above, I ask Fesco to formally recognize that linking GPRbuild statically is the only solution that is even close to practical, given the limitations of Koji.


#1551 Linking GPRbuild statically (number80, 17:11:58)
* AGREED: gprbuild is allowed to link statically (+1: 6, 0:0, -1:0)
(number80, 17:22:37)

We need to update the wiki though

has wiki page updated for this ticket? May I know which existing page is supposed to be updated?

Thanks Kevin for the update.

Login to comment on this ticket.

Metadata