Skip to content

Compute does not build with --no-default-features #6220

Description

@dbolduc

Repro:

cargo new test-compute && cd test-compute
cargo add google-cloud-compute-v1 --no-default-features
cargo build
Output:
error[E0432]: unresolved imports `crate::model::InstancesBulkInsertOperationMetadata`, `crate::model::SetCommonInstanceMetadataOperationMetadata`
      --> /usr/local/google/home/dbolduc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/google-cloud-compute-v1-3.3.0/src/errors.rs:16:5
       |
    16 |     InstancesBulkInsertOperationMetadata, SetCommonInstanceMetadataOperationMetadata,
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `SetCommonInstanceMetadataOperationMetadata` in `model`
       |     |
       |     no `InstancesBulkInsertOperationMetadata` in `model`
       |
note: found an item that was configured out
      --> /usr/local/google/home/dbolduc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/google-cloud-compute-v1-3.3.0/src/model.rs:159288:12
       |
159174 |   #[cfg(any(
       |  __________-
159175 | |     feature = "addresses",
159176 | |     feature = "autoscalers",
159177 | |     feature = "backend-buckets",
...      |
159284 | |     feature = "zone-vm-extension-policies",
159285 | | ))]
       | |_- the item is gated here
...
159288 |   pub struct InstancesBulkInsertOperationMetadata {
       |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: found an item that was configured out
      --> /usr/local/google/home/dbolduc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/google-cloud-compute-v1-3.3.0/src/model.rs:359762:12
       |
359648 |   #[cfg(any(
       |  __________-
359649 | |     feature = "addresses",
359650 | |     feature = "autoscalers",
359651 | |     feature = "backend-buckets",
...      |
359758 | |     feature = "zone-vm-extension-policies",
359759 | | ))]
       | |_- the item is gated here
...
359762 |   pub struct SetCommonInstanceMetadataOperationMetadata {
       |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0432]: unresolved import `crate::model::Operation`
      --> /usr/local/google/home/dbolduc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/google-cloud-compute-v1-3.3.0/src/operation.rs:15:5
       |
    15 | use crate::model::Operation;
       |     ^^^^^^^^^^^^^^^^^^^^^^^ no `Operation` in `model`
       |
note: found an item that was configured out
      --> /usr/local/google/home/dbolduc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/google-cloud-compute-v1-3.3.0/src/model.rs:253564:12
       |
253450 |   #[cfg(any(
       |  __________-
253451 | |     feature = "addresses",
253452 | |     feature = "autoscalers",
253453 | |     feature = "backend-buckets",
...      |
253560 | |     feature = "zone-vm-extension-policies",
253561 | | ))]
       | |_- the item is gated here
...
253564 |   pub struct Operation {
       |              ^^^^^^^^^

error[E0433]: failed to resolve: could not find `operation` in `model`
      --> /usr/local/google/home/dbolduc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/google-cloud-compute-v1-3.3.0/src/errors.rs:114:39
       |
   114 |     pub details: Option<crate::model::operation::Error>,
       |                                       ^^^^^^^^^ could not find `operation` in `model`
       |
note: found an item that was configured out
      --> /usr/local/google/home/dbolduc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/google-cloud-compute-v1-3.3.0/src/model.rs:254883:9
       |
254771 |   #[cfg(any(
       |  __________-
254772 | |     feature = "addresses",
254773 | |     feature = "autoscalers",
254774 | |     feature = "backend-buckets",
...      |
254881 | |     feature = "zone-vm-extension-policies",
254882 | | ))]
       | |_- the item is gated here
254883 |   pub mod operation {
       |           ^^^^^^^^^

error[E0433]: failed to resolve: could not find `operation` in `model`
      --> /usr/local/google/home/dbolduc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/google-cloud-compute-v1-3.3.0/src/errors.rs:162:46
       |
   162 | ...::model::operation::Error>>(mut self, v: V) -> Self {
       |             ^^^^^^^^^ could not find `operation` in `model`
       |
note: found an item that was configured out
      --> /usr/local/google/home/dbolduc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/google-cloud-compute-v1-3.3.0/src/model.rs:254883:9
       |
254771 |   #[cfg(any(
       |  __________-
254772 | |     feature = "addresses",
254773 | |     feature = "autoscalers",
254774 | |     feature = "backend-buckets",
...      |
254881 | |     feature = "zone-vm-extension-policies",
254882 | | ))]
       | |_- the item is gated here
254883 |   pub mod operation {
       |           ^^^^^^^^^

error[E0425]: cannot find type `Operation` in module `crate::model`
      --> /usr/local/google/home/dbolduc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/google-cloud-compute-v1-3.3.0/src/errors.rs:19:20
       |
    19 | impl crate::model::Operation {
       |                    ^^^^^^^^^ not found in `crate::model`
       |
note: found an item that was configured out
      --> /usr/local/google/home/dbolduc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/google-cloud-compute-v1-3.3.0/src/model.rs:253564:12
       |
253450 |   #[cfg(any(
       |  __________-
253451 | |     feature = "addresses",
253452 | |     feature = "autoscalers",
253453 | |     feature = "backend-buckets",
...      |
253560 | |     feature = "zone-vm-extension-policies",
253561 | | ))]
       | |_- the item is gated here
...
253564 |   pub struct Operation {
       |              ^^^^^^^^^

error[E0433]: failed to resolve: could not find `operation` in `model`
      --> /usr/local/google/home/dbolduc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/google-cloud-compute-v1-3.3.0/src/operation.rs:23:43
       |
    23 |         self.status == Some(crate::model::operation::Status::Done)
       |                                           ^^^^^^^^^ could not find `operation` in `model`
       |
note: found an item that was configured out
      --> /usr/local/google/home/dbolduc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/google-cloud-compute-v1-3.3.0/src/model.rs:254883:9
       |
254771 |   #[cfg(any(
       |  __________-
254772 | |     feature = "addresses",
254773 | |     feature = "autoscalers",
254774 | |     feature = "backend-buckets",
...      |
254881 | |     feature = "zone-vm-extension-policies",
254882 | | ))]
       | |_- the item is gated here
254883 |   pub mod operation {
       |           ^^^^^^^^^
help: consider importing one of these structs
       |
    15 + use gaxi::grpc::tonic::Status;
       |
    15 + use google_cloud_gax::error::rpc::Status;
       |
    15 + use google_cloud_rpc::model::Status;
       |
help: if you import `Status`, refer to it directly
       |
    23 -         self.status == Some(crate::model::operation::Status::Done)
    23 +         self.status == Some(Status::Done)
       |

error[E0282]: type annotations needed
  --> /usr/local/google/home/dbolduc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/google-cloud-compute-v1-3.3.0/src/errors.rs:26:61
   |
26 | ...).fold(error, |e, v| e.set_details(v));
   |                   ^     - type must be known at this point
   |
help: consider giving this closure parameter an explicit type
   |
26 |             let error = self.error.into_iter().fold(error, |e: /* Type */, v| e.set_details(v));
   |                                                              ++++++++++++

error[E0282]: type annotations needed
  --> /usr/local/google/home/dbolduc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/google-cloud-compute-v1-3.3.0/src/errors.rs:30:31
   |
30 |                 .fold(error, |e, v| e.set_status_code(v));
   |                               ^     - type must be known at this point
   |
help: consider giving this closure parameter an explicit type
   |
30 |                 .fold(error, |e: /* Type */, v| e.set_status_code(v));
   |                                ++++++++++++

error[E0282]: type annotations needed
  --> /usr/local/google/home/dbolduc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/google-cloud-compute-v1-3.3.0/src/errors.rs:34:31
   |
34 |                 .fold(error, |e, v| e.set_message(v));
   |                               ^     - type must be known at this point
   |
help: consider giving this closure parameter an explicit type
   |
34 |                 .fold(error, |e: /* Type */, v| e.set_message(v));
   |                                ++++++++++++

error[E0282]: type annotations needed
  --> /usr/local/google/home/dbolduc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/google-cloud-compute-v1-3.3.0/src/operation.rs:59:30
   |
59 |                 code = match err_code.as_str() {
   |                              ^^^^^^^^ cannot infer type

error[E0282]: type annotations needed
  --> /usr/local/google/home/dbolduc/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/google-cloud-compute-v1-3.3.0/src/operation.rs:65:27
   |
65 |                 message = err_msg.clone();
   |                           ^^^^^^^ cannot infer type

Some errors have detailed explanations: E0282, E0425, E0432, E0433.
For more information about an error, try `rustc --explain E0282`.
error: could not compile `google-cloud-compute-v1` (lib) due to 11 previous errors

We probably want to gate the extra modules as an OR over the PerServiceFearures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🚨 criticalThis issue needs some love.api: computeIssues related to the Compute Engine API.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions