Use --zig in CI?
kevinheavey opened this issue ยท 4 comments
Hey! I like your CI workflow so I copy it quite closely in my projects ๐
I'm curious: do you think you'll use the new feature to cross-compile with Zig? I don't really understand it but I'm guessing you understand it
Thanks for the suggestion, I'm interested in making an example workflow that cross-compiles with Zig.
I've added --zig
support in maturin-action: PyO3/maturin-action#27 , the usage is quite simple:
diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml
index e8b2931..60294f6 100644
--- a/.github/workflows/CI.yml
+++ b/.github/workflows/CI.yml
@@ -120,7 +121,8 @@ jobs:
with:
target: ${{ matrix.target }}
manylinux: auto
- args: --release --out dist
+ args: --release --out dist --zig
- uses: uraimo/run-on-arch-action@v2.0.5
if: matrix.target != 'ppc64'
name: Install built wheel
It works for cross compiling to aarch64, but other architectures doesn't not work right now mostly due to ziglang/zig#4911. So currently it's not ready to replace Docker.
As of today, with zig 0.10 and maturin 0.14, only s390x fails: https://github.com/messense/rjieba-py/actions/runs/3801172545/jobs/6465356959
maturin-action now fallbacks to docker when --zig
isn't supported, so it mostly works now: https://github.com/messense/rjieba-py/actions/runs/4083633467