File tree Expand file tree Collapse file tree 2 files changed +29
-15
lines changed Expand file tree Collapse file tree 2 files changed +29
-15
lines changed Original file line number Diff line number Diff line change @@ -194,17 +194,24 @@ jobs:
194
194
args : " --manifest-path top-crates/Cargo.toml --check"
195
195
- name : Build backend
196
196
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/
199
205
200
206
# 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);
203
210
mv "${test_bin}" target/unit_tests;
204
211
205
212
# 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;
208
215
'
209
216
- name : Restore permissions
210
217
run : sudo chown -R runner:docker ~/.cargo/ ui/target
Original file line number Diff line number Diff line change @@ -298,21 +298,28 @@ workflows:
298
298
run
299
299
--rm
300
300
-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
303
303
--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/
307
313
308
314
# 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);
311
318
mv "${test_bin}" target/unit_tests;
312
319
313
320
# 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;
316
323
'
317
324
318
325
- name : " Restore permissions"
You can’t perform that action at this time.
0 commit comments