Describe the bug
If the package pkg-config is not installed in the system, the build process silently builds redis without systemd support even though it would be available.
If one explicitly sets USE_SYSTEMD=yes and pkg-config is not available, then the build script says that libsystemd could not be found which is very confusing when knowing it actually is there.
To reproduce
run make on a Ubuntu-based system without pkg-config installed
Expected behavior
throw error that pkg-config is not installed
On top of that, what probably is covered by #8036, when running redis not built with systemd, it's not clear this is causing issues when still trying to use it with systemd. There is no indication in the log about this.
(I wasted a lot of time because I was following my own guide I previously made for redis installation on different system where it worked fine with systemd. So figuring out the issue happened at built time due to missing pkg-config and is not a config issue wasn't very obvious.)
Additional information
Lubuntu 20.04 redis 6.0.9
Comment From: yossigo
Hi @kienerj, this behavior is intentional as libsystemd is an opt-in dependency. If you want to be sure Redis builds with systemd support or fails - use USE_SYSTEMD=yes explicitly.
Comment From: kienerj
Hi @kienerj, this behavior is intentional as
libsystemdis an opt-in dependency. If you want to be sure Redis builds with systemd support or fails - useUSE_SYSTEMD=yesexplicitly.
Yes but read my full report.
With USE_SYSTEMD=yes set, the script throws an error that libsystemd could not be found. This is the confusing part because it is there and the actual error should probably be that pkg-config is missing and hence can't be determined if libsystemd is available.
It's a bit ironic that a check is made if libsystemd is available using a package with might itself not be available. (it isn't there by default on Ubuntu 20.04). Hope this clears this up.
Comment From: yossigo
@kienerj Thanks for clarifying that. I agree there's no point in requiring pkg-config for USE_SYSTEMD=yes and this should be streamlined to how other conditional dependencies are handled.