-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Source build of curl to enable proxy support for Pkg #17783
Conversation
$(BUILDDIR)/curl-$(CURL_VER)/config.status: $(SRCDIR)/srccache/curl-$(CURL_VER)/configure | ||
mkdir -p $(dir $@) | ||
cd $(dir $@) && \ | ||
$< $(CONFIGURE_COMMON) --includedir=$(build_includedir) --with-mbedtls=$(build_shlibdir) CFLAGS="$(CFLAGS) $(CURL_CFLAGS)" LDFLAGS="$(LDFLAGS) $(CURL_LDFLAGS)" |
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.
I think you may need to also do --disable-ssl
or something like that to get it to not link against openssl?
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.
It doesn't seem to be linking against openssl. See my otool
output below.
Do we have a test system with a proxy set up somewhere that we can run this on? |
Seems like everything is building and linking ok:
|
@mdpradeep I believe you had a test system with proxy setup. Could you test this PR? I also believe I can setup a SOCKS proxy using ssh -D and try. Does anyone have thoughts if this could be a good way to test? |
@tkelman Does this PR need anything further before asking others to try it out? |
@@ -272,6 +276,7 @@ include $(SRCDIR)/patchelf.mk | |||
include $(SRCDIR)/mbedtls.mk | |||
include $(SRCDIR)/libssh2.mk | |||
include $(SRCDIR)/libgit2.mk | |||
include $(SRCDIR)/curl.mk |
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.
should be done before libgit2, and libgit2 will need to declare a dependency on it
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.
Good point. I will move it above.
libgit2 and curl are in different build stages. Shouldn't that be good enough? I do think that libssh2 should probably be stage 1 (currently in 2), curl in stage 2 and libgit2 in stage 3.
I don't think we should rush merging this into rc1, but people can certainly test the branch. Minor things where it'll need mentioning:
|
Yes, this is definitely not for rc1, but if we get all the testing done, I hope we can merge it into rc2. If we can confirm success on all the platforms, then doing the rest of these items should be straightforward. |
@@ -7,7 +7,7 @@ $(eval $(call git-external,libgit2,LIBGIT2,CMakeLists.txt,build/libgit2.$(SHLIB_ | |||
LIBGIT2_OBJ_SOURCE := $(BUILDDIR)/$(LIBGIT2_SRC_DIR)/libgit2.$(SHLIB_EXT) | |||
LIBGIT2_OBJ_TARGET := $(build_shlibdir)/libgit2.$(SHLIB_EXT) | |||
|
|||
LIBGIT2_OPTS := $(CMAKE_COMMON) -DCMAKE_BUILD_TYPE=Release -DTHREADSAFE=ON | |||
LIBGIT2_OPTS := $(CMAKE_COMMON) -DCMAKE_BUILD_TYPE=Release -DTHREADSAFE=ON -DCURL_INCLUDE_DIRS=$(build_includedir) -DCURL_LIBRARIES="-L$(build_shlibdir) -lcurl" |
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.
I don't think this entirely works
Manually-specified variables were not used by the project:
CMAKE_CXX_COMPILER
CMAKE_CXX_COMPILER_ARG1
CURL_INCLUDE_DIRS
CURL_LIBRARIES
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.
Is it getting auto-detected? How do I provide those variables to the build?
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.
https://github.com/libgit2/libgit2/blob/152efee20b74ea261cf8e05410a110687e17376e/CMakeLists.txt#L277-L280 - it uses PKG_CHECK_MODULES
which means it's relying on pkg-config
to do the finding. I don't think we've been explicitly requiring or checking pkg-config as a build dependency though.
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.
I believe pkg-config is getting used in many other places. For now, should I just remove these variables and we should check if everything works on other OSes.
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.
almost entirely optionally though. I've had to remove it in the past to get a multilib build of 32 bit linux Julia to work from 64 bit linux
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.
pkg-config
should work if libcurl
pc-file is correctly installed in lib/pkg-config
, no need for CURL_INCLUDE_DIRS
and CURL_LIBRARIES
.
However, pkg-config
incorrectly works on msys2, thus the above patch.
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.
If we need pkg-config to be present to get a correct build, then we should be checking for it and failing the build if it isn't (and documenting this). Can we get away without it?
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.
no, unless libcurl
generates cmake
installation configs as libssh2
does.
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.
I should mention that I do not get the unused variables during cmake that you posted above. I just get the first two but not the curl ones.
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.
it's on windows - libgit2 won't use curl there if it's using winhttp
Will check it.
|
I set up a local socks proxy with Killing the proxy while still keeping the environment variable gives me the right expected error:
Getting rid of the environment variable then again gets me everything working without the proxy. |
Seems like we need 4 build stages: libgit2, which needs libcurl, which needs libssh2, which needs mbedtls. |
985b193
to
f75194f
Compare
I prefer not mucking with cmake stuff. If this will get the right builds out, I prefer merging this as it is and cleaning up with your PR later. If we use libcurl for transport, will the ssh connections also go through it, or does libgit2 handle them directly? |
I don't know the answer to that. Do ssh remotes go through a proxy? To test this, you could try the following
|
ssh remotes are not expected to go through proxies. I think this addresses the case at hand, of using http(s) and socks proxies. Let's get it in for the next RC. |
480bcea
to
6b11fd5
Compare
@@ -267,7 +267,7 @@ Input AST | |||
``a:b`` ``(: a b)`` | |||
``a:b:c`` ``(: a b c)`` | |||
``a,b`` ``(tuple a b)`` | |||
``a==b`` ``(comparison a == b)`` | |||
``a==b`` ``(call == a b)`` |
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.
messed up rebase, why is this in here?
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.
Crap. How do I fix this?
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.
git rebase -i origin/master
and deselect spencer's commit, then force push over this vs/curl
branch
@@ -297,7 +299,7 @@ For a longer overview of Julia's dependencies, see these [slides](https://github | |||
[gcc]: http://gcc.gnu.org | |||
[clang]: http://clang.llvm.org | |||
[gfortran]: https://gcc.gnu.org/fortran/ | |||
[curl]: http://curl.haxx.se | |||
[cURL]: http://curl.haxx.se |
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.
link should probably be in lower case all 3 places otherwise the "automatically download external libraries" might not link correctly
Fixed the rpath stuff. Simplified the curl build dependency in libgit2 - and only gets done on non-windows. The Curl build now depends on mbedtls and libssh2. Now parallel make correctly builds all the dependencies in the right after. |
The
|
|
The curl build depends on mbedtls and libssh2 Patch for mbedtls to allow curl to build with mbedtls support Add curl to LICENSE.md, README.md and all the other various locations
Enforce curl as a dependency for the libgit2 build. Fix the libgit2 clean target Build curl only on linux and osx. Add pkg-config to build dependencies in README.md. Required to detect curl in libgit2 build.
Got rid of the extra commit that had snuck in. Also tested successfully again on linux and os x. |
Do we have the nightlies with curl yet? We should ping all those who reported the proxy issue to test the nightlies and confirm, and that should be good enough to get it into the RC2. |
The curl build depends on mbedtls and libssh2 Patch for mbedtls to allow curl to build with mbedtls support Add curl to LICENSE.md, README.md and all the other various locations (cherry picked from commit 9e9e143) ref JuliaLang/julia#17783
Using libcurl with libgit2 will allow the use of proxy servers for those behind firewalls.
Should fix #13472 #10754