netscanner icon indicating copy to clipboard operation
netscanner copied to clipboard

Build with musl

Open tadejsv opened this issue 1 year ago • 1 comments

You may want to build the binary with musl instead of glibc, because glibc does not allow you to build a truly static binary - which may cause conflicts if the version of glibc used for building is not the same as the version on the machine that uses the binary - for me, this happened

netscanner: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.38' not found (required by netscanner)

I have glibc version 2.35 installed (Ubuntu 22.04). Anyways, just a suggestion - i don't know if replacing musl with glibc is possible in relation to networking, but would be good to try :)

tadejsv avatar Mar 10 '24 23:03 tadejsv

Thank You for Your question. I will take a look at it ASAP. Need to finish some crashes and finish one feature but I will put a pin on it.

Chleba avatar Mar 10 '24 23:03 Chleba

Hi @tadejsv, I've looked into this issue and tried a few things but I can see that building the Alpine Linux package has dependencies on musl & libgcc. Unfortunately I was unable to build the binary with musl on my PC but I will try to at least make a package for deb/ubuntu so for now - installing netscanner with cargo hopefully will solve your issue with not truly static binaries. Sorry about that.

Chleba avatar May 13 '24 23:05 Chleba

It is possible to compile a true static binary using the alpine docker image and adding all the required libraries (static versions)

  • An example dockerfile: https://github.com/Azathothas/Toolpacks/blob/main/.github/runners/alpine-builder.dockerfile
  • An example build script: https://github.com/Azathothas/Toolpacks/blob/main/.github/scripts/x86_64_Linux/bins/netscanner.sh

Precompiled Binary: https://bin.ajam.dev/x86_64_Linux/netscanner

Azathothas avatar May 26 '24 17:05 Azathothas

You are awesome @Azathothas. Thank You very much for Your work and added scripts. That is just awesome. I will implement those for building binaries in the future.

Chleba avatar May 27 '24 00:05 Chleba