Daniel P. Berrangé <berra...@redhat.com> wrote:
> On Fri, Mar 03, 2023 at 01:47:40PM +0100, Thomas Huth wrote:
>> On 01/03/2023 12.00, Juan Quintela wrote:
>> > Linux keyring support is protected by CONFIG_KEYUTILS.
>> > Use CONFIG_SECRET_KEYRING.
>> > 
>> > Signed-off-by: Juan Quintela <quint...@redhat.com>
>> > 
>> > ---
>> > 
>> > Previous version of this patch changed the meson build rules.
>> > Daniel told me that the proper fix was to change the #ifdef test.
>> > ---
>> >   tests/unit/test-crypto-secret.c | 10 +++++-----
>> >   1 file changed, 5 insertions(+), 5 deletions(-)
>> 
>> This seems to cause failures in the CI:
>> 
>> https://gitlab.com/thuth/qemu/-/jobs/3870672310#L1443
>> https://gitlab.com/thuth/qemu/-/jobs/3870672331#L2353
>> 
>> ../tests/unit/test-crypto-secret.c:29:10: fatal error: keyutils.h: No such 
>> file or directory
>>    29 | #include <keyutils.h>
>>       |          ^~~~~~~~~~~~
>> compilation terminated.
>
> Hmm, so we actually have to test for both #ifdefs then

Yeap.

I was trying to do something "clever":

diff --git a/meson.build b/meson.build
index 77d2ae87e4..01f3227d62 100644
--- a/meson.build
+++ b/meson.build
@@ -2309,6 +2309,7 @@ config_host_data.set('CONFIG_USBFS', have_linux_user and 
cc.compiles('''
   int main(void) { return 0; }'''))
 
 have_keyring = get_option('keyring') \
+  .require(keyutils.found(), error_message: 'keyring requires keyutils 
libraries') \
   .require(targetos == 'linux', error_message: 'keyring is only available on 
Linux') \
   .require(cc.compiles('''
     #include <errno.h>
(test-secret *)$ 

But it is only the test what requires CONFIG_KEYUTILS,
crypto/secret_keyring.c don't needs it, so we need to do both ifdefs.

> With regards,
> Daniel


Reply via email to