Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlx-cli 0.5.10 install fails if only built with postgres feature #1604

Closed
bk138 opened this issue Dec 30, 2021 · 9 comments
Closed

sqlx-cli 0.5.10 install fails if only built with postgres feature #1604

bk138 opened this issue Dec 30, 2021 · 9 comments

Comments

@bk138
Copy link

bk138 commented Dec 30, 2021

To repro:

# as per https://crates.io/crates/sqlx-cli
cargo install sqlx-cli --no-default-features --features postgres

yields:

Compiling sqlx-rt v0.5.10
error: one of the features ['runtime-actix-native-tls', 'runtime-async-std-native-tls', 'runtime-tokio-native-tls', 'runtime-actix-rustls', 'runtime-async-std-rustls', 'runtime-tokio-rustls'] must be enabled
  --> /home/bk/.cargo/registry/src/github.com-1ecc6299db9ec823/sqlx-rt-0.5.10/src/lib.rs:9:1
   |
9  | / compile_error!(
10 | |     "one of the features ['runtime-actix-native-tls', 'runtime-async-std-native-tls', \
11 | |      'runtime-tokio-native-tls', 'runtime-actix-rustls', 'runtime-async-std-rustls', \
12 | |      'runtime-tokio-rustls'] must be enabled"
13 | | );
   | |_^

error: could not compile `sqlx-rt` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `sqlx-cli v0.5.10`, intermediate artifacts can be found at `/tmp/cargo-installrC1RJT`

Caused by:
  build failed

I think this appeared in 0.5.10, but am unsure. 0.5.5 worked for me.

@paolobarbolini
Copy link
Contributor

Most likely caused by #1584. The issue is fixed by also including either the native-tls or the rustls feature

@abonander
Copy link
Collaborator

Heh, I knew that PR would break something with those instructions, I just focused in the wrong thing.

@bk138
Copy link
Author

bk138 commented Dec 30, 2021

Thanks! Will the docs get updated or Cargo.toml "fixed"?

@abonander
Copy link
Collaborator

The docs will be updated but I don't think we'll be putting out a patch release just for this.

It's just a minor hiccup which is unfortunately another gotcha with the coupling of the runtime selection and TLS integration. We've got some plans to address this in the next major release but no significant developments yet.

@leofidus
Copy link

I'll be the outsider who barges in and complains that a patch release broke their CI pipeline. Not even obscure usage, but literally the second example in https://github.com/launchbadge/sqlx/tree/master/sqlx-cli

What's done is done, but #1584 should really have been a major release.

@abonander
Copy link
Collaborator

To be fair, if you're using that command to install it in CI then a major release would have broken it all the same since cargo install always installs the latest version.

It's probably a good idea to change your script to always install an exact version and then upgrade it manually.

@abonander
Copy link
Collaborator

Install instructions have been updated: https://github.com/launchbadge/sqlx/tree/master/sqlx-cli#with-rust-toolchain

@binkabir
Copy link

binkabir commented Mar 21, 2023

Hello, Im facing this same issue

  --> /home/binkabir/.cargo/registry/src/github.com-1ecc6299db9ec823/sqlx-rt-0.6.2/src/lib.rs:23:1
   |
23 | / compile_error!(
24 | |     "only one of ['runtime-actix-native-tls', 'runtime-async-std-native-tls', \
25 | |      'runtime-tokio-native-tls', 'runtime-actix-rustls', 'runtime-async-std-rustls', \
26 | |      'runtime-tokio-rustls'] can be enabled"
27 | | );
   | |_^

error: could not compile `sqlx-rt` due to previous error
warning: build failed, waiting for other jobs to finish...

even after following the installation instruction

@abonander
Copy link
Collaborator

Installation instructions in the README on main are for the current 0.7 alpha as stated there. Installation instructions for 0.6 can be found in the Git tags or on crates.io: https://crates.io/crates/sqlx/0.6.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants