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: Supporting embedded-postgres on non `/lib/64/ld-linux` platforms #6

Open jordanisaacs opened 1 year ago

jordanisaacs commented 1 year ago

Currently if /lib64/ld-linux-x86-64.so.2 is not set, then the program won't use embedded postgres: here. To fix this, I propose an environment variable EMBEDDED_POSTGRES_INTERPRETER_PATH. If this is set, then the hardcoded check is skipped, and the interpreter path is provided to the embedded postgres config. Additionally, EMBEDDED_POSTGRES_LD_LIBRARY_PATH env variable would be passed into the config as the LD_LIBRARY_PATH environment variable.

Depends on: https://github.com/fergusstrange/embedded-postgres/pull/109

From a Nix packaging perspective, a wrapper can provide patchelf in the path, set the postgres interpreter environment variable to the correct path, and provide libstdc++.so.6 for the library path. These configurations would be hidden from the end user.

Side note, the error message should clarify that /lib64/ld-linux-x86-64.so.2 is required by embedded-postgres binaries, not "missing". This caused confusion for me as I had no idea what embedded-postgres was and thought it was just a hardcoded check without thought for platforms like nix.