ChristophWurst / krankerl

A CLI helper to manage, package and publish Nextcloud apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Binary releases don't work with musl libc

juliushaertl opened this issue · comments

I was trying to get krankerl working inside of a alpine docker container. However it seems the binary is not compatible with musl libc, which is default in alpine.

/usr/local/bin # ldd krankerl 
	/lib64/ld-linux-x86-64.so.2 (0x7fac0726c000)
	libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7fac0726c000)
	ld-linux-x86-64.so.2 => /lib/ld-linux-x86-64.so.2 (0x7fac0683c000)
	libcurl-gnutls.so.4 => /usr/lib/libcurl-gnutls.so.4 (0x7fac065ce000)
	libssl.so.1.0.0 => /lib/libssl.so.1.0.0 (0x7fac06365000)
	libcrypto.so.1.0.0 => /lib/libcrypto.so.1.0.0 (0x7fac05f46000)
	libz.so.1 => /lib/libz.so.1 (0x7fac05d2f000)
	libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x7fac0726c000)
	libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7fac0726c000)
	libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7fac05b1d000)
	libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7fac0726c000)
	libnghttp2.so.14 => /usr/lib/libnghttp2.so.14 (0x7fac058fc000)
	libssh2.so.1 => /usr/lib/libssh2.so.1 (0x7fac056d4000)
	libssl.so.45 => /lib/libssl.so.45 (0x7fac05488000)
	libcrypto.so.43 => /lib/libcrypto.so.43 (0x7fac050dd000)
Error relocating krankerl: __vsnprintf_chk: symbol not found
Error relocating krankerl: __fprintf_chk: symbol not found
Error relocating krankerl: __strncpy_chk: symbol not found
Error relocating krankerl: __rawmemchr: symbol not found
Error relocating krankerl: __fdelt_chk: symbol not found
Error relocating krankerl: __memcpy_chk: symbol not found
Error relocating krankerl: __register_atfork: symbol not found
Error relocating krankerl: __snprintf_chk: symbol not found
Error relocating krankerl: __res_init: symbol not found

Is there a way to make the binary compatible with the current build pipeline? 😉

Good point. I think I gave this a try in the beginnings of developing this tool but I forgot if (and if not then why) it worked with musl. Let me have another look.

Okay, this is a bit complicated as stuff like openssl has to be compiled as well (obviously). So the simple approach like

PKG_CONFIG_ALLOW_CROSS=1 cargo build --release --target=x86_64-unknown-linux-musl

won't quite work.

https://github.com/emk/rust-musl-builder includes musl versions of openssl (and some others) to allow for easy building

commented

Could this be reopened @ChristophWurst @icewind1991? As I tried the binary from https://github.com/ChristophWurst/krankerl/releases on alpine and it doesn't seem to work, could be resolved by #903