Skip to content
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

kube-derive now requires explicit kube-core dependency #525

Closed
clux opened this issue May 18, 2021 · 6 comments · Fixed by #528
Closed

kube-derive now requires explicit kube-core dependency #525

clux opened this issue May 18, 2021 · 6 comments · Fixed by #528
Labels
bug Something isn't working derive kube-derive proc_macro related

Comments

@clux
Copy link
Member

clux commented May 18, 2021

An unforseen outcome of kube-core is that the proc_macro expects kube-core crate to be available at macro-expansion.

This is fine in this workspace (where we use all the crates), but outside, people now need an explicit dependency on kube-core, that's NOT intended, and am consider yanking this release :/

Tried upgrading `controller-rs``:

   Compiling controller v0.10.0 (/home/clux/repos/controller-rs)
error[E0433]: failed to resolve: use of undeclared crate or module `kube_core`
  --> src/manager.rs:27:10
   |
27 | #[derive(CustomResource, Deserialize, Serialize, Clone, Debug, JsonSchema)]
   |          ^^^^^^^^^^^^^^ use of undeclared crate or module `kube_core`
   |
   = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0433]: failed to resolve: use of undeclared crate or module `kube_core`
  --> src/manager.rs:27:10
   |
27 | #[derive(CustomResource, Deserialize, Serialize, Clone, Debug, JsonSchema)]
   |          ^^^^^^^^^^^^^^ not found in `kube_core::api_resource`

@clux clux added bug Something isn't working derive kube-derive proc_macro related labels May 18, 2021
@clux
Copy link
Member Author

clux commented May 18, 2021

Yeah, I missed this point, and don't think we can work around it at the moment. Think we need to make kube a more additive crate, with features:

  • core (re-export kube-core)
  • client
  • service
  • config
  • derive

And possibly having everything but derive be default. Anyway, I am going to yank this for now.

@kflansburg
Copy link
Contributor

Hmmm, sorry about this, I thought I had made this clear in the original PR.

@kazk
Copy link
Member

kazk commented May 19, 2021

Yeah, we can probably do the following:

  • Enable opting out of most features in kube. We can, but don't need to break it up that much. We can do that later when necessary. Maybe just add client feature that's enabled by default for non-core.
  • Reexport kube-core under kube::core, and rewrite #[derive(CustomResource)] to use kube::core
  • Then for Eliminate kube-derive Dependency on kube #516, users can do kube = { version = "^0.55.0", default-features = false, features = ["derive"] } to get minimal kube without problematic dependencies.

@kflansburg
Copy link
Contributor

As a short-term fix, I've put together #527 which restores the original import, but provides a flag for depending on kube-core instead.

I imagine that the other proposals will take some time to accomplish, so I figured this short term fix could be useful.

clux added a commit that referenced this issue May 19, 2021
@kazk kazk linked a pull request May 20, 2021 that will close this issue
@clux clux closed this as completed in #528 May 20, 2021
clux added a commit that referenced this issue May 20, 2021
create a client feature in kube #525
@clux
Copy link
Member Author

clux commented May 20, 2021

As a short-term fix, I've put together #527 which restores the original import, but provides a flag for depending on kube-core instead.

I imagine that the other proposals will take some time to accomplish, so I figured this short term fix could be useful.

I appreciate the solution there. I was close to merging it, but figured we could do it the harder way, which is now merged.

Hmmm, sorry about this, I thought I had made this clear in the original PR.

Yeah, I had just failed to recognise this point, not your fault.
Thanks again for the kube-core split idea, it has made the api module a lot more cleanly delineated.

@clux
Copy link
Member Author

clux commented May 21, 2021

released in 0.55.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working derive kube-derive proc_macro related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants