package/systemd: link host systemd utilities statically
PATCH 1/1 package/systemd: link host systemd utilities statically
This makes it less likely that we will run into missing library errors when running host systemd utilities and lets us remove the HOST_SYSTEMD_FIX_RPATH hack.
--- .../fakeroot_tmpfiles.sh | 2 +- .../skeleton-init-systemd.mk | 2 +- package/systemd/systemd.mk | 30 +++++++------------ 3 files changed, 13 insertions(+), 21 deletions(-)
package/skeleton-init-systemd/fakeroot_tmpfiles.sh +1 -1
@@ -25,7 +25,7 @@ # [1] - https://github.com/systemd/systemd/pull/16187 [ -n "${HOST_SYSTEMD_TMPFILES-}" ] || - HOST_SYSTEMD_TMPFILES=systemd-tmpfiles + HOST_SYSTEMD_TMPFILES=systemd-tmpfiles.standalone [ -n "${1-}" -a -d "${1-}"/usr/lib/tmpfiles.d ] || { echo 1>&2 "$0: need ROOTFS argument"; exit 1; }
package/skeleton-init-systemd/skeleton-init-systemd.mk +1 -1
@@ -80,7 +80,7 @@ endif # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW ifeq ($(BR2_INIT_SYSTEMD_POPULATE_TMPFILES),y) define SKELETON_INIT_SYSTEMD_CREATE_TMPFILES_HOOK - HOST_SYSTEMD_TMPFILES=$(HOST_DIR)/bin/systemd-tmpfiles \ + HOST_SYSTEMD_TMPFILES=$(HOST_DIR)/bin/systemd-tmpfiles.standalone \ $(SKELETON_INIT_SYSTEMD_PKGDIR)/fakeroot_tmpfiles.sh $(TARGET_DIR) endef SKELETON_INIT_SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SKELETON_INIT_SYSTEMD_CREATE_TMPFILES_HOOK
package/systemd/systemd.mk +11 -19
@@ -899,6 +899,17 @@ endef # We need a very minimal host variant, so we disable as much as possible. HOST_SYSTEMD_CONF_OPTS = \ -Dsplit-bin=true \ + -Dlink-udev-shared=false \ + -Dlink-executor-shared=false \ + -Dlink-systemctl-shared=false \ + -Dlink-networkd-shared=false \ + -Dlink-timesyncd-shared=false \ + -Dlink-journalctl-shared=false \ + -Dlink-boot-shared=false \ + -Dlink-portabled-shared=false \ + -Dstatic-libsystemd=true \ + -Dstatic-libudev=true \ + -Dstandalone-binaries=true \ --prefix=/usr \ --libdir=lib \ --sysconfdir=/etc \
@@ -1022,24 +1033,5 @@ HOST_SYSTEMD_DEPENDENCIES = \ HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR) -# Fix RPATH After installation -# * systemd provides a install_rpath instruction to meson because the binaries -# need to link with libsystemd which is not in a standard path -# * meson can only replace the RPATH, not append to it -# * the original rpath is thus lost. -# * the original path had been tweaked by buildroot via LDFLAGS to add -# $(HOST_DIR)/lib -# * thus re-tweak rpath after the installation for all binaries that need it -HOST_SYSTEMD_HOST_TOOLS = busctl journalctl systemctl systemd-* udevadm - -define HOST_SYSTEMD_FIX_RPATH - for f in $(addprefix $(HOST_DIR)/bin/,$(HOST_SYSTEMD_HOST_TOOLS)); do \ - [ -e $$f ] || continue; \ - $(HOST_DIR)/bin/patchelf --set-rpath $(HOST_DIR)/lib:$(HOST_DIR)/lib/systemd $${f} \ - || exit 1; \ - done -endef -HOST_SYSTEMD_POST_INSTALL_HOOKS += HOST_SYSTEMD_FIX_RPATH - $(eval $(meson-package)) $(eval $(host-meson-package))
Signature · 6 lines
2.34.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
James, All,
On 2024-09-10 13:36 -0600, James Hilliard spake thusly:
Quoted 2 lines
This makes it less likely that we will run into missing library errors when running host systemd utilities
What error exactly are you trying to fix here?
Why does it happen only now?
Stating "less likekely" implies that it is not systematic, so there are conditions that trigger it. What conditions would tht be, so we can try and reproduce the issue?
While "missing libraries" is atually an issue, what library are missing? Why are they missing?
These are critical information that must be present in the commit log.
Let me guess. You are hitting the same issue as reported there:
https://gitlab.com/buildroot.org/buildroot/-/issues/39
If so, then I think your patch is just hidding the dust under the rug.
Indeed, it is possible that other packages suffer from the same issue, and we certainly do not want to build all such packages statically.
Instead, we want to fix the rpath fixups (he! fix the fixups!).
Regards,
Yann E. MORIN.
Quoted 86 lines
and lets us remove the
HOST_SYSTEMD_FIX_RPATHhack.Signed-off-by James Hilliard <[email protected]>--- .../fakeroot_tmpfiles.sh | 2 +- .../skeleton-init-systemd.mk | 2 +- package/systemd/systemd.mk | 30 +++++++------------ 3 files changed, 13 insertions(+), 21 deletions(-)package/skeleton-init-systemd/fakeroot_tmpfiles.sh +1
-1@@ -25,7 +25,7 @@ # [1] - https://github.com/systemd/systemd/pull/16187 [ -n "${HOST_SYSTEMD_TMPFILES-}" ] || - HOST_SYSTEMD_TMPFILES=systemd-tmpfiles + HOST_SYSTEMD_TMPFILES=systemd-tmpfiles.standalone [ -n "${1-}" -a -d "${1-}"/usr/lib/tmpfiles.d ] || { echo 1>&2 "$0: need ROOTFS argument"; exit 1; }package/skeleton-init-systemd/skeleton-init-systemd.mk +1
-1@@ -80,7 +80,7 @@ endif # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW ifeq ($(BR2_INIT_SYSTEMD_POPULATE_TMPFILES),y) define SKELETON_INIT_SYSTEMD_CREATE_TMPFILES_HOOK - HOST_SYSTEMD_TMPFILES=$(HOST_DIR)/bin/systemd-tmpfiles \ + HOST_SYSTEMD_TMPFILES=$(HOST_DIR)/bin/systemd-tmpfiles.standalone \ $(SKELETON_INIT_SYSTEMD_PKGDIR)/fakeroot_tmpfiles.sh $(TARGET_DIR) endef SKELETON_INIT_SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SKELETON_INIT_SYSTEMD_CREATE_TMPFILES_HOOKpackage/systemd/systemd.mk +11
-19@@ -899,6 +899,17 @@ endef # We need a very minimal host variant, so we disable as much as possible. HOST_SYSTEMD_CONF_OPTS = \ -Dsplit-bin=true \ + -Dlink-udev-shared=false \ + -Dlink-executor-shared=false \ + -Dlink-systemctl-shared=false \ + -Dlink-networkd-shared=false \ + -Dlink-timesyncd-shared=false \ + -Dlink-journalctl-shared=false \ + -Dlink-boot-shared=false \ + -Dlink-portabled-shared=false \ + -Dstatic-libsystemd=true \ + -Dstatic-libudev=true \ + -Dstandalone-binaries=true \ --prefix=/usr \ --libdir=lib \ --sysconfdir=/etc \@@ -1022,24 +1033,5 @@ HOST_SYSTEMD_DEPENDENCIES = \ HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR) -# Fix RPATH After installation -# * systemd provides a install_rpath instruction to meson because the binaries -# need to link with libsystemd which is not in a standard path -# * meson can only replace the RPATH, not append to it -# * the original rpath is thus lost. -# * the original path had been tweaked by buildroot via LDFLAGS to add -# $(HOST_DIR)/lib -# * thus re-tweak rpath after the installation for all binaries that need it -HOST_SYSTEMD_HOST_TOOLS = busctl journalctl systemctl systemd-* udevadm - -define HOST_SYSTEMD_FIX_RPATH - for f in $(addprefix $(HOST_DIR)/bin/,$(HOST_SYSTEMD_HOST_TOOLS)); do \ - [ -e $$f ] || continue; \ - $(HOST_DIR)/bin/patchelf --set-rpath $(HOST_DIR)/lib:$(HOST_DIR)/lib/systemd $${f} \ - || exit 1; \ - done -endef -HOST_SYSTEMD_POST_INSTALL_HOOKS += HOST_SYSTEMD_FIX_RPATH - $(eval $(meson-package)) $(eval $(host-meson-package))Signature · 1 line
2.34.1
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 14 lines · Yann E. MORIN
James, All,
On 2024-09-10 13:36 -0600, James Hilliard spake thusly:
Quoted 2 lines
This makes it less likely that we will run into missing library errors when running host systemd utilities
What error exactly are you trying to fix here?
Why does it happen only now?Stating "less likekely" implies that it is not systematic, so there are conditions that trigger it. What conditions would tht be, so we can try and reproduce the issue?
Quoted 7 lines
While "missing libraries" is atually an issue, what library are missing? Why are they missing?
These are critical information that must be present in the commit log.
Let me guess. You are hitting the same issue as reported there:
https://gitlab.com/buildroot.org/buildroot/-/issues/39
Yeah, looks like the same issue, I hadn't really isolated it fully but had seen issues related to this in the past when working on a different patch series involving using meson's native install.
Quoted 5 lines
If so, then I think your patch is just hidding the dust under the rug.
Indeed, it is possible that other packages suffer from the same issue, and we certainly do not want to build all such packages statically.
I thought this was generally only affecting systemd.
Quoted 95 lines
Instead, we want to fix the rpath fixups (he! fix the fixups!).
Regards,
Yann E. MORIN.Quoted 84 lines
and lets us remove the
HOST_SYSTEMD_FIX_RPATHhack.Signed-off-by James Hilliard <[email protected]>--- .../fakeroot_tmpfiles.sh | 2 +- .../skeleton-init-systemd.mk | 2 +- package/systemd/systemd.mk | 30 +++++++------------ 3 files changed, 13 insertions(+), 21 deletions(-)package/skeleton-init-systemd/fakeroot_tmpfiles.sh +1
-1@@ -25,7 +25,7 @@ # [1] - https://github.com/systemd/systemd/pull/16187 [ -n "${HOST_SYSTEMD_TMPFILES-}" ] || - HOST_SYSTEMD_TMPFILES=systemd-tmpfiles + HOST_SYSTEMD_TMPFILES=systemd-tmpfiles.standalone [ -n "${1-}" -a -d "${1-}"/usr/lib/tmpfiles.d ] || { echo 1>&2 "$0: need ROOTFS argument"; exit 1; }package/skeleton-init-systemd/skeleton-init-systemd.mk +1
-1@@ -80,7 +80,7 @@ endif # BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW ifeq ($(BR2_INIT_SYSTEMD_POPULATE_TMPFILES),y) define SKELETON_INIT_SYSTEMD_CREATE_TMPFILES_HOOK - HOST_SYSTEMD_TMPFILES=$(HOST_DIR)/bin/systemd-tmpfiles \ + HOST_SYSTEMD_TMPFILES=$(HOST_DIR)/bin/systemd-tmpfiles.standalone \ $(SKELETON_INIT_SYSTEMD_PKGDIR)/fakeroot_tmpfiles.sh $(TARGET_DIR) endef SKELETON_INIT_SYSTEMD_ROOTFS_PRE_CMD_HOOKS += SKELETON_INIT_SYSTEMD_CREATE_TMPFILES_HOOKpackage/systemd/systemd.mk +11
-20@@ -899,6 +899,17 @@ endef # We need a very minimal host variant, so we disable as much as possible. HOST_SYSTEMD_CONF_OPTS = \ -Dsplit-bin=true \ + -Dlink-udev-shared=false \ + -Dlink-executor-shared=false \ + -Dlink-systemctl-shared=false \ + -Dlink-networkd-shared=false \ + -Dlink-timesyncd-shared=false \ + -Dlink-journalctl-shared=false \ + -Dlink-boot-shared=false \ + -Dlink-portabled-shared=false \ + -Dstatic-libsystemd=true \ + -Dstatic-libudev=true \ + -Dstandalone-binaries=true \ --prefix=/usr \ --libdir=lib \ --sysconfdir=/etc \@@ -1022,24 +1033,5 @@ HOST_SYSTEMD_DEPENDENCIES = \ HOST_SYSTEMD_NINJA_ENV = DESTDIR=$(HOST_DIR) -# Fix RPATH After installation -# * systemd provides a install_rpath instruction to meson because the binaries -# need to link with libsystemd which is not in a standard path -# * meson can only replace the RPATH, not append to it -# * the original rpath is thus lost. -# * the original path had been tweaked by buildroot via LDFLAGS to add -# $(HOST_DIR)/lib -# * thus re-tweak rpath after the installation for all binaries that need it -HOST_SYSTEMD_HOST_TOOLS = busctl journalctl systemctl systemd-* udevadm - -define HOST_SYSTEMD_FIX_RPATH - for f in $(addprefix $(HOST_DIR)/bin/,$(HOST_SYSTEMD_HOST_TOOLS)); do \ - [ -e $$f ] || continue; \ - $(HOST_DIR)/bin/patchelf --set-rpath $(HOST_DIR)/lib:$(HOST_DIR)/lib/systemd $${f} \ - || exit 1; \ - done -endef -HOST_SYSTEMD_POST_INSTALL_HOOKS += HOST_SYSTEMD_FIX_RPATH - $(eval $(meson-package)) $(eval $(host-meson-package)) --Quoted 2 lines
2.34.1
--
.-----------------.--------------------.------------------.--------------------.
Quoted 5 lines
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
James, All,
On 2024-09-11 11:07 -0600, James Hilliard spake thusly:
Quoted 5 lines · Yann E. MORIN
Quoted 4 lines
On 2024-09-10 13:36 -0600, James Hilliard spake thusly:
Quoted 2 lines
This makes it less likely that we will run into missing library errors when running host systemd utilities
What error exactly are you trying to fix here?
[--SNIP--]
Quoted 5 lines
Quoted 2 lines
Let me guess. You are hitting the same issue as reported there:
https://gitlab.com/buildroot.org/buildroot/-/issues/39Yeah, looks like the same issue, I hadn't really isolated it fully but had seen issues related to this in the past when working on a different patch series involving using meson's native install.
It would be good indeed if at some point we could get rid of our RPATH hack in host-systemd. However, please review the commit log for 35c11a027c88 (package/systemd: add host variant) that explains at length why we are doing it.
Quoted 4 lines
Quoted 3 lines
If so, then I think your patch is just hidding the dust under the rug. Indeed, it is possible that other packages suffer from the same issue, and we certainly do not want to build all such packages statically.
I thought this was generally only affecting systemd.
Even if currently affects only systemd, the issue is really generic,and I have sent a patch to actually fix the root cause;
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
Regards,
Yann E. MORIN.
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot