You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When cross compiling cosmic applications it can be very useful to be able to disable dependencies that require native libraries. In the case of libcosmic, the only offender here is xkbcommon.
As a proof of concept I patched various deps to disable xkbcommon crate, cross compiled to gnu arm cargo build --release --target aarch64-unknown-linux-gnu, loaded it on my phone and ran it. The application in question that I used was cosmic-edit, the patches below, wayland worked fine, x11 has broken keyboard input (though this is possibly a winit related issue as some other other winit applications share similar issues, for context prior discussion is here YaLTeR/niri#713)
(note I had to patch [dev-dependnecies] too for these which is why they are here)
xkbcommon is used to map keycodes and modifiers to keysyms.
This isn't really optional for any application that takes keyboard input. The alternative would be to re-implement it in Rust, which would be nice but is non-trivial while correctly handling all keyboard layouts and xkb options.
Libwayland is also needed, but not at compile time since it's loaded with dlopen. I guess winit is also using dlopen for xkbcommon with https://github.com/rust-windowing/xkbcommon-dl, though the dependency tree also has the xkbcommon crate. So If it worked for you, then xkbcommon was present at runtime on the arm device, but not at build time?
Interesting, I haven't noticed any breakages, in usage.
The alternative would be to re-implement it in Rust, which would be nice but is non-trivial while correctly handling all keyboard layouts and xkb options.
there is https://github.com/rano-oss/wkb but I'm not sure the scope of this. It does rely on xkbcommon, but I'm not sure if that is just a WIP thing while they work on it or not. I do know that it doesn't seem like it is usable yet, but it may be worth keeping an eye on?
I guess winit is also using dlopen for xkbcommon with https://github.com/rust-windowing/xkbcommon-dl, though the dependency tree also has the xkbcommon crate. So If it worked for you, then xkbcommon was present at runtime on the arm device, but not at build time?
This is correct, xkbcommon-dl does also work and would work for me as I do have it on device.
When cross compiling cosmic applications it can be very useful to be able to disable dependencies that require native libraries. In the case of libcosmic, the only offender here is xkbcommon.
As a proof of concept I patched various deps to disable xkbcommon crate, cross compiled to gnu arm
cargo build --release --target aarch64-unknown-linux-gnu
, loaded it on my phone and ran it. The application in question that I used was cosmic-edit, the patches below, wayland worked fine, x11 has broken keyboard input (though this is possibly a winit related issue as some other other winit applications share similar issues, for context prior discussion is here YaLTeR/niri#713)(note I had to patch [dev-dependnecies] too for these which is why they are here)
It would be nice to be able to conveniently cross compile libcosmic applications.
The text was updated successfully, but these errors were encountered: