-
Notifications
You must be signed in to change notification settings - Fork 125
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
Add new warning for deprecated keysyms #356
Conversation
b704736
to
9dedbb1
Compare
I am doubtful on the cost vs. benefit of warning about deprecated keysym names. The deprecated names are never going to be removed. And more generally, basically all of the named keysyms are deprecated in favor of Unicode keysyms... Maybe xkeyboard-config wants to avoid using deprecated names? If so, maybe do it as a lint script directly in xkeyboard-config? |
Are we talking about perf, maintenance, both, other? About perf, I thought we could use a flag to make it opt-in. About maintenance: I think there is no maintenance issue, as long as the conventions to deprecate keysyms hold. The table is generated in the same script that update keysyms name lookup.
Yes they are. Well the patch has been reverted since, but the plan is to delete them.
This is not the policy in
This is the case. But there is also the case for people developing their own layouts. |
I think it would be enough to check for deprecated keysyms only with a special version dev version of |
d90814d
to
463883b
Compare
Rebased. Testing keysym deprecation is now only done when verbosity is ≥ 10. |
Deprecation test is now done only when the new flag |
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 deprecated names are never going to be removed.
Yes they are. Well the patch has been reverted since, but the plan is to delete them.
I'm surprised a breaking change was attempted. IMO it's better to leave the deprecated keysyms. But if xorgproto is going to remove them then I agree it would be good to warn about them.
Deprecation test is now done only when the new flag XKB_CONTEXT_EXHAUSTIVE_CHECKS is set. Without it, the new benchmark bench-compile-keymap gives only about +0,2% more time that on master. With the test, it take about +0,8%. I think this is reasonable!
I thought the verbosity guard was pretty good myself, and allows the user/keymap auther to control it. Why is a context flag better?
dd7f799
to
6736825
Compare
@bluetech Rebased, cleaned commit history.
I am not sure, just experimenting 😄. I think the first motivation was to make it a bit faster. Also it would allow to select some tests on demand. But looking at it a day later it is maybe overcomplicated. I think we could go with the verbosity check, but I would reduce the threshold: using deprecated keysyms means your layout may break sooner or later, depending of the pace the So maybe set the threshold to 5? The deprecation test is quite fast compared to all the keymap processing. |
Valgrind detected a bug that does not trigger on my computer. Will check it later. |
Run locally in podman without error; re-run the failed jobs and no error 🤔 |
6736825
to
ed99e43
Compare
5891692
to
001a290
Compare
Rebased and improved benchmark. |
TODO: changelog |
Implement `tasty-bench` method: 1. Set n = 1. 2. Measure execution time t_n of n iterations and execution time t_2n of 2n iterations. 3. Find t which minimizes deviation of (n·t, 2·n·t) from (t_n, t_2n), namely t = (t_n + 2·t_2n)/5n. 4. If deviation is small enough (see --stdev CLI parameter), return t as a mean execution time. 5. Otherwise set n = 2·n and jump back to Step 2. See: https://hackage.haskell.org/package/tasty-bench
This function allow to check whether a keysym is deprecated, based on the keysym and optionally its name. The generation of the table of deprecated keysyms relies on the rules described in `xkbcommon-keysyms.h`. The `ks_table.h` is now generated deterministically by setting explicitly the random seed to a constant. This will avoid noisy diffs in the future.
001a290
to
61376d3
Compare
Add 2 new warnings: - Deprecated keysym name (typo, historical alias, etc.); - Deprecated keysym (all names and forms). Guard deprecated keysym tests with verbosity level ≥2, so they are run only when actually needed.
61376d3
to
b146193
Compare
Add new warning for deprecated keysyms. Useful in particular for xkeyboard-config.
TODO: