pact-foundation / pact-reference

Reference implementations for the pact specifications
https://pact.io
MIT License
91 stars 46 forks source link

Enabling Additional Targets: Windows ARM #325

Closed JP-Ellis closed 5 months ago

JP-Ellis commented 9 months ago

What appetite might there be to building additional targets supported by Rust? From my understanding, this should be somewhat straightforward to implement given Rust's cross-compilation abilities.

From the perspective of pact-python, the only limitation to supporting other platforms comes from the underlying library.

An interesting Python-backed-by-Rust project that could be worth looking at is ruff. In particular:

To avoid scrolling through the above, the list of targets is:

ruff-aarch64-apple-darwin.tar.gz
ruff-aarch64-pc-windows-msvc.zip
ruff-aarch64-unknown-linux-gnu.tar.gz
ruff-aarch64-unknown-linux-musl.tar.gz
ruff-armv7-unknown-linux-gnueabihf.tar.gz
ruff-armv7-unknown-linux-musleabihf.tar.gz
ruff-i686-pc-windows-msvc.zip
ruff-i686-unknown-linux-gnu.tar.gz
ruff-i686-unknown-linux-musl.tar.gz
ruff-powerpc64-unknown-linux-gnu.tar.gz
ruff-powerpc64le-unknown-linux-gnu.tar.gz
ruff-s390x-unknown-linux-gnu.tar.gz
ruff-x86_64-apple-darwin.tar.gz
ruff-x86_64-pc-windows-msvc.zip
ruff-x86_64-unknown-linux-gnu.tar.gz
ruff-x86_64-unknown-linux-musl.tar.gz

Happy to get an idea for the appetite on this first before looking at implementing this.

EDIT: A lot of the platforms above are rather legacy (powerpc, 32-bit windows and linux). The only two that stand out as being more common are:

rholshausen commented 9 months ago

The main issue is supporting these. If one of those targets stops working, who diagnoses and fixes the issues? We only want to support targets that people are actually using. For instance, Java just dropped support for 32 bit Windows in the latest version, so I don't see anyone else using those targets (for instance, any of i686 ones).

JP-Ellis commented 9 months ago

Completely agree that adding support for platforms which are going out of support (powerpc, i686, etc.) probably is not be worth it.

I think the main one that is missing from the list is Windows ARM, which I don't think should be too difficult to add.

YOU54F commented 9 months ago

Building windows on arm for rust requires a workaround documented in this PR

https://github.com/pact-foundation/pact-reference/pull/276/files#diff-bde61993c1158b79f909f73f5d29986058a2f43bdc40ec770be49110774d3019R87

we've not had any requests for 32-bit versions of the ffi lib, of any flavour, nor any additional platforms (BSD's, powerpc64 / s390x)

I don't believe we have any CI hardware (or VM capabilities) to test powerpc64 / s390x. I built 32bit arm docker images for the pact-cli and pact-broker, and tested them out on a rasp pi 3 that I have on the shelf

I'm open to trying to build for every target - but without being able to test them, means we can't even tell if they even work, beyond building them.

If there are some ways to test powerpc64 / s390x locally or via CI, I'd be open to hear about it, but I don't think its a valuable use of our time, given the lack of demand.

(We've not had requests for arm64 windows flavours yet - It's only me who was interested in building aarch64 windows as I use a windows vm for x plat testing alot. Note the x86_64 binaries for rust and ruby are fine - albeit with some vcredist patches or a dev preview build for ruby)

YOU54F commented 9 months ago

The blocker for windows aarch64 is in ring v16.20 - there is a few tracking issues and a fix made by the community, which I've been testing and works great for me.

Relevant posts

JP-Ellis commented 9 months ago

Good to know! I'll change the title of this issue to specifically address the Windows ARM build :)

mefellows commented 3 months ago

We've had x86 requests on Windows before: https://github.com/pact-foundation/pact-net/issues/448