canonical / multipass

Multipass orchestrates virtual Ubuntu instances
https://multipass.run
GNU General Public License v3.0
7.74k stars 642 forks source link

A second `ninja package` fails in macOS #1847

Open ricab opened 3 years ago

ricab commented 3 years ago

Describe the bug Trying to recreate a package (after changing code) fails in macOS.

To Reproduce

$ ninja package
[6/7] Run CPack packaging tool...
CPack: Create package using productbuild
CPack: Install projects
CPack Error: Problem running install command: bash -x /Users/travis/multipass/multipass-afp/packaging/macos/install-ssl-libs.sh /Users/travis/multipass/build-afp
Please check /Users/travis/multipass/build-afp/_CPack_Packages/Darwin/productbuild/InstallOutput.log for errors
CPack Error: Error when generating package: multipass
FAILED: CMakeFiles/package.util
cd /Users/travis/multipass/build-afp && /usr/local/Cellar/cmake/3.18.4/bin/cpack --config ./CPackConfig.cmake
ninja: build stopped: subcommand failed.

Logs The last message in InstallOutput.log is:

error: /Library/Developer/CommandLineTools/usr/bin/install_name_tool: for: /Users/travis/multipass/build-afp/lib/libssh.dylib (for architecture x86_64) option "-add_rpath /Users/travis/multipass/build-afp/install-ssh-libs" would duplicate path, file already has LC_RPATH for: /Users/travis/multipass/build-afp/install-ssh-libs

Workaround

rm -rf lib
Saviq commented 3 years ago

Indeed, the rpath fixup scripts don't deal well with being run multiple times.

ricab commented 3 years ago

We could copy their targets to an intermediary place when packaging, and have the scripts target them there.