-
Notifications
You must be signed in to change notification settings - Fork 642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix the linker error on ubuntu 24.04 #3559
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3559 +/- ##
==========================================
- Coverage 88.88% 88.85% -0.03%
==========================================
Files 254 254
Lines 14222 14261 +39
==========================================
+ Hits 12641 12672 +31
- Misses 1581 1589 +8 ☔ View full report in Codecov by Sentry. |
23dbd39
to
cbafad3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to introduce packaging issues on macos. But macos does not really need this fix anyway, so could you only set those options on Linux?
Indeed, it is better to localize the change if windows and macos are fine with the original cmake script, and also I thought that macos build failure was spurious. |
Indeed, it could be that the macos failure was not caused by this. That was just my quick assumption based on the failing script. It failed on the |
Hey All :) There is a reason we had to make libssh a dynamic library- it's GPLv2. If you do this, you will need to make all of the source available including Windows and macOS code. Since GPLv2 says you must be able to use another version of the code and if you statically link this, the only way to accomplish that is to make all of the code available. By making it dynamic, you can much more easily replace the library without touching the Multipass code. |
Oh, nevermind, the last commit takes care of that. Sorry for the noise, but something to keep in mind if it ever comes up. |
Thanks anyway, nice surprise to see you around 🙂 |
Hey @ricab, Yeah, there is definitely some history here where I don't want you guys to get into a pickle about. This is the clause that I'm thinking of: libssh is LGPLv2, so if you statically link to it, you will need to consider I still follow you guys and interested in what you are doing, hence me piping up when I see a potential pitfall:) |
close #3558
A minimalistic example to reproduce this is to have an executable in Multipass CMake environment links to
Qt6::Network
andssh
wheressh
target is built by the git submodule library libssh of multipass.The problem here is that the executable links to
libQt6Network.so.6.4.2->libcurl-gnutls.so.4->libssh.so.4
and 3rd-party libssh. So there are two libssh shared libraries linked to the same executable. Symbol versioning is a mechanism used in shared libraries to manage changes in the library API over time. In this case, the system libssh has the symbol version that linker is looking for but 3rd-party one does not have. Besides, the linker apparently is looking into the 3rd-party libssh for the functions he needs as opposed to the system libssh.So one possible fix for this is to disambiguate the double libssh libraries by changing the 3rd-party libssh library from shared library to static library.