Some checks failed
CI / build (-Dbuild-tests -Dbuild-benchmarks, true, macos-latest, 0.15.2) (push) Has been cancelled
CI / build (macos-latest, 0.14.1) (push) Has been cancelled
CI / build (macos-latest, master) (push) Has been cancelled
CI / build (ubuntu-latest, 0.14.1) (push) Has been cancelled
CI / build (ubuntu-latest, 0.15.2) (push) Has been cancelled
CI / build (ubuntu-latest, master) (push) Has been cancelled
CI / build (windows-latest, 0.14.1) (push) Has been cancelled
CI / build (windows-latest, 0.15.2) (push) Has been cancelled
CI / build (windows-latest, master) (push) Has been cancelled
48 lines
1.8 KiB
Markdown
48 lines
1.8 KiB
Markdown
# libuv
|
|
|
|
This is [`libuv`][libuv], packaged for [Zig](https://ziglang.org/).
|
|
|
|
## Status
|
|
|
|
In theory, the full intersection of platforms supported by libuv and platforms supported by Zig are supported build targets, but the less common targets are not tested.
|
|
|
|
Building the unit test executable for linux (and possibly other platforms) does not currently work because the unit test files directly `#include` some of the libuv source files (while also linking to `libuv.a`), and that causes duplicate symbol errors unless the linker command is assembled in a specific order. The zig build system does not enforce a specific order.
|
|
|
|
## Usage
|
|
|
|
First, update your `build.zig.zon`:
|
|
|
|
```sh
|
|
# Initialize a zig project if you haven't already
|
|
zig init
|
|
# replace <refname> with the version you want to use, e.g. 1.51.0
|
|
zig fetch --save git+https://github.com/allyourcodebase/libuv.git#<refname>
|
|
```
|
|
|
|
You can then import `libuv` in your `build.zig` with:
|
|
|
|
```zig
|
|
const libuv_dep = b.dependency("libuv", .{
|
|
.target = target,
|
|
.optimize = optimize,
|
|
});
|
|
your_exe.linkLibrary(libuv_dep.artifact("uv"));
|
|
```
|
|
|
|
## Dependencies
|
|
|
|
`libuv` only depends on core operating system libraries (and libc).
|
|
|
|
## Zig Version Support Matrix
|
|
|
|
> [!IMPORTANT]
|
|
> Compatible zig versions labeled `-dev` are maintained on a best-effort basis and are likely to break as the compiler and zig build system develop. Tag-based refs are immutable and will not be updated when the zig build system has a backward incompatible change.
|
|
|
|
| Refname | libuv Version | Compatible Zig Version(s) |
|
|
|-----------|----------------|--------------------------------|
|
|
| `master` | `1.52.0` | `0.14.1`, `0.15.2`, `0.16-dev` |
|
|
| `v1.51.0` | `1.51.0` | `0.14.1`, `0.15.2`, `0.16-dev` |
|
|
| `v1.50.0` | `1.50.0` | `0.14.1`, `0.15.2` |
|
|
|
|
[libuv]: https://github.com/libuv
|