k8s-openapi icon indicating copy to clipboard operation
k8s-openapi copied to clipboard

Selectively build API groups?

Open nightkr opened this issue 5 years ago • 1 comments
trafficstars

k8s-openapi compiles very slowly. That isn't really a dig on it, it's just a big crate.

But it would be nice if we could opt in to which APIs are actually relevant.

I figure a decent first approximation would be to have a cargo feature per apiVersion, which are already used for module separation anyway.

nightkr avatar Oct 02 '20 13:10 nightkr

It's not impossible, though it will require the codegen process to keep track of cross-module dependencies. Eg everything depends on meta/v1, so enabling anything else should also enable the meta/v1 feature. (Well, meta/v1 will need to be enabled by default anyway because of how fundamental it is, but you get the idea.)

Also, the feature names will have to incorporate the whole path so that they're unambiguous, eg apimachinery/pkg/api/resource -> "apimachinery_pkg_api_resource"

Arnavion avatar Oct 02 '20 17:10 Arnavion