richardlehane / siegfried

signature-based file format identification
http://www.itforarchivists.com/siegfried
Apache License 2.0
225 stars 30 forks source link

SF 1.10 does not work with Debian? #219

Closed jaknz closed 1 year ago

jaknz commented 1 year ago

Caveat that due to system security, I can't add the apt repo and install the normal way. I have downloaded the release binaries, but when I try to run them on latest Debian Bullseye, it complains that I'm missing GLIBC v2.32 and/or v2.34. Latest version available to me is 2.31-13+deb11u5. Has anyone else seen this, and am I just missing something obvious? SF v1.9 works fine, so maybe v1.10 is using too new of a library? /usr/local/bin/sf: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.32' not found (required by /usr/local/bin/sf) libc-bin/stable,stable-updates,now 2.31-13+deb11u5 amd64 [installed]

ross-spencer commented 1 year ago

There's some discussion here about disabling CGO: CGO_ENABLED=0 https://github.com/aws/aws-lambda-go/issues/340#issuecomment-1264679266. Also: https://stackoverflow.com/a/65919767/21120938.

It maybe that it needs to be disabled in the release pipeline?

richardlehane commented 1 year ago

root cause of this seems to be go 1.20 no longer including pre-compiled packaged archives of the std library (https://go.dev/doc/go1.20#go-command).

As @ross-spencer notes, if CGO is disabled this isn't an issue.

I checked dependencies on CGO in siegfried and seems to be due to use of three std lib packages:

I've added new linux binaries to the releases page with CGO disabled.

I think these new linux binaries should work just as well as the normal builds but I'll do some testing before the next release to see if disabling CGO can be made part of the standard release process.

jaknz commented 1 year ago

root cause of this seems to be go 1.20 no longer including pre-compiled packaged archives of the std library (https://go.dev/doc/go1.20#go-command).

As @ross-spencer notes, if CGO is disabled this isn't an issue.

I checked dependencies on CGO in siegfried and seems to be due to use of three std lib packages:

  • "net": is imported by cmd/fpr.go (this is a special socket-based API that doesn't see much use). It could be omitted with a build tag if it causes problems without CGO
  • "os/user" is imported by pkg/config/default.go. This can already be omitted by a build tag (e.g. -brew tag changes default home directory location to /usr/share/siegfried)
  • "runtime/cgo" used by pkg/lib. This package isn't used at the moment and is work in progress for a shared library build of sf. Can be omitted.

I've added new linux binaries to the releases page with CGO disabled.

I think these new linux binaries should work just as well as the normal builds but I'll do some testing before the next release to see if disabling CGO can be made part of the standard release process.

That seems to have fixed it, thanks so much for your help. Good luck disentangling the larger dependency!

richardlehane commented 1 year ago

just to note: for the v1.10.1 the linux binaries (in the deb package and the zip downloads) have all been built with CGO disabled