Closed kassane closed 1 year ago
@kassane sorry, can you tl;dr what's your ask w.r.t. libbpf and its support for zig's build system?
Wow, that's amazing, I'm pleasure to use zig's builtin package manage if libbpf supports it.
@kassane sorry, can you tl;dr what's your ask w.r.t. libbpf and its support for zig's build system?
Yes! Would you accept to add to the zig-build project? (Avoiding libbpf parallel version).
Unfortunately zig cc/zig c++
is quite complicated on conventional build-systems because of the space in the subcommand ' '. Besides, zig-build/zig-pkg is not restricted to ziglang projects.
Ah, sorry for misleading you. I assumed you'd like use to adjust libbpf's Makefile (or something about layout, etc) to make it easier to build libbpf with Zig-related infrastructure. Adding and maintaining parallel Zig build script for libbpf is not something I'd like to do, sorry. Hopefully it won't be too much trouble to maintain this on the side.
Hi @kassane
I'm afraid we may hold this PR a while due to some fixup on vendored libbpf (https://github.com/tw4452852/zbpf/commit/bad505e019b61854a334a11e95275ba50f9fb688). Because it's Zig specific so I'm afraid it would not be accepted on upstream.
Ok.
The main purpose of this PR is to avoid static dependencies. But already aware of this possibility from the new zig version, you can find better use.
Hi @kassane
As 0.1.0 is released, zbpf embraces Zig's package manager for the external dependencies. FYI.
As 0.1.0 is released, zbpf embraces Zig's package manager for the external dependencies. FYI.
@tw4452852, awesome. I will test it and give feedback.
The fork is the initial support base for zig developers, in addition to trying zig-pkg (MVP) v0.11.x-dev. Later it will be able to be linked into any zig project without depending on external tools (maybe porting to zig-build libelf-dev too)
Note: Theoretically it works similar to
go mod
orfetchContent (cmake)
.cc: @anakryiko - If the original project can support the zig build-system, then just replace (
kassane/libbpf
->libbpf/libbpf
) the url + hash in the zon file of this binding. See: https://github.com/libbpf/libbpf/compare/master...kassane:libbpf:zig-pkgMore info about zig-pkg