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 expected that if we added a workspace member that also is a dylib, both would have the same shared object dependencies
However, if you add a workspace member (we'll create an inner project that is also a dylib and neither crate depends on each other). A cargo clean && cargo build --all later and the shared object dependencies for both change:
ldd target/debug/lib*.so
target/debug/libinner.so:
linux-vdso.so.1 => (0x00007fff0cc8a000)
libstd-29fb1fb52cf57377.so => not found
target/debug/libtemp.so:
linux-vdso.so.1 => (0x00007fff38950000)
libstd-29fb1fb52cf57377.so => not found
This issue came up when searching for previous issues: #39487 but seems somewhat windows and $PATH related, so didn't seem relevant.
*cargo clean was a necessary step as the library wouldn't be rebuilt otherwise.
The text was updated successfully, but these errors were encountered:
Ah, for single crate repos dylib will link against posted objects, but this is only for backwards compatibility. Cargo workspaces assume that it's a sign to renege compatibility. Crates that will be opened by dlopen or the like need to have a crate type of cdylib. So no bug anywhere 😆
On latest stable / nightlies on linux:
Creating a new project and the modifying the generated Cargo.toml:
Produces an
.so
with the following shared objects dependenciesI expected that if we added a workspace member that also is a dylib, both would have the same shared object dependencies
However, if you add a workspace member (we'll create an
inner
project that is also a dylib and neither crate depends on each other). Acargo clean && cargo build --all
later and the shared object dependencies for both change:This issue came up when searching for previous issues: #39487 but seems somewhat windows and $PATH related, so didn't seem relevant.
*
cargo clean
was a necessary step as the library wouldn't be rebuilt otherwise.The text was updated successfully, but these errors were encountered: