Skip to content

Cannot compile a workspace when using different runtimes with SQLx #894

@dsferruzza

Description

@dsferruzza

Hi!

I have a project that is organized with a Cargo workspace which contains 2 inner crates:

  1. an Actix Web app
  2. a worker, that uses the async-std runtime

Both apps depends on SQLx 0.4.1 with default features disabled and different runtime features:

  1. runtime-actix-rustls
  2. runtime-async-std-rustls

Both apps compile and work just fine from their own sub-directory, but compiling at the workspace level gives the following error:

error: only one of ['runtime-actix-native-tls', 'runtime-async-std-native-tls', 'runtime-tokio-native-tls', 'runtime-actix-rustls', 'runtime-async-std-rustls', 'runtime-tokio-rustls'] can be enabled
  --> C:\Users\D\.cargo\registry\src\github.com-1ecc6299db9ec823\sqlx-rt-0.2.0\src\lib.rs:21:1
   |
21 | / compile_error!(
22 | |     "only one of ['runtime-actix-native-tls', 'runtime-async-std-native-tls', \
23 | |      'runtime-tokio-native-tls', 'runtime-actix-rustls', 'runtime-async-std-rustls', \
24 | |      'runtime-tokio-rustls'] can be enabled"
25 | | );
   | |__^

Is there any way to fix this and allow compiling the whole workspace at once?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions