sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

Hard dependency of TLS implementation makes SQLx unbuildable on some platforms

Open kmod-midori opened this issue 2 years ago • 3 comments

I know this is an duplicate of #914, but it seems that you guys are not aware that having to build rustls can be such a headache, in the meantime, development on the next branch seems have stalled.

I am trying to build a project that is intended to be used in an embedded MIPS platform, on which ring (one of rustls's core dependencies, a crypto library) does not build (briansmith/ring#562).

$ cross build --target=mipsel-unknown-linux-gnu --release
...
error: failed to run custom build command for `ring v0.16.20`

Caused by:
  process didn't exit successfully: `/target/release/build/ring-66379d5e27511bd7/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/ring-0.16.20/build.rs:358:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

Making matters worse, the target device is extremely space constrained and we do not want to include OpenSSL because it simply does not fit. The target device only uses SQLite and does not connect to the Internet, including any TLS implementation would be a waste of space and memory.

kmod-midori avatar Mar 13 '22 14:03 kmod-midori

We are working to make the runtime and TLS features orthogonal so you can disable TLS if you don't need it. That work isn't on the next branch, it's going to be in standalone crates that aren't public yet.

abonander avatar Mar 13 '22 15:03 abonander

Not being able to disable tls is my only regret, hopefully this will be fixed soon.

kekeimiku avatar Jun 21 '22 13:06 kekeimiku

This would be wonderful for dockerized apps, and for sqlite apps. Please add this.

randomairborne avatar Aug 25 '22 17:08 randomairborne

Yes, I'm working with sqlite and do not need tls feature enabled. Please add the seperated feature flags back, thx.

lightsing avatar Oct 01 '22 16:10 lightsing

I can't build for wasm32-wasi because of the ring dependency. I don't need TLS so having a feature flag to disable it would be very useful.

marziply avatar Dec 10 '22 22:12 marziply

Building for the WASI target is also interesting for us. Anything the community (happy to contribute!) can do to help move this along?

ianthetechie avatar Jan 18 '24 07:01 ianthetechie

It's been possible to build SQLx without a TLS backend since 0.7.0. Just use runtime-tokio or runtime-async-std without a TLS suffix.

abonander avatar Jan 18 '24 08:01 abonander