Re:Show HN: My Go SQLite driver did poorly on a benchmark, s...
by glenjamin on Friday December 15, 2023 @11:34AM
(#38655769)
it's also worth noting that even on the same platform, compiling with CGO enabled creates a dynamic link against `glibc`, which creates a dependency on having the matching version in your deployment target.
We ran into this recently as our CI system is running a newer OS than we currently deploy to - and disabling CGO was an easy way to sidestep this requirement
Re:Show HN: My Go SQLite driver did poorly on a benchmark, s...
by acqq on Friday December 15, 2023 @01:10PM
(#38656820)
Is this something inherent in CGO implementation? If your dependency happened because the compiled library depended on it, do you know that that is probably avoidable (I haven't tried your use case, so I could be wrong) by using zig as a compiler as it can "cross compile" for lower glibc version and also to musl, avoiding glibc altogether?
Re:Show HN: My Go SQLite driver did poorly on a benchmark, s...
by ncruces on Friday December 15, 2023 @02:14PM
(#38657558)
With zig I think you can avoid libc deps on Linux, at least, by statically linking musl instead.
Not sure SQLite is tested in this configuration, for the fans of “this didn't pass TH3 so we can't trust it at all.”
Re:Show HN: My Go SQLite driver did poorly on a benchmark, s...
by acqq on Saturday December 16, 2023 @10:19AM
(#38664820)
AFAIK: you also link to a different (lower!) glibc version from the one on which you do the compilation, probably solving the problem you had without having an excuse that you linked an "untested" library.
I'm surely aware of the fact that C cross-compilation is often very clumsy implemented. But I also have to mention that there is a project that also tries to solve that too, while also creating a whole new language:
https://zig.news/kristoff/building-sqlite-with-cgo-for-every...