-
Notifications
You must be signed in to change notification settings - Fork 450
Split bindings crate out of the main kernel crate #822
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
I didn't add rustdoc or testing code for the bindings crate as I didn't think it would be necessary. It already wasn't documented thanks to |
1022121
to
65101b9
Compare
How do I add a dependency on bindings to kernel for rustdoc tests? |
This should solve the CI issue: @@ -129,6 +129,9 @@ quiet_cmd_rustc_test_library = RUSTC TL $<
-L$(objtree)/$(obj)/test \
--crate-name $(subst rusttest-,,$(subst rusttestlib-,,$@)) $<
+rusttestlib-bindings: $(src)/bindings/lib.rs rusttest-prepare FORCE
+ $(call if_changed,rustc_test_library)
+
rusttestlib-build_error: $(src)/build_error.rs rusttest-prepare FORCE
$(call if_changed,rustc_test_library)
@@ -239,7 +242,7 @@ rusttest-macros: $(src)/macros/lib.rs rusttest-prepare FORCE
rusttest-kernel: private rustc_target_flags = --extern alloc \
--extern build_error --extern macros --extern bindings
rusttest-kernel: $(src)/kernel/lib.rs rusttest-prepare \
- rusttestlib-build_error rusttestlib-macros FORCE
+ rusttestlib-bindings rusttestlib-build_error rusttestlib-macros FORCE
$(call if_changed,rustc_test)
$(call if_changed,rustc_test_library) |
65101b9
to
7eeb0e3
Compare
The generated bindings are mostly static when working on new rust abstractions. By splitting them off the main kernel crate, recompilation of the main kernel crate takes ~2s rather than ~12s. While this loses some optimizations without LTO, the fast majority of the binding functions are already marked as `#[inline]`. Pretty much only `Default` impls aren't marked as such. The cost of not inlining those `Default` impls is likely neglectable. Signed-off-by: Björn Roy Baron <[email protected]>
Signed-off-by: Björn Roy Baron <[email protected]>
7eeb0e3
to
521024c
Compare
CI passes now. |
Great work! |
Had just a type alias on which I implemented my stuff. Guess I have to change that now, as I can't implement for types outside the crate :) |
The generated bindings are mostly static when working on new rust
abstractions. By splitting them off the main kernel crate, recompilation
of the main kernel crate takes ~2s rather than ~12s. While this loses
some optimizations without LTO, the fast majority of the binding
functions are already marked as
#[inline]
. Pretty much onlyDefault
impls aren't marked as such. The cost of not inlining thoseDefault
impls is likely neglectable.Signed-off-by: Björn Roy Baron [email protected]