Skip to content

Commit 43392b1

Browse files
committed
Merge branch 'feature/ci_image_for_everything' into develop
Use our homegrown container image for running the initial "check and vendor" job. All Linux jobs now run containerized. In addition: * Add cargo-fmt to containers * Run i686 binaries on x86_64 without emulation See #51
2 parents 931cb4b + 84e0aa9 commit 43392b1

3 files changed

Lines changed: 23 additions & 2 deletions

File tree

.github/container/rust/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ RUN set -eux; \
5151
rustc --version; \
5252
rustup set auto-self-update disable; \
5353
echo "$RUST_VERSIONS" | xargs rustup toolchain add --profile minimal; \
54+
rustup component add --toolchain "$default_rust" rustfmt; \
5455
(umask 022 && echo "$RUSTUP_ARCH" >/etc/rust-native-arch)
5556

5657
# Install scripts

.github/container/rust/rootfiles/usr/local/bin/qemu-run-maybe

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ if [ ! -x "$program" ]; then
1414
program="$(command -v "$program")"
1515
fi
1616

17+
# determine platform-native triple by reading a file we
18+
# wrote at install time
19+
NATIVE_ARCH="$(cat /etc/rust-native-arch)"
20+
1721
case "${CARGO_BUILD_TARGET:-}" in
18-
("$(cat /etc/rust-native-arch)")
22+
("${NATIVE_ARCH?no native architecture saved in /etc/rust-native-arch}")
1923
# the build target is the native architecture
2024
exec "$program" "$@"
2125
;;
@@ -26,7 +30,15 @@ case "${CARGO_BUILD_TARGET:-}" in
2630
exec qemu-arm -- "$program" "$@"
2731
;;
2832
(i686-unknown-linux-*)
29-
exec qemu-i386 -- "$program" "$@"
33+
case "$NATIVE_ARCH" in
34+
(x86_64-unknown-linux-*)
35+
# x86_64 can run i686 without emulation
36+
exec "$program" "$@"
37+
;;
38+
(*)
39+
exec qemu-i386 -- "$program" "$@"
40+
;;
41+
esac
3042
;;
3143
(x86_64-unknown-linux-*)
3244
exec qemu-x86_64 -- "$program" "$@"

.github/workflows/workflow.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ jobs:
2020
check_and_vendor:
2121
runs-on: ubuntu-latest
2222

23+
container:
24+
image: ghcr.io/cbs228/sameold/builder/x86_64-unknown-linux-gnu:latest
25+
credentials:
26+
username: ${{ github.actor }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
env:
29+
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
30+
2331
steps:
2432
- uses: actions/checkout@v4
2533
with:

0 commit comments

Comments
 (0)