kcov icon indicating copy to clipboard operation
kcov copied to clipboard

Provide statically-linked prebuild binaries

Open matklad opened this issue 1 year ago • 8 comments

Currently, the binaries published to GitHub releases are dynamically linked. This is helpful, but not as helpful as a statically linked binary would be! For various CI setups, it would be really nice to be able to pull kcov from GitHub releases and just run it, without installing any extra dependencies.

This might become a bit more important now, as, as far as I can tell, Ubuntu 24 stopped packaging kcov, so it can't be just apt-get installed anymore sadly.

Some previous attempts at static builds are here: https://github.com/SimonKagstrom/kcov/issues/289#issuecomment-485752541

matklad avatar Jan 16 '25 18:01 matklad

I don't remember quite what the problem was, but one of the libraries kcov links to unfortunately prevents a completely static build. I'm mostly on Mac these days, so don't regularly try the Linux build.

As for Ubuntu, @williamdes has done some very good work at modernizing the Debian kcov packaging, https://tracker.debian.org/pkg/kcov, so kcov should re-appear in Ubuntu with an up-to-date version for (I guess) the next LTS.

SimonKagstrom avatar Jan 19 '25 08:01 SimonKagstrom

... sorry, saw in the link you added that the dependency issues were investigated.

SimonKagstrom avatar Jan 19 '25 08:01 SimonKagstrom

Indeed you still can find it for Ubuntu Focal/Jammy and the current version in development https://launchpad.net/ubuntu/+source/kcov

williamdes avatar Jan 19 '25 10:01 williamdes

kcov is now available as a more up to date version in bookworm-backports!

williamdes avatar Mar 16 '25 08:03 williamdes

Not sure if this is relevant but I had to fix some lib paths to run the https://github.com/SimonKagstrom/kcov/releases/download/v42/kcov-amd64.tar.gz on Ubuntu 24.04

sudo ln -s /usr/lib/x86_64-linux-gnu/libbfd-2.42-system.so /usr/lib/x86_64-linux-gnu/libbfd-2.38-system.so
sudo ln -s /usr/lib/x86_64-linux-gnu/libopcodes-2.42-system.so /usr/lib/x86_64-linux-gnu/libopcodes-2.38-system.so

jakub-bochenski avatar May 29 '25 14:05 jakub-bochenski

Not sure if this is relevant but I had to fix some lib paths to run the https://github.com/SimonKagstrom/kcov/releases/download/v42/kcov-amd64.tar.gz on Ubuntu 24.04

Because you did not use apt install kcov, right ?

Edit: most probably because it is not possible on Noble: https://launchpad.net/ubuntu/noble/+source/kcov But you can download kcov from: http://ftp.debian.org/debian/pool/main/k/kcov/kcov_43+dfsg-1+b4_amd64.deb See: https://packages.debian.org/trixie/amd64/kcov/download

williamdes avatar May 30 '25 13:05 williamdes

Because you did not use apt install kcov, right ?

True. It's not available for this distro.

Still, please excuse my ignorance, but I don't understand if it's dynamically linked, why doesn't it pickup the newer library version?

jakub-bochenski avatar May 30 '25 13:05 jakub-bochenski

Because you did not use apt install kcov, right ?

True. It's not available for this distro.

Still, please excuse my ignorance, but I don't understand if it's dynamically linked, why doesn't it pickup the newer library version?

Well, not an expert here but because it is linked to a specific version. Check by running ldd /usr/bin/kcov Something about sonames https://en.wikipedia.org/wiki/Soname

williamdes avatar May 30 '25 21:05 williamdes