]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: allow specifying a custom "tag" for the private shared libaries
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 14 Dec 2021 17:03:06 +0000 (18:03 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 25 Dec 2021 06:18:50 +0000 (15:18 +0900)
We have /usr/lib/systemd/libsystemd-{shared,core}-nnn.so. With this
path the 'nnn' part can be changed to something different. The idea
is that during a package build this will be set to the package version.

This way during in-place upgrades with the same major version both
the new and old libraries can cooexit. This should fix the issue
when systemd programs are called during package upgrades and fail
to exec because the expect different symbols in the library they
are linked to.

This should fix https://bugzilla.redhat.com/show_bug.cgi?id=1906010.

meson.build
meson_options.txt
src/core/meson.build
src/shared/meson.build

index 146c95a478fd64aa3f30bb38626c9276e6c2e5a1..ef9a0278c975ec1b95abb127e9202eefeb9a015a 100644 (file)
@@ -599,6 +599,11 @@ endif
 
 versiondep = declare_dependency(sources: version_h)
 
+shared_lib_tag = get_option('shared-lib-tag')
+if shared_lib_tag == ''
+        shared_lib_tag = meson.project_version()
+endif
+
 sh = find_program('sh')
 echo = find_program('echo')
 sed = find_program('sed')
@@ -3902,6 +3907,7 @@ summary({
         'D-Bus system directory' :          dbussystemservicedir,
         'bash completions directory' :      bashcompletiondir,
         'zsh completions directory' :       zshcompletiondir,
+        'private shared lib version tag' :  shared_lib_tag,
         'extra start script' :              get_option('rc-local'),
         'debug shell' :                     '@0@ @ @1@'.format(get_option('debug-shell'),
                                                                get_option('debug-tty')),
index 401f0933d731639ad6185fddf438e4f86861e9da..23691fb49861ab5e538569c809c1c5b4647ace49 100644 (file)
@@ -3,6 +3,8 @@
 
 option('version-tag', type : 'string',
        description : 'override the git version string')
+option('shared-lib-tag', type : 'string',
+       description : 'override the private shared library version tag (defaults to project version)')
 
 option('mode', type : 'combo', choices : ['developer', 'release'],
        description : 'autoenable features suitable for systemd development/release builds')
index 87456712131507b66a3bf2781adc18ee11dbb320..fd15a7fbefd591736e7072b90e1a2cb041a5b187 100644 (file)
@@ -167,7 +167,7 @@ load_fragment_gperf_nulstr_c = custom_target(
         command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
         capture : true)
 
-libcore_name = 'systemd-core-@0@'.format(meson.project_version())
+libcore_name = 'systemd-core-@0@'.format(shared_lib_tag)
 
 libcore = shared_library(
         libcore_name,
index c2e02339746e1543afd153fb07ad97af496cc411..f58d623f4a11184bd11088a4dcb083ee0157f12a 100644 (file)
@@ -430,7 +430,7 @@ target2 = custom_target(
 shared_generated_gperf_headers = [target1, target2]
 shared_sources += shared_generated_gperf_headers
 
-libshared_name = 'systemd-shared-@0@'.format(meson.project_version())
+libshared_name = 'systemd-shared-@0@'.format(shared_lib_tag)
 
 libshared_deps = [threads,
                   libacl,