-
Notifications
You must be signed in to change notification settings - Fork 243
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
Specify full curl dependencies #161
Specify full curl dependencies #161
Conversation
The ubuntu build fails with
Which suggests to me that libssh2 maybe isn't actually a dependency (i.e. we don't necessarily need curl compiled with it). |
Yeah - please chop those three lines out entirely, and then we can commit that safely. Then you could make a new PR with just those three lines, and we can iterate that to check-in-ability. |
See https://curl.haxx.se/docs/libs.html. So for your static-build scenario, were you getting link errors without ssh2, openssl and zlib? Or were they just header dependencies? |
I already split them - see #160 for just the added files. Just have both commits here because the second is dependent on the first. |
R.e. dependencies. I was getting issues at link time - e.g.
https://travis-ci.org/rainbeam/eth-static/builds/125800060#L1283 I'm still not sure about the problem there though, just that static linking ssh2 fixed it. Maybe something to do with |
Right - my bad. Merged the other one now. Could you re-pull and merge into here now, so we're left with ONLY those final three lines? Or just make a new PR for those? They definitely need this guard around them, at least:
Any comment on whether they are header-only or linkage too, based on your use-case? EDIT - Just saw above, ignore me! Also, now we have moved forward to this point, we'll need |
So, with regard to these symbols, I am assuming that you were building against a prebuilt binary of curl, right? In which case we probably can't avoid these, and just have to suck up having the additional indirect dependencies. Even if curl can be built in some "mode" which omits these dependencies (if we don't need to use that part of curl), that doesn't even matter if we don't control the building of those curl binaries. We get what we get and have to suck it up.
So maybe it's worth a few minutes of your team digging into how curl deals with optional dependencies, and if there is some What was the deal with OpenSSL? Link errors for that one too? |
https://curl.haxx.se/docs/install.html The configure script always tries to find a working SSL library unless
If you have OpenSSL installed somewhere else (for example, /opt/OpenSSL)
Without pkg-config installed, use this:
If you insist on forcing a build without SSL support, even though you may
To get support for SCP and SFTP, build with --with-libssh2 and have libssh2 0.16 or later installed. |
What we certainly COULD do as a starting point here is to make these three dependencies optional. Check out the CMake patterns for the optional dependencies for CpuId, libminiupnp. If we did that then nothing would break on our existing platforms, but your use-case here would start working. That might be the best which we can do anyway, if the indirect dependencies for curl vary a lot between DLL, static and cross-build scenarios anyway. |
Ok, I'll put that guard in. Will do eth_add_exe elsewhere (EDIT: #163) w.r.t. curl - yeah that's right, using the system library. I don't think there is a define that will let us ignore ssh2 if it is already configured with it there. Not documented anyway. |
Given that our Jenkins builds for Windows, OS X and Linux are all failing, I think we should just go with them being optional on all platforms. Because they obviously aren't necessary at least in those desktop environments. That lets us screw off looking at curl build modes too, eh? |
Yep, good plan. I've had enough curl internals for one week. Will make optional. |
"I've had enough curl internals for one week" ^ LOL. |
but make them optional as we don't know whether curl was compiled with them or not.
woo it works. I think setting the deps as optional is the neatest solution anyway. Main thing for static linking purposes was making sure that cmake knew about the libraries so it constructed the correct link arguments. |
It looks like we're within a couple of commits of getting all this functionality in, eh? Thanks for your work on this. Will be a great feature to have. When we've done that I can try to build our existing Linux, OS X and Windows binaries in that mode too, which will tell us if further edits are needed within those OpenSSL, ssh2 and zlib CMake files to do something cleverer than just making them optional - or perhaps it is just the case that static build require more explicit package installs? We'll see. |
I've got a feeling we might need to specify all possible curl dependencies here, rather than the limited subset that Alpine uses. For example, Debian curl is linked to all of the optional libraries. I'm trying to get Debian going now (see problems in #163) so should get an idea. What would be good would be if cmake could magically work out all the curl dependencies. It has a pkg-config wrapper, but that isn't cross platform. |
"I've got a feeling we might need to specify all possible curl dependencies here, rather than the limited subset that Alpine uses. For example, Debian curl is linked to all of the optional libraries." Yes, we would need to do that with the current setup, given that we are just relying on some external and completely ill-defined external curl binaries. We don't control the version. We don't control the modes, or the compiler settings or anything. This is why I want us to add a number of our external dependencies as sub-modules at some stage soon, even though that means they will then be built from source. But it means that we totally side-step all that platform-specific packaging stuff, which is a pain on OS X with Homebrew, utterly undefined on Windows and nightmarishly fragmented in Linux. |
Thanks - merged this! |
FYI ... getting a knock-on issue from this change in a normal
Seemingly because the UseJsonRpc is REQUIRED, but the (now chained) dependency onto curl still needs to be optional, but I guess the change from find_package() has screwed with the semantics a bit. Switching the eth_use from ${REQUIRED} to OPTIONAL doesn't fix it either. Needs some more love. I will try, but if you know the magic fix, please do feel free to try to fix too :-) |
So in this case, we don't NEED curl, but the new CMake is requiring that (where the chained curl indirect dependencies are optional, but curl itself seemingly is not). |
Let curl know what its dependencies are. I'm not sure ssh2 is strictly necessary - might vary depending on curl install.