musl linux compilation working from now on
This commit is contained in:
@@ -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
|
||||
```
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user