Opened 6 years ago
Closed 6 years ago
#57214 closed defect (fixed)
cargo links with libssh2 but does not declare dependency
Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | dbevans (David B. Evans) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), l2dy (Zero King) | |
Port: | cargo |
Description
cargo seems to opportunistically link with libssh2 but does not declare a dependency on it; this caused l2dy's build of mpv on the Mojave buildbot worker to fail at librsvg:
cd ./rust && \ PKG_CONFIG_ALLOW_CROSS=1 \ PKG_CONFIG='/opt/local/bin/pkg-config' \ CARGO_TARGET_DIR=/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_librsvg/librsvg/work/librsvg-2.42.2/rust/target \ cargo build --verbose --release dyld: Library not loaded: /opt/local/lib/libssh2.1.dylib Referenced from: /opt/local/bin/cargo Reason: image not found /bin/sh: line 1: 20881 Abort trap: 6 PKG_CONFIG_ALLOW_CROSS=1 PKG_CONFIG='/opt/local/bin/pkg-config' CARGO_TARGET_DIR=/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_librsvg/librsvg/work/librsvg-2.42.2/rust/target cargo build --verbose --release
I don't know cargo... should we add the libssh2 dependency, or should we make cargo not use libssh2? Whichever we choose, the revision needs to be increased.
Change History (5)
comment:1 Changed 6 years ago by l2dy (Zero King)
comment:2 follow-up: 3 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)
I'm not sure I see what you're trying to point out with that...
comment:3 Changed 6 years ago by l2dy (Zero King)
Replying to ryandesign:
I'm not sure I see what you're trying to point out with that...
I'm providing an official reference to the opportunistic linking behavior.
I don't know much about cargo too, so I'd suggest adding libssh2 as dependency.
comment:4 Changed 6 years ago by l2dy (Zero King)
I was thinking of linking cargo
to libgit2
(adding libgit2
as a dependency and set LIBGIT2_SYS_USE_PKG_CONFIG
). But according to https://github.com/alexcrichton/git2-rs/issues/68, libgit2 frequently broke ABI compatibility.
comment:5 Changed 6 years ago by dbevans (David B. Evans)
Owner: | set to dbevans |
---|---|
Resolution: | → fixed |
Status: | new → closed |
https://doc.rust-lang.org/cargo/reference/build-scripts.html