Skip to content

Commit

Permalink
setup-qemu-container
Browse files Browse the repository at this point in the history
  • Loading branch information
ijl committed Oct 21, 2024
1 parent e331c52 commit 6a6b1f6
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions .github/workflows/artifact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ jobs:
strategy:
fail-fast: false
matrix:
arch: [
"x86_64",
"aarch64",
]
python: [
{ interpreter: 'python3.13', package: 'python3.13' },
{ interpreter: 'python3.12', package: 'python3.12' },
Expand All @@ -80,23 +84,37 @@ jobs:
CFLAGS: "-Os -fstrict-aliasing -fno-plt -flto=full -emit-llvm"
LDFLAGS: "-fuse-ld=lld -Wl,-plugin-opt=also-emit-llvm -Wl,--as-needed -Wl,-zrelro,-znow"
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=lld -C linker-plugin-lto -C lto=fat -C link-arg=-Wl,-zrelro,-znow -Z mir-opt-level=4 -Z virtual-function-elimination -Z threads=2 -D warnings"
PATH: "/__w/orjson/orjson/.venv/bin:/github/home/.cargo/bin:/root/.local/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
container:
image: fedora:42
steps:

- name: cpuinfo
run: cat /proc/cpuinfo

- name: Build environment pre-clone
run: dnf install -y git

- uses: actions/checkout@v4

- name: Start container
if: '${{ matrix.arch }} != "x86_64"'
uses: sandervocke/setup-qemu-container@v1
with:
container: fedora:42
arch: ${{ matrix.arch }}
podman_args: "-v .:/orjson -v /tmp:/tmp --workdir /orjson"

- name: Setup Shell Wrapper
uses: sandervocke/setup-shell-wrapper@v1

- name: Use container shell
shell: bash
run: echo "WRAP_SHELL=run-in-container.sh" >> $GITHUB_ENV

- name: Build environment post-clone
shell: wrap-shell {0}
run: |
./script/install-fedora
echo $RUSTFLAGS
export PATH="/root/.cargo/bin:/orjson/.venv/bin:/root/.local/bin:$PATH"
maturin build --release --strip \
--features=avx512,no-panic,unstable-simd,yyjson \
--compatibility=manylinux_2_17 \
Expand Down Expand Up @@ -208,13 +226,6 @@ jobs:
{ version: '3.8', abi: 'cp38-cp38' },
]
target: [
{
arch: 'aarch64',
cflags: '-Os -flto=full -fstrict-aliasing',
features: 'no-panic,unstable-simd,yyjson',
rustflags: '-Z mir-opt-level=4 -C lto=fat -D warnings',
target: 'aarch64-unknown-linux-gnu',
},
{
arch: 'armv7',
cflags: '-Os -flto=full -fstrict-aliasing',
Expand Down

0 comments on commit 6a6b1f6

Please sign in to comment.