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
When building protobuf on MacOS with with_zlib=True, the package_folder of zlib isn't included in protobuf's RPATH. As such, running protoc fails because it can't find @rpath/zlib.dylib.
Package and Environment Details
Package Name/Version: protobuf/3.21.12
Operating System+version: MacOS 13.5.1
Compiler+version: Apple clang version 15.0.0 (clang-1500.0.40.1)
dyld[44252]: Library not loaded: @rpath/libz.1.dylib
Referenced from: <12487EAF-0251-3D44-A4C3-7E4721B31A02> /Users/dev/.conan2/p/b/proto7bde3c2dd0ea7/p/lib/libprotobufd.3.21.12.0.dylib
Reason: tried: '/Users/dev/.conan2/p/b/proto7bde3c2dd0ea7/p/lib/libz.1.dylib' (no such file), '/Users/dev/.conan2/p/b/proto7bde3c2dd0ea7/p/lib/libz.1.dylib' (no such file), '/Users/dev/.conan2/p/b/proto7bde3c2dd0ea7/p/bin/../lib/libz.1.dylib' (no such file), '/Users/dev/.conan2/p/b/proto7bde3c2dd0ea7/p/bin/../lib/libz.1.dylib' (no such file)
The text was updated successfully, but these errors were encountered:
When building protobuf on MacOS with with_zlib=True, the package_folder of zlib isn't included in protobuf's RPATH. As such, running protoc fails because it can't find @rpath/zlib.dylib.
Adding zlib to LC_RPATH of protoc executable or protobuf lib is not a long term solution, since zlib path in conan cache can change (if protobuf has been built on another machine, or if another flavor of zlib than the one used during build and not leading to a rebuild of protobuf is injected in the dependency graph).
Apple SIP reseting DYLD_LIBRARY_PATH defeats VirtualBuildEnv or VirtualRunEnv (SIP is triggered somewhere during execution of build backends like make or ninja), and there is nothing conan can do against this anti-developer feature.
My advice is to have protobuf/<host_version> in tool_requires when protoc is needed at build time (native or cross-build, no trick with protobuf from host context used with VirtualRunEnv injected in build scope), and avoid to inject shared=True in build context.
Description
When building protobuf on MacOS with
with_zlib=True
, the package_folder ofzlib
isn't included inprotobuf
's RPATH. As such, runningprotoc
fails because it can't find@rpath/zlib.dylib
.Package and Environment Details
Conan profile
[settings]
arch = x86_64
build_type = Release
compiler = apple-clang
compiler.cppstd = 20
compiler.libcxx = libc++
compiler.version = 15
os = Macos
os.version = 10.15
Steps to reproduce
conan install -r conancenter--requires=protobuf/3.21.12 -o "*:shared=True"
Logs
Click to expand log
The text was updated successfully, but these errors were encountered: