Closed flavio closed 1 year ago
One way to resolve this is to add a feature to your library that enables one of the k8s-openapi
v1_*
features and is used only when running such commands.
The point of that line in the docs is that you define the __check
feature as you did and then run cargo check --features __check
. Just cargo check
will continue to fail.
I'll change it to not use passive voice so that it's clear that it's not like it's a cargo behavior to use that feature automatically.
I'll change it to not use passive voice so that it's clear that it's not like it's a cargo behavior to use that feature automatically.
Thanks! I was hoping that cargo check
would run by default with this feature by default :sweat_smile:
@flavio You're likely seeing this because of the resolver change in rust 2021.
What we do to make this more ergonomic for libraries (that are ultimately not responsible for picking kubernetes versions) without breaking cargo check
/ cargo publish
, is to add a dev-dep entry to k8s-openapi for local use:
[dev-dependencies.k8s-openapi]
version = "0.16.0"
default-features = false
features = ["v1_25"]
@clux this is not taken into account by commands like cargo check
. This works only when doing cargo test
.
The documentation of the project is already clear about this limitation.
I've just upgraded a project to use rust edition 2021 and suddenly
cargo check
started to fail becauseNone of the v1_* features are enabled on the k8s-openapi crate
.I've edited the
Cargo.toml
to add the snippet mentioned inside of the readme:However this seems to be ignored:
Am I doing something wrong?
Environment
If you want you can see the failure happening here: https://github.com/kubewarden/policy-evaluator/pull/216