-
-
Notifications
You must be signed in to change notification settings - Fork 325
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
#[derive(CustomResource)] path dependencies #227
Comments
Oh, interesting. You mean like having the macro generate code that depends on something like: use kube_derive::serde_json::Deserialize; Would that work? I don't want |
Yeah, could be. Goal is to reduce number of dependencies on external state in the custom derive. //edit: I don't know whether you can import regular items from proc-macro crate. |
Revisiting this. Having dug into this more, turns out there's an open issue in rust-lang about this being hard: rust-lang/rust#54363 Practically, we would need some way to refer to the up to three runtime dependencies
As per the PR, I don't want to re-export these from If it was possible for Unfortunately, proc_macro crates do not support this:
Thus, I am going to close this for now. Unless there's movement on this from the rust side, we are just going to list that you need to have these 2/3 crates available in scope - and not renamed - for |
clarify inability to handle crate renames in kube-derive - closes #227
Current implementation of custom derive has a bunch or implicit assumptions about outer environment, which requires user to import crates under specific names.
I like to rename
serde_json
andk8s_openapi
tojson
andk8s
respectively, and It's impossible to do so currentlyChanging the paths in the macro output to use undocumented re-exports from kube crate would solve this.
The text was updated successfully, but these errors were encountered: