conda-forge / zenoh-c-feedstock

A conda-smithy repository for zenoh-c.
BSD 3-Clause "New" or "Revised" License
0 stars 3 forks source link

macOS libraries have missing rpath information #18

Open traversaro opened 2 hours ago

traversaro commented 2 hours ago

Solution to issue cannot be found in the documentation.

Issue

Tests in https://github.com/conda-forge/zenoh-cpp-feedstock/pull/8 are failing as libzenohc.dylib can't be found.

This happens as the libzenohc.dylib have the wrong (actually missing) rpath info:

(zenohcppdev) icub@iCubs-Mac-mini build % otool -L $CONDA_PREFIX/lib/libzenohc.dylib
/Users/icub/miniforge3/envs/zenohcppdev/lib/libzenohc.dylib:
    /Users/runner/miniforge3/conda-bld/libzenohc_1729746982451/work/target/aarch64-apple-darwin/release/deps/libzenohc.dylib (compatibility version 0.0.0, current version 0.0.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1770.106.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.0.0)
(zenohcppdev) icub@iCubs-Mac-mini build % otool -L $CONDA_PREFIX/lib/libz.dylib 
/Users/icub/miniforge3/envs/zenohcppdev/lib/libz.dylib:
    @rpath/libz.1.dylib (compatibility version 1.0.0, current version 1.3.1)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.0.0)

Installed packages

(zenohcppdev) icub@iCubs-Mac-mini build % conda list
# packages in environment at /Users/icub/miniforge3/envs/zenohcppdev:
#
# Name                    Version                   Build  Channel
bzip2                     1.0.8                h99b78c6_7    conda-forge
c-ares                    1.34.2               h7ab814d_0    conda-forge
c-compiler                1.8.0                hf48404e_1    conda-forge
ca-certificates           2024.8.30            hf0a4a13_0    conda-forge
cctools                   1010.6               hf67d63f_1    conda-forge
cctools_osx-arm64         1010.6               h4208deb_1    conda-forge
clang                     17.0.6          default_h360f5da_7    conda-forge
clang-17                  17.0.6          default_h146c034_7    conda-forge
clang_impl_osx-arm64      17.0.6              he47c785_21    conda-forge
clang_osx-arm64           17.0.6              h54d7cd3_21    conda-forge
clangxx                   17.0.6          default_h360f5da_7    conda-forge
clangxx_impl_osx-arm64    17.0.6              h50f59cd_21    conda-forge
clangxx_osx-arm64         17.0.6              h54d7cd3_21    conda-forge
cmake                     3.30.5               hfbcbe4a_0    conda-forge
compiler-rt               17.0.6               h856b3c1_2    conda-forge
compiler-rt_osx-arm64     17.0.6               h832e737_2    conda-forge
compilers                 1.8.0                hce30654_1    conda-forge
cxx-compiler              1.8.0                h18dbf2f_1    conda-forge
fortran-compiler          1.8.0                hc3477c4_1    conda-forge
gfortran                  13.2.0               h1ca8e4b_1    conda-forge
gfortran_impl_osx-arm64   13.2.0               h252ada1_3    conda-forge
gfortran_osx-arm64        13.2.0               h57527a5_1    conda-forge
gmp                       6.3.0                h7bae524_2    conda-forge
icu                       75.1                 hfee45f7_0    conda-forge
isl                       0.26            imath32_h347afa1_101    conda-forge
krb5                      1.21.3               h237132a_0    conda-forge
ld64                      951.9                h39a299f_1    conda-forge
ld64_osx-arm64            951.9                hc81425b_1    conda-forge
libclang-cpp17            17.0.6          default_h146c034_7    conda-forge
libcurl                   8.10.1               h13a7ad3_0    conda-forge
libcxx                    19.1.2               ha82da77_0    conda-forge
libcxx-devel              17.0.6               h86353a2_6    conda-forge
libedit                   3.1.20191231         hc8eb9b7_2    conda-forge
libev                     4.33                 h93a5062_2    conda-forge
libexpat                  2.6.3                hf9b8971_0    conda-forge
libffi                    3.4.2                h3422bc3_5    conda-forge
libgfortran               5.0.0           13_2_0_hd922786_3    conda-forge
libgfortran-devel_osx-arm64 13.2.0               h5d7a38c_3    conda-forge
libgfortran5              13.2.0               hf226fd6_3    conda-forge
libglib                   2.82.2               h07bd6cf_0    conda-forge
libiconv                  1.17                 h0d3ecfb_2    conda-forge
libintl                   0.22.5               h8414b35_3    conda-forge
libllvm17                 17.0.6               h5090b49_2    conda-forge
libnghttp2                1.64.0               h6d7220d_0    conda-forge
libssh2                   1.11.0               h7a5bd25_0    conda-forge
libuv                     1.49.2               h7ab814d_0    conda-forge
libxml2                   2.12.7               h01dff8b_4    conda-forge
libzenohc                 1.0.0                h806bf13_0    conda-forge
libzlib                   1.3.1                h8359307_2    conda-forge
llvm-openmp               19.1.2               hb52a8e5_0    conda-forge
llvm-tools                17.0.6               h5090b49_2    conda-forge
make                      4.4.1                hc9fafa5_2    conda-forge
mpc                       1.3.1                h8f1351a_1    conda-forge
mpfr                      4.2.1                hb693164_3    conda-forge
ncurses                   6.5                  h7bae524_1    conda-forge
ninja                     1.12.1               h420ef59_0    conda-forge
openssl                   3.3.2                h8359307_0    conda-forge
pcre2                     10.44                h297a79d_2    conda-forge
pkg-config                0.29.2            hde07d2e_1009    conda-forge
rhash                     1.4.5                h7ab814d_0    conda-forge
sigtool                   0.1.3                h44b9a77_0    conda-forge
tapi                      1300.6.5             h03f4b80_0    conda-forge
xz                        5.2.6                h57fd34a_0    conda-forge
zenoh-rust-abi            1.0.0.1.79.0         ha052749_0    conda-forge
zlib                      1.3.1                h8359307_2    conda-forge
zstd                      1.5.6                hb46c0d2_0    conda-forge

Environment info

(zenohcppdev) icub@iCubs-Mac-mini build % conda info

     active environment : zenohcppdev
    active env location : /Users/icub/miniforge3/envs/zenohcppdev
            shell level : 1
       user config file : /Users/icub/.condarc
 populated config files : /Users/icub/miniforge3/.condarc
                          /Users/icub/.condarc
          conda version : 24.1.2
    conda-build version : not installed
         python version : 3.10.14.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=m1
                          __conda=24.1.2=0
                          __osx=14.6.1=0
                          __unix=0=0
       base environment : /Users/icub/miniforge3  (writable)
      conda av data dir : /Users/icub/miniforge3/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-arm64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /Users/icub/miniforge3/pkgs
                          /Users/icub/.conda/pkgs
       envs directories : /Users/icub/miniforge3/envs
                          /Users/icub/.conda/envs
               platform : osx-arm64
             user-agent : conda/24.1.2 requests/2.31.0 CPython/3.10.14 Darwin/23.6.0 OSX/14.6.1 solver/libmamba conda-libmamba-solver/24.1.0 libmambapy/1.5.7
                UID:GID : 501:20
             netrc file : None
           offline mode : False
traversaro commented 2 hours ago

Apparently this is a long standing rust issue: https://github.com/rust-lang/rust/issues/127100 . Note that rerun C++'s libraries are not affected by that as rust creates a static library, that then is embedded in a C++ shared libraries that instead is built with regular CMake tooling and so it is aware of all LDFLAGS and CMake options related to rpath.