musl linux compilation working from now on

This commit is contained in:
Priec
2026-08-14 18:10:46 +02:00
parent 6725444c18
commit 0e6207fb44
6 changed files with 21 additions and 4 deletions

View File

@@ -21,7 +21,7 @@ Output: `result/bin/server`.
The resulting executable is intended for 64-bit Linux kernels. Run it normally:
```sh
cp .env_template .env
cp .env_template_musl .env
# Replace JWT_SECRET in .env before starting.
./result/bin/server server
```

View File

@@ -157,9 +157,14 @@ bootstrapRustPlatform.buildRustPackage {
SQLX_OFFLINE = "true";
RUSTFLAGS = "-Ctarget-feature=+crt-static";
preBuild = ''
cp -r ${source}/.sqlx .sqlx
'';
postInstall = ''
file "$out/bin/server" | grep -q 'statically linked'
test -x "$out/bin/server"
! readelf -l "$out/bin/server" | grep -q 'Requesting program interpreter'
! readelf -d "$out/bin/server" | grep -q '(NEEDED)'
'';
meta = {