Closed M0r41 closed 6 months ago
musl builds and C dependencies is it's own "can of worms" and it's non trivial to set up a good build container for this.
We are using https://github.com/clux/muslrust in https://github.com/kube-rs/version-rs/blob/main/Dockerfile and https://github.com/kube-rs/controller-rs/blob/main/justfile#L35-L44 - you could try that.
EDIT: sorry, thought this was on a different repo, ignore this.
if you want to link against extra libraries you have to compile these libraries inside the container with the musl toolchain.
it is not sufficient to apt install extra C dependencies because the apt installed ones are glibc based dylibs and will not be statically linkable (with -lgdk-3
say). See https://github.com/clux/muslrust?tab=readme-ov-file#extra-c-libraries
thx a lot, i while try building by source
my building log ,i use the commands
and the got the link error