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

[BUG] 1.17.5: build fails #85

Closed
kloczek opened this issue Jun 25, 2024 · 6 comments
Closed

[BUG] 1.17.5: build fails #85

kloczek opened this issue Jun 25, 2024 · 6 comments
Assignees
Labels

Comments

@kloczek
Copy link

kloczek commented Jun 25, 2024

Describe the bug
Looks like something is wtong and build fails with:

+ cd ibus-table-1.17.5
+ cd engine
+ /usr/bin/python3 table.py
+ /usr/bin/python3 it_util.py
**********************************************************************
File "/home/tkloczko/rpmbuild/BUILD/ibus-table-1.17.5/engine/it_util.py", line 741, in __main__.keyevent_to_keybinding
Failed example:
    keyevent_to_keybinding(KeyEvent(0x0100263A, 0, IBus.ModifierType.SHIFT_MASK | IBus.ModifierType.CONTROL_MASK))
Expected:
    'Shift+Control+0x100263a'
Got:
    'Shift+Control+U+263A'
**********************************************************************
File "/home/tkloczko/rpmbuild/BUILD/ibus-table-1.17.5/engine/it_util.py", line 744, in __main__.keyevent_to_keybinding
Failed example:
    keyevent_to_keybinding(KeyEvent(0x0101F923, 0, IBus.ModifierType.SHIFT_MASK | IBus.ModifierType.CONTROL_MASK))
Expected:
    'Shift+Control+0x101f923'
Got:
    'Shift+Control+U+1F923'
**********************************************************************
1 items had failures:
   2 of   4 in __main__.keyevent_to_keybinding
***Test Failed*** 2 failures.
@mike-fabian
Copy link
Collaborator

I did that change to make it possible to define keyboard shortcuts to keys which produce key symbols which don't have names in /usr/include/X11/keysymdef.h

See also: mike-fabian/ibus-typing-booster#497

ibus-typing-booster supported this for a little while already, but even for ibus-typing-booster this was added only in February 2024. In case of ibus-table, 1.17.5 was the first release to add support for this.

But, unfortunately, very recently the keysymbol names ibus produces for this have changed:

mike-fabian/ibus-typing-booster#497 (comment)

But only in ibus-1.5.30 + some patches, so it is not even in all ibus-1.5.30 versions.

As ibus-table and ibus-typing-booster support adding key bindings for such “Unicode” keysyms only very recently, I thought I could get away with changing my code to work with the very latest version of ibus with all current patches and just ignore old ibus versions and just skip the test case when ibus is too old. Unfortunately testing for the ibus version number is not enough, some ibus-1.5.30 without any patches would not have the new system yet and one doesn't know which patches were applied.

So at the moment you can safely skip that test case. Everything should work except defining key bindings for such Unicode keys.

But to fix this, I will change my code in ibus-table and ibus-typing-booster to work with all versions of ibus, old and new ones

@kloczek
Copy link
Author

kloczek commented Jun 26, 2024

It really doesn't matter why some change has been made (s*t happens sometimes 😋 ).
Issue is that now latest version is useless and it would be good to fix that somehow.
Just FTR: 1.17.4 still builds correctly.

@mike-fabian
Copy link
Collaborator

It's not useless, it works! Just the doctest test case of /usr/bin/python3 it_util.py fails. If you skip that test case during the build, it builds fine and it also works. Then only thing which does not work are binding some keys to shortcuts, but this affects only keys where this never worked before.

@kloczek
Copy link
Author

kloczek commented Jun 26, 2024

Only now you told me that it is strictly test suite issue and not tested code one 😄
Thx 👍

Nevertheless have working test suites is really important because it is not only just build and tested package but in may occasions testing any external code of other packages.
More test suites are used -> higher probability to catch early some package issue 😋

@mike-fabian
Copy link
Collaborator

Yes, I am already working on a fix. I will change my code so that both the tests and using Unicode keybindings work fine with any known version of ibus.
Right now I am testing the change for ibus-typing-booster, I'll do ibus-table next.

@kloczek
Copy link
Author

kloczek commented Jun 26, 2024

OK .. I understand 👍

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

No branches or pull requests

2 participants