Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

vmcj
Copy link
Member

@vmcj vmcj commented Nov 20, 2023

I think there is a bit of refactoring which can be done, it feels like we test for this twice.

@vmcj vmcj marked this pull request as draft November 20, 2023 14:13
@vmcj vmcj requested a review from eldering November 20, 2023 14:28
@vmcj vmcj marked this pull request as ready for review November 20, 2023 14:28
@@ -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
Copy link
Member

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?

Copy link
Member Author

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:

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"],
Copy link
Member

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?

Copy link
Member Author

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?

@eldering
Copy link
Member

Closed in favor of fixing it along the lines of #2086

@eldering eldering closed this Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants