-
Notifications
You must be signed in to change notification settings - Fork 1.3k
meson: Add build-lsfd option and make rt dependency optional #2879
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
Conversation
878c50d
to
24c9673
Compare
@t-8ch can you review, please? |
meson.build
Outdated
@@ -2711,19 +2717,20 @@ errnos_h = custom_target('errnos.h', | |||
command : ['tools/all_errnos', cc.cmd_array()] | |||
) | |||
|
|||
mq_libs = [] | |||
mq_libs += cc.find_library('rt', required : true) | |||
lib_rt = cc.find_library('rt', required : get_option('build-lsfd')) |
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 fails if librt is not present but also not needed. (Same as in current master)
Could you change this to reuse the results from the checks above?
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.
Because it doesn't check for it at all because it is using an option here. Got it.
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.
Alright, I have the cc.find_library
call happen in one place now instead of three. I used a require
call on the build-lsfd
feature option to require the rt library be found.
A dependency on the rt library is unnecessarily required when checking for the clock_gettime and timer_create functions. This causes the build to fail if the rt library is not found. This should not fail the build as rt is only required for the checks. Additionally, the lsfd executable and some tests require rt. There is currently no option to toggle building lsfd. This PR makes it possible to build without the rt library. Function checks no longer require rt for the build. The function checks for the rt library only run when rt is available. This PR adds an option to allow building without lsfd. This makes it possible to build without the executable that requires rt. To not require rt for the test, a additional check has been added. The effected tests won't be built unless rt has been found. Signed-off-by: Jordan Williams <jordan@jwillikers.com>
Require the rt library for the build-lsfd feature. Signed-off-by: Jordan Williams <jordan@jwillikers.com>
24c9673
to
2439502
Compare
@t-8ch I guess this one is ready to merge. Right? |
Merged, not sure why github see itr as unmerged,
|
It seems to be broken: https://www.githubstatus.com/ |
Interesting. Thanks for the reviews! |
@karelzak Would it be possible to backport this commit to the stable v2.40 branch? |
We can backport more meson-related things. It would be ideal to create a separate pull request and cherry-pick all important meson things for stable/v2.40. For .1 releases, I'm usually very open to changes :-) |
Got it, thanks! |
The cherry-pick of util-linux#2879 in PR util-linux#2941 to the stable/v2.40 branch didn't include the removal of mq_libs like it should have. I must have resolved a conflict incorrectly in the cherry-pick. This just removes the lingering definitions which are no longer used. The extra find_library call for rt is a problem. Signed-off-by: Jordan Williams <jordan@jwillikers.com>
A dependency on the rt library is unnecessarily required when checking for the
clock_gettime
andtimer_create
functions.This causes the build to fail if the rt library is not found. This should not fail the build as rt is only required for the checks. Additionally, the
lsfd
executable and some tests require rt. There is currently no option to toggle building lsfd.This PR makes it possible to build without the rt library. Function checks no longer require rt for the build. The function checks for the rt library only run when rt is available. This PR adds an option to allow building without lsfd. This makes it possible to build without the executable that requires rt. To not require rt for the test, an additional check has been added. The effected tests won't be built unless rt has been found.
Fixes #2878 and possibly #2874