Open daneov opened 2 years ago
What Version are you using? I recently changed some things regarding font rendering.
The latest available at the time this issue was created, installed via cargo install kickoff
. Running kickoff
with --version
or version
doesn't give any response, immediate crash.
Okay, that's using the latest font loading code :/
Could you build a debug version from the latest main and post the output of RUST_BACKTRACE=full cargo run
Sure. I just tried to execute cargo build
, but it returns:
= note: /bin/ld: cannot find -lxkbcommon
collect2: error: ld returned 1 exit status
error: could not compile `kickoff` due to previous error
Do you have any tips on how to proceed?
Unfortunately I have no experience with void linux and at the moment not the time to learn it. It is weird that the compile fails with missing xkbcommon, that dependencies has been present from the beginning of this project and previous compiles have worked on your system. Maybe that's something to look at.
I'm open for PR's but I don't intend to build void support myself for now.
Oh hey! I had exactly the same issue compiling on Void Linux. I'm looking into it My xbps-query says:
architecture: x86_64-musl
automatic-install: yes
changelog: https://github.com/xkbcommon/libxkbcommon/blob/master/NEWS.md
filename-sha256: 0293b68dc044e4214bc105ce450795055bd91cec2f30111e79df393d0a717588
filename-size: 141KB
homepage: https://xkbcommon.org/
install-date: 2024-04-01 12:39 CDT
installed_size: 304KB
license: MIT
maintainer: Andrew J. Hesford <ajh@sideband.org>
metafile-sha256: 09e5c22c800c0642220286088a74ced69652cac581d1cef5e7ba27f193172e1a
pkgname: libxkbcommon
pkgver: libxkbcommon-1.7.0_1
repository: https://repo-default.voidlinux.org/current/musl
run_depends:
xkeyboard-config>=0
musl>=1.1.24_7
shlib-provides:
libxkbcommon.so.0
shlib-requires:
libc.so
short_desc: Library to handle keyboard descriptions
source-revisions: libxkbcommon:9defcef69d9
state: installed
I ran ld -lxkbcommon --verbose
as suggested by this stackoverflow comment and got:
...
attempt to open /usr/local/lib64/libxkbcommon.so failed
attempt to open /usr/local/lib64/libxkbcommon.a failed
attempt to open /lib64/libxkbcommon.so succeeded
/lib64/libxkbcommon.so
libc.so needed by /lib64/libxkbcommon.so
attempt to open /usr/x86_64-unknown-linux-musl/lib64/libc.so failed
attempt to open /usr/local/lib64/libc.so failed
found libc.so at /lib64/libc.so
ld: warning: cannot find entry symbol _start; not setting start address
I successfully built kickoff for x86_64-unknown-linux-gnu using my void glibc chroot, but when I try to compile for x86_64-unknown-linux-musl I get the described linking error, and also when cross-compiling from gnu to musl.
It seems that Void Linux doesn't include a statically compiled version of xkbcommon
, but building it myself seems to have worked. Now I'm hanging on a lot of undefined reference errors from fontconfig and freetype...
I have been banging my head against this on and off for the last couple of days and my largest problem at the moment is, that there seems to be no more static library for brotli, which breaks freetype, which breaks fontconfig, which breaks fontconfig-rs and therefore kickoff. Now, I can hardly imagine that it is impossible to statically link against fontconfig, which means that I went wrong somewhere, but I can't figure out where.
Why do you need to statically link the fontconfig transitive dependency only on musl libc?
Does fontconfig-rs build a static library by default?
Tbh, I'm kind of out of my depth here. I rarely had to worry about how a binary was linked, so I'm stumbling from error message to error message, and currently I get a lot of these when trying to run cargo test
on the fontconfig-rs crate:
/usr/bin/ld: /usr/lib64/libfreetype.a(ftbzip2.o): in function `FT_Stream_OpenBzip2':
(.text+0x613): undefined reference to `BZ2_bzDecompressInit'
The usual approach to get rid of these seems to be, to make sure a static library with that missing function is passed to the linker. I've been trying that until I ran into brotli :shrug:
If you have a good resource to learn those fundamentals, I would be very grateful!
I'm researching it a bit right now:
https://wiki.archlinux.org/title/Debugging#Missing_files_or_libraries https://wiki.gentoo.org/wiki/Why_not_bundle_dependencies#When_is_code_bundled.3F https://wiki.gentoo.org/wiki/Pkg-config optimizations like static linking allows symbol versioning https://wiki.gentoo.org/wiki/Writing_Rust_ebuilds https://rust-lang.github.io/rustup/cross-compilation.html configuring cargo with what linker to use for a specific target triple https://stackoverflow.com/questions/46934111/which-is-the-correct-way-to-build-a-static-library-with-link-time-code-generatio https://www.man7.org/linux/man-pages/man1/ar.1.html
Also, Archlinux has a musl package: https://wiki.archlinux.org/title/C#Alternative_libc_implementations list of files in musl package, note musl-gcc and musl-clang
When running kickoff I receive the following stacktrace:
My config file:
Confirmation that the font is installed:
Any ideas? Or things I can help to determine where this goes wrong?
Thanks!