sourcegraph / app

Issue tracker for the Sourcegraph app - a lightweight single-binary version of Sourcegraph for your local machine
27 stars 2 forks source link

linux: support use with older GLIBC? #11

Open vamega opened 1 year ago

vamega commented 1 year ago

Running this on an Amazon Linux 2 machine, I immediately see it fail.

> sourcegraph --help
sourcegraph: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by sourcegraph)

I'm using the single binary download for linux here. Would it be possible to build this targeting an older GLIBC version? I'm not sure what the the go toolchain you're using requires.

slimsag commented 1 year ago

Thanks for reporting this.

The solution here is a bit tricky due to many build processes being involved, so I cannot make any guarantees about timeline for fixing this, but we will definitely keep this in mind as we iterate on build system improvements and will keep you posted.

vamega commented 1 year ago

I got it working today by using nix to patch the binary. I’ll share the nix derivation for the binary in the morning for anyone else who might want to do this.

Thanks for making the app. Having a single binary made me think it was worth trying to set up, and I doubt I would have done it without this.

Was looking through the source code and saw that this involves an embedding of Postgres into the binary 🤯.

vamega commented 1 year ago

Here's a gist of the derivation I had in my own nix config that I was able to use to get the app running on the system that comes with an older Glibc.

https://gist.github.com/vamega/cb52091f24bdc8d4c6a3a120c8787816

vamega commented 1 year ago

I packaged it up into a nix flake, so on a flake enabled nix system, running this can be as simple as

nix run github:vamega/nix-sourcegraph-app

I'll try to add this to nixpkgs so this can be even simpler for nix users, for now this should be a solution for some subset of users who ran into this issue.