-
Notifications
You must be signed in to change notification settings - Fork 262
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
Fail when pkg-config can't find the systemd lib directory #2220
Conversation
@@ -225,8 +225,9 @@ AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitd | |||
AS_IF([test "x$PKG_CONFIG" = "x"],AC_MSG_ERROR([systemd support requested but no pkg-config available to query systemd package])) | |||
def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) | |||
|
|||
# TODO: This seems to fail when systemd is not installed so pkg-config can't find the variable, we don't error out there |
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.
This comment is not really clear to me: are we currently not erroring out or should we not be?
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.
The comment can be removed as I tried to fix this with this PR.
In the case that systemd
is not installed but pkg-config
is:
- pkg-config will try to get the value here: https://github.com/DOMjudge/domjudge/pull/2220/files#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810R226 but can't as systemd is not there, so not package specification can give the variable
systemdsystemunitdir
. - We should fail, but we don't. I think because an empty string is stored and we don't fail on the non-zero exit code.
Next in the code:
AS_IF([test "x$def_systemdsystemunitdir" = "x"]
will be true as the variable is empty. I copied the solution from here: https://github.com/DOMjudge/domjudge/pull/2220/files#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810R224 but I'm not 100% if we can't rewrite this to make more sense, I think the auto is set here https://github.com/DOMjudge/domjudge/pull/2220/files#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810R224 but I'm not sure where the case for with_systemdsystemunitdir=yes
would be set.
AS_IF([test "x$def_systemdsystemunitdir" = "x"], | ||
[AS_IF([test "x$with_systemdsystemunitdir" = "xyes"], | ||
[AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], |
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.
How is the value yes
now different from auto
?
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.
I have no idea, I copied this check from earlier and I think the test "x$with_systemdsystemunitdir" = "xyes
might need to be removed?
Closed in favor of fixing it along the lines of #2086 |
I think there is a bit of refactoring which can be done, it feels like we test for this twice.