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

localed: skip verification when libxkbcommon is not installed #26714

Merged
merged 1 commit into from Mar 8, 2023

Conversation

keszybz
Copy link
Member

@keszybz keszybz commented Mar 8, 2023

When compliled without libxkbcommon, we do no verification and accept the arguments as given. When compliled against with, if dlopen() works, we do the verification. But if dlopen() fails, we would refuse the call and return SD_BUS_ERROR_INVALID_ARGS. 5de3447 added things this way when converting to dlopen(), but it seems not very useful: it can be expected that when the library is supported but missing at runtime, we degrade softly, and that the behaviour is something inbetween the cases of hard disable at compilation time and full support. But right now we behave more strictly then if disabled at compilation. Change the code to just warn if dlopen fails, but accept the arguments.

(There are various minimization scenarios where forcing the installation of libxkbcommon is not useful. E.g. a small installation where we want to set the keymap via logind, but the configuration is managed by a configuration management system and is known to be valid. Verification via libxkbcommon is just overhead in this case.)

800f65f moved the check earlier, so now even a noop case of setting the values that were already in place can fail. C.f. https://bugzilla.redhat.com/show_bug.cgi?id=2175244.

When compliled without libxkbcommon, we do no verification and accept the
arguments as given. When compliled against with, if dlopen() works, we do the
verification. But if dlopen() fails, we would refuse the call and return
SD_BUS_ERROR_INVALID_ARGS. 5de3447 added things
this way when converting to dlopen(), but it seems not very useful: it can be
expected that when the library is supported but missing at runtime, we degrade
softly, and that the behaviour is something inbetween the cases of hard disable
at compilation time and full support. But right now we behave more strictly then
if disabled at compilation. Change the code to just warn if dlopen fails, but
accept the arguments.

(There are various minimization scenarios where forcing the installation of
libxkbcommon is not useful. E.g. a small installation where we want to set the
keymap via logind, but the configuration is managed by a configuration
management system and is known to be valid. Verification via libxkbcommon is
just overhead in this case.)

800f65f moved the check earlier, so now even
a noop case of setting the values that were already in place can fail.
C.f. https://bugzilla.redhat.com/show_bug.cgi?id=2175244.
@github-actions github-actions bot added the please-review PR is ready for (re-)review by a maintainer label Mar 8, 2023
@yuwata yuwata added the locale label Mar 8, 2023
@yuwata yuwata added good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed needs-stable-backport and removed please-review PR is ready for (re-)review by a maintainer labels Mar 8, 2023
@yuwata yuwata merged commit 82c2095 into systemd:main Mar 8, 2023
45 of 47 checks passed
@github-actions github-actions bot removed the good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed label Mar 8, 2023
@AdamWill
Copy link
Contributor

AdamWill commented Mar 8, 2023

I feel like the logging here may be a bit confusing on the new path. Previously you did get a message that explained what was going on. Now you get an info message that the layout could not be compiled, and...that's all. I can imagine this being a confusing red herring if someone was trying to debug a problem and saw this message. Perhaps we should log something else instead/as well, on the case where libxkbcommon isn't present, to say that's what we're logging about and it just means we can't validate the configuration, not that it's definitely invalid?

@keszybz keszybz deleted the libxkbcomon-graceful-degradation branch March 8, 2023 17:41
@keszybz
Copy link
Member Author

keszybz commented Mar 28, 2023

The message was updated in 080ecab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants