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 am trying to make KiCad build under macOS + nix. My last hurdle is that the CMake scripts of KiCad want to create an app bundle during the install phase. This currently fails, because during verification of the created app bundle CMake encounters the non-absolute RPATH to CoreFoundation @rpath/CoreFoundation.framework/Versions/A/CoreFoundation in the dependencies of the executables in the app bundle. Because an app bundle is supposed to be self-contained and CMake does not recognize the reference as one to a system library, verification of the bundle, and hence the install step, fails.
For example, eeschema depends on cairo, which in turn depends on fontconfig:
/nix/store/ip78z0sjkhafnqq6zckm3zx4n3lcf3q3-cctools-binutils-darwin-927.0.2/bin/otool -L /tmp/nix/store/ph6y7bkl31mywl2kh9m6zdvwn9f920v8-kicad-base-c6e7f7de7d/eeschema.app/Contents/MacOS/eeschema
[…]
/nix/store/aq6g3nkffccdm7lpvl62yfh3xqab8fd0-cairo-1.16.0/lib/libcairo.2.dylib (compatibility version 11603.0.0, current version 11603.0.0)
[…]
/nix/store/ip78z0sjkhafnqq6zckm3zx4n3lcf3q3-cctools-binutils-darwin-927.0.2/bin/otool -L /nix/store/aq6g3nkffccdm7lpvl62yfh3xqab8fd0-cairo-1.16.0/lib/libcairo.2.dylib
[…]
/nix/store/99apywdnix0j9c8pyb8f6g3gabc3ml45-fontconfig-2.13.92-lib/lib/libfontconfig.1.dylib (compatibility version 14.0.0, current version 14.0.0)
[…]
libfontconfig in turn has an RPATH set:
/nix/store/99apywdnix0j9c8pyb8f6g3gabc3ml45-fontconfig-2.13.92-lib/lib/libfontconfig.1.dylib:
/nix/store/99apywdnix0j9c8pyb8f6g3gabc3ml45-fontconfig-2.13.92-lib/lib/libfontconfig.1.dylib (compatibility version 14.0.0, current version 14.0.0)
/nix/store/slm1f903cz47r2hi8v543mj3fcakvwrc-freetype-2.10.2/lib/libfreetype.6.dylib (compatibility version 24.0.0, current version 24.2.0)
/nix/store/bafwypxc11wp51phssmh9h6vqmwzmnxf-bzip2-1.0.6.0.1/lib/libbz2.1.dylib (compatibility version 2.0.0, current version 2.6.0)
/nix/store/0hr8d4x5w1046a6mcwgfnyj85f7ylf8g-libpng-apng-1.6.37/lib/libpng16.16.dylib (compatibility version 54.0.0, current version 54.0.0)
/nix/store/ilrm722frr4fb3096wjc6wbspdf7pgyr-zlib-1.2.11/lib/libz.dylib (compatibility version 1.0.0, current version 1.2.11)
/nix/store/cjflr1cvpkq74ln7j2qndri3a5513797-expat-2.2.8/lib/libexpat.1.dylib (compatibility version 8.0.0, current version 8.10.0)
/nix/store/vrxrz8fqi2cmv0z7kxfza2nycbbbkh1k-gettext-0.21/lib/libintl.8.dylib (compatibility version 11.0.0, current version 11.0.0)
@rpath/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1454.90.0)
/nix/store/hw4x6gakgd43f13zys92ng0hj0acisls-Libsystem-osx-10.12.6/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
libcontconfig gets copied into app bundle as dependency. CMake notices this:
warning: unexpected reference to '@rpath/CoreFoundation.framework/Versions/A/CoreFoundation'
And finally, the verification step of the Bundle creation fails:
warning: cannot resolve item '@rpath/CoreFoundation.framework/Versions/A/CoreFoundation'
possible problems:
need more directories?
need to use InstallRequiredSystemLibraries?
run in install tree instead of build tree?
-- warning: gp_resolved_file_type non-absolute file '@rpath/CoreFoundation.framework/Versions/A/CoreFoundation' returning type 'other' -- possibly incorrect
-- verified='0'
-- info='external prerequisites found:
f='/tmp/nix/store/ph6y7bkl31mywl2kh9m6zdvwn9f920v8-kicad-base-c6e7f7de7d/eeschema.app/Contents/MacOS/eeschema'
external_prereqs='@rpath/CoreFoundation.framework/Versions/A/CoreFoundation'
'
--
CMake Error at /nix/store/qzj93zqnp65ryzaqh51nrsyp64mkwrym-cmake-3.18.2/share/cmake-3.18/Modules/BundleUtilities.cmake:1121 (message):
error: verify_app failed
Call Stack (most recent call first):
/nix/store/qzj93zqnp65ryzaqh51nrsyp64mkwrym-cmake-3.18.2/share/cmake-3.18/Modules/BundleUtilities.cmake:987 (verify_app)
eeschema/cmake_install.cmake:78 (fixup_bundle)
cmake_install.cmake:62 (include)
My question now is, how do I fix or work around this? IIRC, nix uses an RPATH to CoreFoundation to be able to switch between pure and impure versions without recompilation? Correct me, if I'm wrong.
If I hack around this, i.e. make CMake think RPATHs are system libraries and don't need to be copied, the resulting app bundle works for me. So this is basically the last step to have KiCad build on Darwin. Maybe someone can give me hint.
I tried to search for how to build app bundle via CMake under Nix, but Github only let's me search open issues. Whenever I search for closed issues I get the Github unicorn and it tells me generation of the page has timed out :(
Describe the bug
I am trying to make KiCad build under macOS + nix. My last hurdle is that the CMake scripts of KiCad want to create an app bundle during the install phase. This currently fails, because during verification of the created app bundle CMake encounters the non-absolute RPATH to CoreFoundation
@rpath/CoreFoundation.framework/Versions/A/CoreFoundationin the dependencies of the executables in the app bundle. Because an app bundle is supposed to be self-contained and CMake does not recognize the reference as one to a system library, verification of the bundle, and hence the install step, fails.For example,
eeschemadepends oncairo, which in turn depends onfontconfig:libfontconfig in turn has an RPATH set:
libcontconfig gets copied into app bundle as dependency. CMake notices this:
warning: unexpected reference to '@rpath/CoreFoundation.framework/Versions/A/CoreFoundation'And finally, the verification step of the Bundle creation fails:
My question now is, how do I fix or work around this? IIRC, nix uses an RPATH to CoreFoundation to be able to switch between pure and impure versions without recompilation? Correct me, if I'm wrong.
If I hack around this, i.e. make CMake think RPATHs are system libraries and don't need to be copied, the resulting app bundle works for me. So this is basically the last step to have KiCad build on Darwin. Maybe someone can give me hint.
I tried to search for how to build app bundle via CMake under Nix, but Github only let's me search open issues. Whenever I search for closed issues I get the Github unicorn and it tells me generation of the page has timed out :(
To Reproduce
Steps to reproduce the behavior:
nix-shell --pureExpected behavior
Create a working app bundle.
Screenshots
Full install log (CMake verbose enabled)
https://gist.github.com/hannesweisbach/f9c81f08e298f99bb6e55f76d7f40897
Notify maintainers
@evils @Kiwi @berce
Metadata
Maintainer information: