Open juanmaia opened 2 months ago
I can confirm that 1.77.2 gets the build working with sqlx
0.7.4, however 1.77.2-slim (as introduced a few pages later in the book) fails to build for reasons related to openssl.
This topic is actually addressed shortly afterwards in the "bare operating system" section, but to get the rust-slim build working at this stage, just install the missing dependencies explicitly:
-FROM rust:1.72.0-slim AS builder
+FROM rust:1.77.2-slim AS builder
-RUN apt update && apt install lld clang -y
+RUN apt update && apt install pkg-config libssl-dev lld clang -y
I have the same error in the process of working with Chapter 5. Fixing the sqlx
version to 0.7.1 in Cargo.toml solved the problem.: sqlx = { version = "=0.7.1", default-features = false, features = ["runtime-tokio-rustls", "macros", "postgres", "uuid", "chrono", "migrate"] }
When going through the Dockerfile in the chapter 5, I got the following error when running
docker build --tag zero2prod --file Dockerfile .
This error was not happening when running
cargo build --release
locally, so I assumed was something related to the rust version 1.72.0 as opposed to the 1.77.2 that I'm running locally. I guess that by the time the book was writtensqlx
was not yet on version 0.7.4, but probably on a smaller patch version. I'm new to Rust so I can't tell where the breaking change was added, but probably on sqlx, which is relying in a feature that is not yet available on Rust 1.72.0 but it is on 1.77.2, I haven't looked into the error, since upgrading the Dockerfile base image to 1.77.2 solves the problem.Might be a good idea to lock all minor and patch versions to have a deterministic build.