kdash-rs / kdash

A simple and fast dashboard for Kubernetes
https://kdash.cli.rs
MIT License
2.1k stars 78 forks source link

Cargo install fails when compiling k8s-openapi #111

Closed TobiasDeBruijn closed 3 years ago

TobiasDeBruijn commented 3 years ago

Describe the bug When running cargo install to install kdash, it'll fail to compile k8s-openapi:

  None of the v1_* features are enabled on the k8s-openapi crate.

  The k8s-openapi crate requires a feature to be enabled to indicate which version of Kubernetes it should support.

This is likely a configuration issue in kdash, and not a bug in k8s-openapi

To Reproduce

  1. Run cargo install kdash
  2. Observe

Expected behavior cargo finishes successfully and kdash is installed

Screenshots N,A.

Desktop (please complete the following information):

Fails on:

  1. 0.2.3 (latest)
  2. 0.2.2
  3. 0.2.1
  4. 0.2.0
  5. 0.1.2

Works on:

  1. 0.1.1 # Had to install libxcb-xfixes0-dev and libxcb-xfixes0 first.
  2. 0.1.0

It appears the regression was thus introduced in 0.1.2

Additional context Cargo version: cargo 1.55.0 (32da73ab1 2021-08-23) rustc version: rustc 1.55.0 (c8dfcfe04 2021-09-06) rustup version: rustup 1.24.3 (ce5817a94 2021-05-31) stable toolchain

Full output:

tobias@DESKTOP-M130L88:~$ cargo install kdash --version 0.1.2
  Downloaded kdash v0.1.2
  Downloaded 1 crate (4.4 MB) in 2.25s
    Updating crates.io index
  Installing kdash v0.1.2
  Downloaded snafu v0.6.10
  Downloaded doc-comment v0.3.3
  Downloaded snafu-derive v0.6.10
  Downloaded dashmap v4.0.2
  Downloaded kube v0.56.0
  Downloaded kube-core v0.56.0
  Downloaded kube-runtime v0.56.0
  Downloaded k8s-openapi v0.11.0
  Downloaded 8 crates (5.4 MB) in 1.73s (largest was `k8s-openapi` at 5.3 MB)
   Compiling libc v0.2.102
   Compiling autocfg v1.0.1
   Compiling proc-macro2 v1.0.29
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.77
   Compiling cfg-if v1.0.0
   Compiling memchr v2.4.1
   Compiling log v0.4.14
   Compiling once_cell v1.8.0
   Compiling cc v1.0.70
   Compiling pin-project-lite v0.2.7
   Compiling serde_derive v1.0.130
   Compiling futures-core v0.3.17
   Compiling serde v1.0.130
   Compiling itoa v0.4.8
   Compiling bytes v1.1.0
   Compiling proc-macro-hack v0.5.19
   Compiling futures-task v0.3.17
   Compiling futures-channel v0.3.17
   Compiling lazy_static v1.4.0
   Compiling futures-sink v0.3.17
   Compiling proc-macro-nested v0.1.7
   Compiling ryu v1.0.5
   Compiling slab v0.4.4
   Compiling fnv v1.0.7
   Compiling pkg-config v0.3.20
   Compiling hashbrown v0.11.2
   Compiling bitflags v1.3.2
   Compiling pin-utils v0.1.0
   Compiling futures-io v0.3.17
   Compiling serde_json v1.0.68
   Compiling base64 v0.13.0
   Compiling adler v1.0.2
   Compiling matches v0.1.9
   Compiling foreign-types-shared v0.1.1
   Compiling openssl v0.10.36
   Compiling version_check v0.9.3
   Compiling crc32fast v1.2.1
   Compiling httparse v1.5.1
   Compiling percent-encoding v2.1.0
   Compiling tower-service v0.3.1
   Compiling try-lock v0.2.3
   Compiling parking_lot_core v0.8.5
   Compiling smallvec v1.6.1
   Compiling native-tls v0.2.8
   Compiling regex-syntax v0.6.25
   Compiling httpdate v1.0.1
   Compiling tinyvec_macros v0.1.0
   Compiling scopeguard v1.1.0
   Compiling openssl-probe v0.1.4
   Compiling unicode-width v0.1.9
   Compiling linked-hash-map v0.5.4
   Compiling tower-layer v0.3.1
   Compiling pin-project-internal v0.4.28
   Compiling k8s-openapi v0.11.0
   Compiling dtoa v0.4.8
   Compiling either v1.6.1
   Compiling unicode-bidi v0.3.6
   Compiling k8s-openapi v0.13.0
   Compiling static_assertions v1.1.0
   Compiling doc-comment v0.3.3
   Compiling unicode-segmentation v1.8.0
   Compiling untrusted v0.7.1
   Compiling spin v0.5.2
   Compiling strsim v0.8.0
   Compiling gimli v0.25.0
   Compiling vec_map v0.8.2
   Compiling ansi_term v0.11.0
   Compiling ppv-lite86 v0.2.10
   Compiling anyhow v1.0.44
   Compiling rustc-demangle v0.1.21
   Compiling termcolor v1.1.2
   Compiling smawk v0.3.1
   Compiling cassowary v0.3.0
   Compiling instant v0.1.11
   Compiling tokio v1.12.0
   Compiling num-traits v0.2.14
   Compiling futures-macro v0.3.17
   Compiling indexmap v1.7.0
   Compiling futures-util v0.3.17
   Compiling num-integer v0.1.44
   Compiling miniz_oxide v0.4.4
   Compiling openssl-src v111.16.0+1.1.1l
   Compiling tracing-core v0.1.20
   Compiling http v0.2.5
   Compiling ring v0.16.20
   Compiling backtrace v0.3.61
   Compiling foreign-types v0.3.2
   Compiling form_urlencoded v1.0.1
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling tinyvec v1.5.0
   Compiling lock_api v0.4.5
   Compiling textwrap v0.11.0
   Compiling yaml-rust v0.4.5
   Compiling itertools v0.10.1
   Compiling twox-hash v1.6.1
error: failed to run custom build command for `k8s-openapi v0.13.0`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installG6ZlmT/release/build/k8s-openapi-80fb7a754af4404d/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at '
  None of the v1_* features are enabled on the k8s-openapi crate.

  The k8s-openapi crate requires a feature to be enabled to indicate which version of Kubernetes it should support.

  If you're using k8s-openapi in a binary crate, enable the feature corresponding to the minimum version of API server that you want to support. It may be possible that your binary crate does not directly depend on k8s-openapi. In this case, add a dependency on k8s-openapi, then enable the corresponding feature.

  If you're using k8s-openapi in a library crate, add a dev-dependency on k8s-openapi and enable one of the features there. This way the feature will be enabled when buildings tests and examples of your library, but not when building the library itself. It may be possible that your library crate does not directly depend on k8s-openapi. In this case, add a dev-dependency on k8s-openapi, then enable the corresponding feature.

  Library crates *must not* enable any features in their direct dependency on k8s-openapi, only in their dev-dependency. The choice of Kubernetes version to support should be left to the final binary crate, so only the binary crate should enable a specific feature. If library crates also enable features, it can cause multiple features to be enabled simultaneously, which k8s-openapi does not support.

  If you want to restrict your library crate to support only a single specific version or range of versions of Kubernetes, please use the k8s_* version-specific macros to emit different code based on which feature gets enabled in the end.', /home/tobias/.cargo/registry/src/github.com-1ecc6299db9ec823/k8s-openapi-0.13.0/build.rs:9:42
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `kdash v0.1.2`, intermediate artifacts can be found at `/tmp/cargo-installG6ZlmT`

Caused by:
  build failed
deepu105 commented 3 years ago

Hi I have fixed this already. Will release it tomorrow

TobiasDeBruijn commented 3 years ago

Awesome! Thanks for your efforts!

deepu105 commented 3 years ago

I made a new release 0.2.4, can you please try that? it should be available in few minutes

TobiasDeBruijn commented 3 years ago

It sure does work! Thanks for your efforts!