[systemd-devel] providing backwards compatibility

Kay Sievers kay at vrfy.org
Fri Jan 17 00:18:49 PST 2014


On Fri, Jan 17, 2014 at 4:06 AM, Zbigniew Jędrzejewski-Szmek
<zbyszek at in.waw.pl> wrote:

> So there's "binary" compatibility, and "source" compatibility.
> It would be nice if we could do those changes without
>
> a) requiring recompilation ("binary")
> b) requiring editing build scripts in dependent packages ("source").
>
> For b, keeping around a .pc file which points to the *new* library
> name should be enough:
>
> - Libs: -L${libdir} -lsystemd-login
> + Libs: -L${libdir} -lsystemd
>
> On our side it's a tiny effort, and avoid a major PITA for distributions.

No, it will clash with the files from the old lib package. We should
not do that, if we no longer provide the same lib.

> For a, a compatibility symlink (e.g. libsystemd-login.so.0 -> libsystemd.so.0)
> can be provided. I'm attaching a POC patch which moves the symbol exports
> so that programs compiled against libsystemd-login will continue working.
> The symlink is not created, this part must be done by hand.
>
> I think that if we ever decide to futher merge libraries, those
> would be the steps to take.

Same here, it creates clashes with the old files and is not strictly
what it pretends to be with the symlink name.

>> Could we not provide a libsystemd-daemon.so.0 that is just a stub and
>> links to libsystemd.so.X and just calls the functions therein? That way
>> the API could still be provided with the old lib (and old .pc files too)
>> until such times as everything is updated. I would presume the name
>> mangling would allow for this to work OK with some clever tricks here
>> and there... (correctly me if I'm wrong)
> Yes, I think that's the way to go.
>
>> This would surely be the nicest way to handle things during any
>> transition phase and could be turned off with a configure switch?

What are we trying to solve here? This is the job of the distro, it is
what it is there for. The distro either leaves the old lib around as
long as needed, or it re-compiles the users to use the new one.

Please do not mix code (upstream) and system composition
(distribution) too much here. It's all really the same model as an
SONAME bump, something that happens every day.

Thanks,
Kay


More information about the systemd-devel mailing list