openziti / tlsuv

TLS and HTTP(s) client library for libuv
https://docs.openziti.io/tlsuv/
MIT License
45 stars 7 forks source link

Cross-compilation CI for multi-platform testing of tlsuv #204

Open plajjan opened 9 months ago

plajjan commented 9 months ago

I think it would be nice with a CI workflow for this repo that would cross-compile for different platforms to ensure compatibility. I've recently opened #202 and #203 to fix issues around macos & ios support. I think that could have been avoided with more extensive testing.

I spent some time contributing to the Boehm GC repo (https://github.com/ivmai/bdwgc) of which cross-compilation was one part. We ported the CMake config to the Zig build system and then used zig's excellent cross-compilation support to run cross-compilation test jobs for multiple platform. Quite cool IMHO. We're also using zig as part of the Acton programming language (where tlsuv is also used). As part of that, I wrote a basic build.zig (https://github.com/actonlang/tlsuv/blob/zig-build-rebase20240211/build.zig), it is not fully fledged but builds the basic parts that are used in Acton. It can be used to do this kind of cross-compilation. I'm saying not fully fledged because I was really only interested in the TLS bits of tlsuv and not in a HTTP client with the dependency of llhttp and in turn node.js that I think it depends on, so the build.zig takes certain shortcuts.

If you agree this is a good idea, the plan forward could be something like