File tree Expand file tree Collapse file tree 7 files changed +543
-371
lines changed Expand file tree Collapse file tree 7 files changed +543
-371
lines changed Original file line number Diff line number Diff line change @@ -194,17 +194,24 @@ jobs:
194194 args : " --manifest-path top-crates/Cargo.toml --check"
195195 - name : Build backend
196196 run : |-
197- mkdir -p ui/target; docker run --rm -v $PWD/ui:/ui -v ~/.cargo/git:/home/rust/.cargo/git -v ~/.cargo/registry:/home/rust/.cargo/registry --workdir /ui ekidd/rust-musl-builder:stable bash -c $'
198- sudo chown -R rust:rust /home/rust/.cargo /ui/target;
197+ mkdir -p ui/target; docker run --rm -v $PWD/ui:/ui -v ~/.cargo/git:/root/.cargo/git -v ~/.cargo/registry:/root/.cargo/registry --workdir /ui rust:alpine sh -c '
198+ apk add musl-dev openssl-dev openssl-libs-static
199+
200+ # Adding -C relocation-model=static due to
201+ # https://github.com/rust-lang/rust/issues/95926
202+
203+ # Adding this to find the statically-built version
204+ export OPENSSL_NO_PKG_CONFIG=1 OPENSSL_STATIC=1 OPENSSL_DIR=/usr/
199205
200206 # Unit tests
201- cargo test --locked --target=x86_64-unknown-linux-musl --no-run;
202- test_bin=$(find target/x86_64-unknown-linux-musl/debug/deps/ -type f -perm -a=x);
207+ cargo rustc --tests --locked -- -C relocation-model=static;
208+
209+ test_bin=$(find target/debug/deps/ -name "ui*" -type f -perm -a=x);
203210 mv "${test_bin}" target/unit_tests;
204211
205212 # Primary binary
206- cargo build --locked --target=x86_64-unknown-linux-musl --release ;
207- mv target/x86_64-unknown-linux-musl/ release/ui target/ui;
213+ cargo rustc --locked --release -- -C relocation-model=static ;
214+ mv target/release/ui target/ui;
208215 '
209216 - name : Restore permissions
210217 run : sudo chown -R runner:docker ~/.cargo/ ui/target
Original file line number Diff line number Diff line change @@ -298,21 +298,28 @@ workflows:
298298 run
299299 --rm
300300 -v $PWD/ui:/ui
301- -v ~/.cargo/git:/home/rust /.cargo/git
302- -v ~/.cargo/registry:/home/rust /.cargo/registry
301+ -v ~/.cargo/git:/root /.cargo/git
302+ -v ~/.cargo/registry:/root /.cargo/registry
303303 --workdir /ui
304- ekidd/rust-musl-builder:stable
305- bash -c $'
306- sudo chown -R rust:rust /home/rust/.cargo /ui/target;
304+ rust:alpine
305+ sh -c '
306+ apk add musl-dev openssl-dev openssl-libs-static
307+
308+ # Adding -C relocation-model=static due to
309+ # https://github.com/rust-lang/rust/issues/95926
310+
311+ # Adding this to find the statically-built version
312+ export OPENSSL_NO_PKG_CONFIG=1 OPENSSL_STATIC=1 OPENSSL_DIR=/usr/
307313
308314 # Unit tests
309- cargo test --locked --target=x86_64-unknown-linux-musl --no-run;
310- test_bin=$(find target/x86_64-unknown-linux-musl/debug/deps/ -type f -perm -a=x);
315+ cargo rustc --tests --locked -- -C relocation-model=static;
316+
317+ test_bin=$(find target/debug/deps/ -name "ui*" -type f -perm -a=x);
311318 mv "${test_bin}" target/unit_tests;
312319
313320 # Primary binary
314- cargo build --locked --target=x86_64-unknown-linux-musl --release ;
315- mv target/x86_64-unknown-linux-musl/ release/ui target/ui;
321+ cargo rustc --locked --release -- -C relocation-model=static ;
322+ mv target/release/ui target/ui;
316323 '
317324
318325 - name : " Restore permissions"
You can’t perform that action at this time.
0 commit comments