You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a build script using git2, which builds fine, but when it is executed, fails with:
/target/debug/build/built2-42d7a0628db36d4d/build-script-build: error while loading shared libraries: libgit2.so.1.9: cannot open shared object file: No such file or directory
The problem is libgit2.so.1.9 is found in /home/linuxbrew/.linuxbrew/Cellar/libgit2/1.9.0/lib/libgit2.so.1.9 (via Homebrew-installed pkg-config), but when executing cannot find it since it is not in the load path.
Ideally, the libgit2-sys build script should add that directory as rpath, but cargo has no way of forwarding this to a dependent binary (yet) using e.g. cargo:rustc-link-arg.
For normal binaries, you can hack the rpath into build.rs, but there is no way to set it for the build.rs itself other than setting RUSTFLAGS manually.
Maybe there is a way to detect when a package is found with pkg-config but cannot actually be loaded (e.g. using ldconfig -p) and fall back to using the vendored version in that case.
The text was updated successfully, but these errors were encountered:
I have a build script using
git2
, which builds fine, but when it is executed, fails with:The problem is
libgit2.so.1.9
is found in/home/linuxbrew/.linuxbrew/Cellar/libgit2/1.9.0/lib/libgit2.so.1.9
(via Homebrew-installedpkg-config
), but when executing cannot find it since it is not in the load path.Ideally, the
libgit2-sys
build script should add that directory asrpath
, butcargo
has no way of forwarding this to a dependent binary (yet) using e.g.cargo:rustc-link-arg
.For normal binaries, you can hack the
rpath
intobuild.rs
, but there is no way to set it for thebuild.rs
itself other than settingRUSTFLAGS
manually.Maybe there is a way to detect when a package is found with
pkg-config
but cannot actually be loaded (e.g. usingldconfig -p
) and fall back to using the vendored version in that case.The text was updated successfully, but these errors were encountered: