-
-
Notifications
You must be signed in to change notification settings - Fork 60
Fix libsystemd auto-detection #774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Properly handle missing libsystemd when enable-systemd=auto, which is even the default for this switch. Without this, one had to explicitly give `--disable-systemd` despite the what the help text stated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An autotools test build on a systemd setup successfuly detected the presence of systemd, I don't have any non-systemd systems to test the absence of it on though,
Works for the systemd present case
@cwendling , I am fine with merging this if you had a succesful autotools build (we also have meson support) on a machine without systemd. Also OK with waiting for another review if you prefer. Please advise |
@lukefromdc thanks for the test. Though, if you want to test the non-systemd state, you simply need to remove the systemd development files, not systemd itself. IIRC on Debian & Ubuntu it's the |
removing libsystemd-dev did NOT work, I got
Cannot remove anything else for this test, remember this is a live system not a VM. I do not know if this means this doesn't work on a system with dbus and systemd with systemd not detected, or if this means it doesn't work on non-systemd distros. Testing other distros is not something I can do: no landline to download them over. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turning my approval to a comment due to the failed build with libsystemd-dev removed
@lukefromdc What is the distro you used? On my Debian Bookworm it clearly works: with $ ./configure
[…]
checking for libsystemd... no
checking for libsystemd >= 248... no
configure: error: Package requirements (libsystemd >= 248) were not met:
Package 'libsystemd', required by 'virtual:world', not found
[…] while with this patch I get: $ ./configure
[…]
checking for libsystemd >= 248... no
[…]
Configure summary:
mate-control-center 1.29.0
==========================
[…]
Systemd: no
[…] |
I am on a rather modified version of Debian Unstable
|
Hum… can you tell what depends on dbus-1? I can't seem to find a reference to it in the build system, and if I check the pkg-config result for dbus-1 I don't see any reference to libsystemd -- and if there is one in a newer version, it should have the associated dependency, if not that's a packaging issue. This said, what I tried to fix was the explicit and optional dependency on libsystemd we have, that could be disabled before my patch by explicitly asking for it. If there's indirect dependencies on it (e.g. through the dbus-1 pkg-config file), it's outside the scope of this PR, and I'm not interested in fighting those :) |
I don't really have an easy way to figure that out. I am basically not in position to provide effective support for the non-systemd case and I don't want to make changes to a running system that would prevent restarting if I get a crash |
Properly handle missing libsystemd when enable-systemd=auto, which is even the default for this switch.
Without this, one had to explicitly give
--disable-systemd
despite the what the help text stated.The reason is that
PKG_CHECK_MODULES()
errors-out if it is not given a 4th argument (action-is-not-found). The ideal solution for this is however to call with the right arguments depending on whether we want a hard or soft failure, because in case of hard failurePKG_CHECK_MODULES()
gives a more useful error message than what we would do ourselves.