-
Notifications
You must be signed in to change notification settings - Fork 450
Rename libmodule to libmacros #306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Renaming to libmacros allows us to potentially have more procedural macros in the future without introducing additional crates. Having all our proc macros in a single crate allows potential code sharing between macros, and it simplifies the build process compared to multiple crates. Multiple crate does allow parallel compilation, but given the limited number of proc macros at this stage, the compilation time difference is negligible. Even when we have a big `macros` crate we can still use multiple codegen units while keep them in a single crate. Signed-off-by: Gary Guo <gary@garyguo.net>
Review of
|
Looks fine to me. I let others comment in case someone thinks about any other pros/cons. Off-topic: things would look better if the restriction on the entry points being in the root crate is lifted. Alas... |
I like that this is moving to its own directory. Another thought I had some time back: can we move this to a directory outside WDYT? |
I don't think anything in But anyway I think it's the best to keep it within Rust directory, because even though itself is not compiled into the kernel, it does generate code that's compiled, and many of which is from templates. |
There is From a quick look at history, there was not much fuss when creating the
I thought about this when I set the initial support, not just for procedural macros but also other bits like the bindings etc. My idea was that, at least initially, it would be best to "contain" Rust as much as possible within For kernel code, it seems like that is still the right choice. For procedural macros, I think it makes the most sense them close to the code too, since they are, after all, very tied to it. They not only generate Rust code in-place (in contrast with other host programs that generate e.g. a new C file or header); they also parse some kind of input (whether Rust code or not) that comes from Rust source files themselves too (rather than, e.g. from a non-C file). Is this approach fine for the kernel? A few places also put their own host binaries that generate C code alongside the kernel C code, e.g. One could argue that e.g. |
LGTM! |
Split from #278