Skip to content

Commit bce06bd

Browse files
committed
Various small fixes.
Signed-off-by: clux <[email protected]>
1 parent 0f5cd44 commit bce06bd

File tree

2 files changed

+33
-10
lines changed

2 files changed

+33
-10
lines changed

justfile

+31-8
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,44 @@
44
default:
55
@just --list --unsorted --color=always
66

7-
_build channel:
8-
docker build --build-arg CHANNEL="{{channel}}" -t clux/muslrust:temp .
9-
# Build the stable container locally tagged as :temp
10-
build-stable: (_build "stable")
11-
# Build the nightly container locally tagged as :temp
12-
build-nightly: (_build "nightly")
7+
_build channel ar platform ext:
8+
docker build --build-arg CHANNEL="{{channel}}" --build-arg AR="{{ar}}" --platform="{{platform}}" -t rustmusl-temp . -f Dockerfile.{{ext}}
9+
# Build the stable x86 container
10+
build-stable-amd: (_build "stable" "amd64" "linux/amd64" "x86_64")
11+
# Build the nightly x86 container
12+
build-nightly-amd: (_build "nightly" "amd64" "linux/amd64" "x86_64")
13+
# Build the stable arm container
14+
build-stable-arm: (_build "stable" "arm64" "linux/arm64" "arm64")
15+
# Build the nightly arm container
16+
build-nightly-arm: (_build "nightly" "arm64" "linux/arm64" "arm64")
1317

1418
# Shell into the built container
1519
run:
16-
docker run -v $PWD/test:/volume -w /volume -it clux/muslrust:temp /bin/bash
20+
docker run -v $PWD/test:/volume -w /volume -it rustmusl-temp /bin/bash
1721

18-
# Test an individual crate against built containr
22+
test-setup:
23+
docker build -t test-runner . -f Dockerfile.test-runner
24+
25+
# Test an individual crate against built container
1926
_t crate:
2027
./test.sh {{crate}}
2128

29+
# when running locally use one of these instead of _t
30+
_t_amd crate:
31+
#!/bin/bash
32+
# TODO: make a variant for arm here, or do platform inference
33+
export PLATFORM="linux/amd64"
34+
export TARGET_DIR="x86_64-unknown-linux-musl"
35+
export AR="amd64"
36+
./test.sh {{crate}}
37+
_t_arm crate:
38+
#!/bin/bash
39+
export PLATFORM="linux/arm64"
40+
export TARGET_DIR="aarch64-unknown-linux-musl"
41+
export AR="arm64"
42+
./test.sh {{crate}}
43+
44+
2245
# Test all crates against built container
2346
test: (_t "plain") (_t "ssl") (_t "rustls") (_t "pq") (_t "serde") (_t "curl") (_t "zlib") (_t "hyper") (_t "dieselpg") (_t "dieselsqlite")
2447

test.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ docker_build() {
1212
-v cargo-cache:/root/.cargo/registry \
1313
-e RUST_BACKTRACE=1 \
1414
-e AR=ar \
15-
--platform $PLATFORM \
15+
--platform "${PLATFORM}" \
1616
rustmusl-temp \
1717
cargo build
1818

@@ -24,7 +24,7 @@ docker_build() {
2424
docker run --rm \
2525
-v "$PWD:/volume" \
2626
-e RUST_BACKTRACE=1 \
27-
--platform $PLATFORM \
27+
--platform "${PLATFORM}" \
2828
test-runner \
2929
bash -c "cd volume; ./target/$TARGET_DIR/debug/${crate} && file ./target/$TARGET_DIR/debug/${crate} && file /volume/target/$TARGET_DIR/debug/${crate} 2>&1 | grep -qE 'static-pie linked|statically linked' && echo ${crate} is a static executable"
3030
}

0 commit comments

Comments
 (0)