bazelbuild / rules_apple

Bazel rules to build apps for Apple platforms.
Apache License 2.0
510 stars 267 forks source link

Building a kernel extension for macOS using bazel #2561

Closed YungRaj closed 5 hours ago

YungRaj commented 6 hours ago

Hey all,

Is there a way to build kernel extensions for macOS using bazel?

I want to port https://github.com/YungRaj/MacRootKit to bazel so that I don't have to deal with the stress that comes with using another build system such as cmake. Any ideas?

I know that genrule()'s could probably work in building the .kext artifact but I think the major challenge is getting the Xcode frameworks and tooling to play nicely and ensuring that all the relevant compiler and linker flags (which I use here https://github.com/YungRaj/MacRootKit/blob/main/make_kext.mk) are included.

Thanks

brentleyjones commented 5 hours ago

I haven't used it personally, but the macos_kernel_extension rule exists.