-
Notifications
You must be signed in to change notification settings - Fork 281
Fix linking against new libssh2 formula #356
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 linking against new libssh2 formula #356
Conversation
@raheelahmad @jlalvarez18 Could you please give this branch a try? |
@robrix it does, but I had to modify your modified |
I bet if you were to |
Indeed. A |
Doing a
|
Thanks to you both! @jlalvarez18: That warning is benign. We’re passing |
@robrix no no.. thank you! |
Okay, we are linking the dylibs:
So, that’s pretty terrible. Going to go spelunking in the man pages to try to figure out what to do about this. |
Including the path to the |
When these symlinks are unable to be resolved, the linker just skips past them on to the next entry in the search paths. Thus, this should work fine for system dylibs (since the search path entries that would resolve to brewed dylibs have been removed) and for brewed archives.
@jspahrsummers Could you please give this branch a try again? (Assuming that you haven’t I’ve added symlinks to the .a files to External and removed the customized search paths, which means that it will use the (project-wide) External/ search path and try to resolve the .a files. Failing that it will try the other search paths, eventually ending up with system openssl dylibs. So, brewed archives get top priority—meaning that recently-brewed libssh2 will work—and it should fallback otherwise. Only fly in the ointment is that you do have something at those paths—so now we just need to find out if it can link with it or not. (I’ve reason to expect “yes.”) |
That’s good enough for me! Ready for review. 🐚 |
@@ -1510,6 +1502,8 @@ | |||
"-force_load", | |||
External/libgit2.a, | |||
/usr/local/lib/libssh2.a, | |||
"-lcrypto", |
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.
Won't this have the same issue with dylib preference?
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.
Both -lcrypto
and -lssl
are tested against $(SRCROOT)/External
first, which has a libcrypto.a
symlink in it. If that resolves, we’re done; otherwise, it falls back to system dylibs (which is fine).
1️⃣ |
🙏 Thanks @robrix et al. |
2️⃣ |
|
…formula Fix linking against new libssh2 formula
You’re welcome! |
…ibssh2-formula Fix linking against new libssh2 formula
🚨⚠️ Warning: This is not ready to merge until we have confirmation that it doesn’t break the build for folks who haven’t updated brew yet, and that it actually works correctly in deployed projects linking against ⚠️
ObjectiveGit.framework
. 🚨This is intended to fix linking Objective-Git against the libssh2 that
brew
gives us, which apparently can no longer be linked against system openssl.brew upgrade libssh2
to get1.4.3_1
yet/usr/local/…
(and therefore that it can run on Macs without brew 😬) Unfortunately, we are.Probably not sane to try to manage upstream’s versioning carefully.Totally sane, just change the library search path to/usr/local/opt/openssl/lib
like brew told me tolibssl.a
andlibcrypto.a
to their dylib counterpartsFixes #352.