frectonz / sql-studio

SQL Database Explorer [SQLite, libSQL, PostgreSQL, MySQL/MariaDB, DuckDB, ClickHouse]
https://sql-studio.onrender.com/
MIT License
2.36k stars 60 forks source link

Build for `musl` based Linux distributions #31

Open jamietanna opened 4 months ago

jamietanna commented 4 months ago

After #16, I've been looking to deploy the sql-studio binary alongside a static Go binary in an Alpine container, when I noticed that the binary does not run:

ERRO An error occured with sql-studio: fork/exec /usr/local/bin/sql-studio: no such file or directory

Would it be possible to build the binary so it can be used with musl, the libc that Alpine uses? (possibly via or in a tweak to https://github.com/frectonz/sql-studio/blob/fb7a8ee6129e3a91ebfc40949f708d0efb7d7da2/Cargo.toml#L52)

I can see:

$ file sql-studio-x86_64-unknown-linux-gnu/sql-studio
sql-studio-x86_64-unknown-linux-gnu/sql-studio: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=c392fa9b23eb5a8eb5322f258406ec13c98bf9ca, for GNU/Linux 3.2.0, stripped
frectonz commented 4 months ago

I have tried adding a musl release but seems like we wont be able to do that since the rust adapter for duckdb doesn't support musl.

https://github.com/frectonz/sql-studio/actions/runs/9739363600/job/26874453077

jamietanna commented 4 months ago

Hey @frectonz apologies for the delay on replying - my (untrained) eyes are seeing the build failing due to :

  cargo:warning=Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `musl-g++` installed?

Although a slightly older thread, https://github.com/emk/rust-musl-builder/issues/53#issuecomment-421806898 may be a solution we need to enable this?