aantron / luv

Cross-platform asynchronous I/O and system calls
https://aantron.github.io/luv
MIT License
276 stars 26 forks source link

Support building with older versions of libuv that may be installed on the system #97

Closed aantron closed 3 years ago

aantron commented 3 years ago

Will resolve #96. cc @andyli.

aantron commented 3 years ago

With enough shims, I've gotten Luv to build against every libuv starting from 1.3.0. This will cover all the distros linked by @andyli here — as @andyli already mentioned in #94, the lowest libuv version that is included in distros that include libuv 1.x is 1.8.0. Some distros seem to have libuv 0.x, but Luv definitely will not support that.

At 1.3.0 there is an ABI change that is slightly difficult to bind across using Ctypes, but it can be worked around by hiding a struct field behind an accessor function. I decided not to bother with it and just stop, because 1.3.0 is, again, older than 1.8.0.

I'll now work on all the docs on using the shims safely, and review the exact behavior of all the shims. Most just fail with ENOSYS, but some have to forward to existing functions — for the latter, I need to make sure no surprising behavior is triggered, probably by returning ENOSYS at the OCaml level when unsupported option arguments are used, etc.