Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#22529 - Pacman configure assumes libfetch is built with -lcrypto (i.e. openssl)

Attached to Project: Pacman
Opened by shinythings (shinythings) - Thursday, 20 January 2011, 20:26 GMT
Last edited by Dan McGee (toofishes) - Wednesday, 23 March 2011, 15:38 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 3.4.2
Due in Version 4.0.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:

Pacman ./configure fails to detect libfetch if it is not built with openssl (libcrypto).

Workaround:

--- configure 2010-12-15 05:59:19.000000000 +0700
+++ configure-fixed 2011-01-21 03:23:44.196671136 +0700
@@ -12350,7 +12350,7 @@
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfetch -lcrypto -ldl $LIBS"
+LIBS="-lfetch -ldl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

Steps to Reproduce:

Build libfetch without openssl.
Try to configure pacman.

#: ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var

[...]
checking for archive_read_data in -larchive... yes
checking whether to link with libfetch... yes
checking for fetchParseURL in -lfetch... no
configure: error: libfetch is needed to compile with internal download support

#: pacman -Ql libfetch

libfetch /usr/
libfetch /usr/include/
libfetch /usr/include/fetch.h
libfetch /usr/lib/
libfetch /usr/lib/libfetch.a
libfetch /usr/lib/libfetch.so
libfetch /usr/share/
libfetch /usr/share/man/
libfetch /usr/share/man/man3/
libfetch /usr/share/man/man3/fetch.3.gz

#: ls -lh /usr/include/fetch.h /usr/lib/libfetch*

-rw-r--r-- 1 root root 5.9K Jan 21 02:10 /usr/include/fetch.h
-rw-r--r-- 1 root root 71K Jan 21 02:10 /usr/lib/libfetch.a
-rwxr-xr-x 1 root root 52K Jan 21 02:10 /usr/lib/libfetch.so

#: ldd /usr/lib/libfetch.so

linux-gate.so.1 => (0xb7896000)
libc.so.6 => /lib/libc.so.6 (0xb7729000)
/lib/ld-linux.so.2 (0xb7897000)
This task depends upon

Closed by  Dan McGee (toofishes)
Wednesday, 23 March 2011, 15:38 GMT
Reason for closing:  Won't fix
Additional comments about closing:  We are now using cURL exclusively, no more libfetch.
Comment by Dan McGee (toofishes) - Thursday, 20 January 2011, 20:48 GMT
First off, a change to configure.ac would be much more useful since configure is just a generated script. I'm not totally certain why it fails- do you have openssl installed at all? Extra links shouldn't hurt, and dl/crypto are already listed in the 'other-libraries' argument of AC_CHECK_LIB() (http://www.gnu.org/software/hello/manual/autoconf/Libraries.html). They shouldn't be included if they don't need to be; perhaps switching the order of the libraries listed there helps?
Comment by shinythings (shinythings) - Thursday, 20 January 2011, 21:05 GMT
Yes true. Unfortunately I can't seems to regenerate configure, so the above, so a quick sed to configure was the quickest workaround. The change to configure.ac would probably be something like this (though I suspect this will break something when building with openssl, or I suspect it wouldn't be there).

--- configure.ac 2010-12-15 05:58:49.000000000 +0700
+++ configure.ac-fixed 2011-01-21 04:01:18.536671136 +0700
@@ -143,7 +143,7 @@
AC_DEFINE([INTERNAL_DOWNLOAD], , [Use internal download library])
# Check for a download library if it was actually requested
AC_CHECK_LIB([fetch], [fetchParseURL], ,
- AC_MSG_ERROR([libfetch is needed to compile with internal download support]), [-lcrypto -ldl] )
+ AC_MSG_ERROR([libfetch is needed to compile with internal download support]), [-ldl] )
# Check if libfetch supports conditional GET
# (version >=2.21, struct url has member last_modified)
AC_CHECK_MEMBER(struct url.last_modified, ,

I am currently building on a system that has no openssl at all. With the configure workaround, pacman builds and works just fine.

By the way, this may be relevant: http://archlinux.2023198.n4.nabble.com/PATCH-Fix-cross-compilation-issues-with-git-and-libfetch-td2061788.html
Comment by Dan McGee (toofishes) - Thursday, 20 January 2011, 21:12 GMT
The only patch I will take is a patch that works and *isn't a regression for all of the rest of us*. Also, if you touch configure.ac, the Makefile rules auto-regenerate configure, so I'm not sure what difficulty you are seeing.

Re: Relevant, note that there were two patches in a row in the git repo, the one you point out (bf7c3eb17f4de35f6639b2f3f0c1c06a27b5242b) followed by 6b6eb6345bb3d9f59d967144968328c9a4b7873c which backed out most of those changes because it must have caused breakage because it wasn't doing things right.
Comment by shinythings (shinythings) - Thursday, 20 January 2011, 21:59 GMT
That's fair enough. Failure to re-generate configure was my own stupidity.

Rebuilding pacman with the configure.ac change on a standard archlinux system in which both libarchive and libfetch are built with openssl support and where openssl is (of course) installed, results in a working pacman. Building pacman with the configure.ac change on a system in which both libarchive and libfetch are built without openssl support and where openssl is NOT installed, also results in a working pacman. That's pretty much the only testing I can do at the moment, unless you have any particular suggestions. As I have no clue why the libcrypto reference is there in the first place, I can't say simply removing it would be fine, that's just a hackish workaround for my system. It seems to have been present since before the change I references, as you say.

This is a rather special corner case anyway (makepkg requires openssl, so why build libfetch without it), so I'm not sure you even want to fix it, but I thought you should be aware of it at least. Short of fixing it, you could simply explicitly require libfetch with openssl support, to make the message clearer.
Comment by Dan McGee (toofishes) - Thursday, 20 January 2011, 22:06 GMT
It works because the linker pulled it in anyway due to the inclusion of openssl right above it for the MD5 functions, more than likely. You will need to pass --without-openssl or -with-openssl=no to disable that.
Comment by shinythings (shinythings) - Thursday, 20 January 2011, 22:56 GMT
--without-openssl but libarchive and still results in no ill effects that I can see.

--without-openssl and with libarchive built without openssl (but libfetch with openssl) also seems to work.

--without-openssl and no openssl at all also seems to work.

Not sure what that means.

Loading...