Make dependency resolution with -Zminimal-versions build properly. #4

Open
opened 2025-06-22 11:29:59 -07:00 by robert · 1 comment
Owner

Cargo uses SemVer, which means that a dependency constraint of version = "1" should build with version 1.0.0 and 1.99.... The cargo-nightly -Zminimal-versions switch will make Cargo resolve dependencies with the oldest matching version.

Direct dependencies should be precise enough to build under this configuration.

Grand-dependencies may not be doing this, so the graph may still have errors in it. In this case, add direct dependencies on those packages to try setting a program-wide minimum for Cargo to prefer.

Cargo uses SemVer, which means that a dependency constraint of `version = "1"` should build with version `1.0.0` and `1.99...`. The cargo-nightly `-Zminimal-versions` switch will make Cargo resolve dependencies with the *oldest* matching version. Direct dependencies should be precise enough to build under this configuration. Grand-dependencies may not be doing this, so the graph may still have errors in it. In this case, add direct dependencies on those packages to try setting a program-wide minimum for Cargo to prefer.
robert added the Kind/Feature label 2025-06-22 11:29:59 -07:00
robert added reference minimal-versions 2025-07-02 12:56:24 -07:00
Author
Owner

Progress has been made, but there is a shiny new problem: The minimum suported openssl-sys = 0.9.55 tries to use OpenSSL 1.x. When it isn't installed, the build fails. Debian 11 has this package, but Debian 12 does not.

On branch "minimal-versions", I'm pinning to a minimum of openssl-sys = 0.9.64 which uses OpenSSL 3.x and things work nicely. However, the package can build correctly when OpenSSL 1.x is made available. Building on Debian 11 is successful.

Progress has been made, but there is a shiny new problem: The minimum suported `openssl-sys = 0.9.55` tries to use OpenSSL 1.x. When it isn't installed, the build fails. Debian 11 has this package, but Debian 12 does not. On branch "minimal-versions", I'm pinning to a minimum of `openssl-sys = 0.9.64` which uses OpenSSL 3.x and things work nicely. *However*, the package can build correctly when OpenSSL 1.x is made available. Building on Debian 11 is successful.
Sign in to join this conversation.