Closed the-dipsy closed 5 months ago
Thanks for opening this bug report. This seems to be a duplicate of https://github.com/sgrif/pq-sys/issues/27, therefore I'm closing this in favor of the other bug.
To quickly elaborate, if I understand correctly, this has been fixed in pg-sys 0.5.0, which the current main branch of diesel already supports and will therefore be available in diesel's next release. Thanks alot and keep up the good work 😊
That's nearly correct. It doesn't fix statically linking the system provided libraries, as we do not have a good way to detect which libraries are actually needed. It instead provides a "bundled" feature flag that allows to build a defined version of libpq from source and statically links that version. In that way we have the required knowlegde about all the dependencies.
@weiznich do you have any timeline for the next diesel release? I've updated my Cargo.toml
to pull master
from the git directly which works well, but would love to pin against the released version.
@peasee As this is a free time project we generally do not give any ETA for releases other than "when it's done". You can help making this happen faster by either contributing fixes for the remaining issues marked as release blocker or by funding the development.
Versions
Feature Flags
Problem Description
Installing diesel_cli with postgres in Alpine fails, because libpgcommon, libpgport, libssl, and libcrypto are not included in the
cc
command.I don't know if this problem is caused by diesel_cli itself or some dependency, but it should at least be documented somewhere.
What is the actual output?
Steps to reproduce
podman run --rm -it rust:alpine
apk add --no-cache musl-dev openssl-libs-static libpq-dev
cargo install diesel_cli --no-default-features --features postgres
Interim fix
The issues can be fixed manually by instructing rust to include the missing libraries using the environment variable
RUSTFLAGS="-lpgcommon -lpgport -lssl -lcrypto"
.