2

I want php's curl on travis-ci to use GnuTls 3.1.28 instead of the default GnuTls 2.12. I set up an experimental ec2 instance where my compilation leads me to successfully use gnutls3, but this doesn't work on the travis-ci worker.

Running

ldd /usr/lib/php5/20090626/curl.so|grep gnutls

on the ec2 instance yields

/usr/lib/php5/20090626/curl.so: /usr/local/lib/libcurl.so.4: no version information available (required by /usr/lib/php5/20090626/curl.so)
        libgnutls.so.28 => /usr/local/lib/libgnutls.so.28 (0x00007f58946e5000)

showing that it's referencing GnuTls 3.1.28 that I compiled

but on the travis-ci workers yields

/usr/lib/php5/20090626/curl.so: /usr/local/lib/libcurl.so.4: no version information available (required by /usr/lib/php5/20090626/curl.so)
    libgnutls.so.26 => /usr/lib/x86_64-linux-gnu/libgnutls.so.26 (0x00002aca991d0000)

showing that it's still referencing GnuTls 2.12 (full log here )

A var_dump(curl_version()) confirms this.

My specific commands are found here

Is there something specific to travis-ci workers that I'm missing?

Shadi
  • 9,742
  • 4
  • 43
  • 65
  • Hi, I've looked at your build log quickly and it seems that curl's compilation picks up GNUTls 2.12.26 from `/usr/lib/x86_64-linux-gnu` and 2.12.28 is located in `/usr/local/lib`. Else I think you cannot specify the directory of 2.12.28 with the `--with-gnutls` compilation switch. It only tells to compile with GNUTls instead of OpenSSL. Hence I think either you need to copy 2.12.28 in `/usr/lib/x86_64-linux-gnu` or make the directory `/usr/local/lib` have precedence when looking for libs while compiling curl. Hope this helps. – Dominic Jodoin Jun 01 '15 at 16:34
  • You would have to recompile and reinstall `php` in order to modify `curl.so` shared object. Also, looking at the log, it seems your `libcurl` is built against `openssl`, because you are giving wrong path to `gnutls`. Try `--with-gnutls=/usr/local`. – baf Jun 02 '15 at 13:21
  • I tried `--with-gnutls=/usr/local` , but it didn't help. I also tried `--without-ssl --with-gnutls` without paths, and what it did was that the output of `ldd /usr/lib/php5/20090626/curl.so|grep gnutls` now shows both the libgnutls.so.26 and libgnutls.so.28, but `var_dump(curl_version())` still shows that it's using GnuTLS/2.12.14 (i.e. from libgnutls.so.26) (most recent log [here](https://s3.amazonaws.com/archive.travis-ci.org/jobs/65533351/log.txt)) – Shadi Jun 05 '15 at 09:23
  • How does the file `/usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4` get generated? When I compile curl with the `--with-gnutls` flag, I don't get such a file generated in `/usr/local/lib`. I thought it would be the `--suffix` configuration option, but I tried it, and that's not it – Shadi Jun 08 '15 at 05:20
  • 1
    on a sidenote, travis-ci workers use phpenv. I'd appreciate if someone points me at any special documentation that I need to look at regarding compiling curl to run with a php version in phpenv – Shadi Jun 08 '15 at 15:47

1 Answers1

0

It turned out that installing a separate php CLI on the travis-ci worker other than the ones that it already had (in phpenv) solved it for me. The php binary /usr/bin/php5 was linking properly to the curl and gnutls libraries that I install in /usr/local/lib, but the binaries that phpenv automatically used didn't.

Shadi
  • 9,742
  • 4
  • 43
  • 65