Skip to content

drop flag and enable linking to OpenSSL again - #102

Merged
shiftkey merged 3 commits into
masterfrom
switch-back-to-openssl
Jul 23, 2018
Merged

shiftkey merged 3 commits into
masterfrom
switch-back-to-openssl

Conversation

@shiftkey

@shiftkey shiftkey commented Jul 23, 2018 •

Copy link
Copy Markdown
Member

As part of investigation shiftkey/desktop#21 I found myself realising some choices I'd made ages ago were not great:

  • the Ubuntu distribution is compiled and linked with NO_OPENSSL=1 because I wanted to avoid any unnecessary TLS dependencies
  • it looks like this means it's compiled and linked with some other TLS dependency
  • the vanilla Travis images look like they have multiple libcurl4-* dependencies available (and/or installed)
$ sudo apt install libcurl4-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package libcurl4-dev is a virtual package provided by:
  libcurl4-openssl-dev 7.47.0-1ubuntu2.8
  libcurl4-nss-dev 7.47.0-1ubuntu2.8
  libcurl4-gnutls-dev 7.47.0-1ubuntu2.8
You should explicitly select one to install.

E: Package 'libcurl4-dev' has no installation candidate

  • the symlink thing is a workaround, and it'd be nice to make this dependency explicit so the package manager can just handle it at install time
  • on Debian-based distros, the libcurl3 package seems to contain the right shared libraries. For RPM-based distros, it looks like libcurl is the right package

So after all that yak shaving, I think I need to make the next update of dugite-native just link to OpenSSL and add some proper documentation for distributors about shared libraries that need to be available on the end-user's machines at install time.

@shiftkey

Copy link
Copy Markdown
Member Author

For reference, the most recent master build shows the HTTP-based programs are linked to libcurl-gnutls on Linux x64:

File: ./libexec/git-core/git-remote-http
 0x0000000000000001 (NEEDED)             Shared library: [libcurl-gnutls.so.4]
 0x0000000000000001 (NEEDED)             Shared library: [libz.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [librt.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]

But the ARM64 build is linking correctly (even though it has NO_OPENSSL=1 set, this is probably because there's only one available libcurl-* package installed):

File: ./libexec/git-core/git-remote-http
 0x0000000000000001 (NEEDED)             Shared library: [libcurl.so.4]
 0x0000000000000001 (NEEDED)             Shared library: [libexpat.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libz.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [librt.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [ld-linux-aarch64.so.1]

This branch now shows that Linux x64 is now linking correctly:

File: ./libexec/git-core/git-remote-http
 0x0000000000000001 (NEEDED)             Shared library: [libcurl.so.4]
 0x0000000000000001 (NEEDED)             Shared library: [libz.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [librt.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]

As is Linux ARM64:

File: ./libexec/git-core/git-remote-http
 0x0000000000000001 (NEEDED)             Shared library: [libcurl.so.4]
 0x0000000000000001 (NEEDED)             Shared library: [libexpat.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libz.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libpthread.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [librt.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [ld-linux-aarch64.so.1]

@shiftkey
shiftkey force-pushed the switch-back-to-openssl branch from 0446e1d to 8605fd1 Compare July 23, 2018 14:25
@shiftkey
shiftkey merged commit 96fc412 into master Jul 23, 2018
@shiftkey
shiftkey deleted the switch-back-to-openssl branch July 23, 2018 15:46
sergiou87 pushed a commit that referenced this pull request Aug 6, 2026
Fixes #527.

CI installed libcurl4-gnutls-dev, so git-remote-https ended up with a
NEEDED entry for libcurl-gnutls.so.4 — a Debian/Ubuntu-only SONAME that
is absent on Fedora/RHEL/CentOS, breaking HTTPS clone/fetch there.

Switch the build dependency to libcurl4-openssl-dev across all four
arches so the binary links against the standard libcurl.so.4 SONAME,
which is present on all mainstream distros. This restores the behaviour
PR #102 provided (by building curl from source against OpenSSL) that was
dropped in c64f13f (PR #524), without reintroducing the from-source
build.

Also drop the now-unused CURL_INSTALL_DIR plumbing left behind by that
change.

Co-authored-by: Copilot App <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant