Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 386487 - app-emulation/xen-tools-4.1.1-r5, 4.1.2 emerge fails due to improper output of `curl-config --libs`
Summary: app-emulation/xen-tools-4.1.1-r5, 4.1.2 emerge fails due to improper output o...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Xen Devs
URL:
Whiteboard:
Keywords:
: 361677 388627 389025 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-10-09 01:58 UTC by Tobias Heinlein (RETIRED)
Modified: 2013-03-04 14:15 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
a patch for configuring curl (xen-tools-4.1.1-curl.patch,528 bytes, patch)
2011-10-13 17:00 UTC, Ian Delaney (RETIRED)
Details | Diff
diff patch for xen-tools 4.1.1 ebuild (xen-4.1.1-curl.patch,6.15 KB, patch)
2011-10-13 17:07 UTC, Ian Delaney (RETIRED)
Details | Diff
another patch for configuring curl (xen-tools-4.1.1-curl2.patch,491 bytes, patch)
2011-10-13 18:34 UTC, Ian Delaney (RETIRED)
Details | Diff
adjusted xen ebuild (xen-4.1.1-curl.patch,529 bytes, patch)
2011-10-18 14:09 UTC, Ian Delaney (RETIRED)
Details | Diff
same as last, non-preferred obsoleted (xen-4.1.1-curl.patch,529 bytes, patch)
2011-10-18 14:41 UTC, Ian Delaney (RETIRED)
Details | Diff
fix xen check_curl script (xen-tools-4.1.1-curl.patch,443 bytes, text/plain)
2011-10-26 14:01 UTC, Paul Freeman
Details
xen-tools-4.1.2.ebuild patch (patch,579 bytes, patch)
2011-10-26 14:10 UTC, Another Mortal
Details | Diff
updated patch to fix check_curl (xen-tools-4.1.1-curl.patch,558 bytes, patch)
2012-02-29 01:11 UTC, ron widler
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Heinlein (RETIRED) gentoo-dev 2011-10-09 01:58:58 UTC
>>> Compiling source in /var/tmp/portage/app-emulation/xen-tools-4.1.1-r5/work/xen-4.1.1 ...
make -j5 -C tools 
make: Entering directory `/var/tmp/portage/app-emulation/xen-tools-4.1.1-r5/work/xen-4.1.1/tools'
make[1]: Entering directory `/var/tmp/portage/app-emulation/xen-tools-4.1.1-r5/work/xen-4.1.1/tools'
make -C check all
make[2]: Entering directory `/var/tmp/portage/app-emulation/xen-tools-4.1.1-r5/work/xen-4.1.1/tools/check'
PYTHON=python LIBXENAPI_BINDINGS=y ACM_SECURITY=n ./chk build
Xen CHECK-BUILD  Sun Oct 9 03:48:05 CEST 2011
Checking check_crypto_lib: OK
Checking check_curl: 
 *** check_curl FAILED: dependency libraries for curl are missing
Checking check_openssl_devel: OK
Checking check_python: OK
Checking check_python_devel: OK
Checking check_uuid_devel: OK
Checking check_x11_devel: OK
Checking check_xgettext: OK
Checking check_xml2: OK
Checking check_zlib_devel: OK
Checking check_zlib_lib: OK
make[2]: *** [check-build] Error 1
make[2]: Leaving directory `/var/tmp/portage/app-emulation/xen-tools-4.1.1-r5/work/xen-4.1.1/tools/check'
make[1]: *** [subdir-all-check] Error 2
make[1]: Leaving directory `/var/tmp/portage/app-emulation/xen-tools-4.1.1-r5/work/xen-4.1.1/tools'
make: *** [subdirs-all] Error 2
make: Leaving directory `/var/tmp/portage/app-emulation/xen-tools-4.1.1-r5/work/xen-4.1.1/tools'
emake failed
 * ERROR: app-emulation/xen-tools-4.1.1-r5 failed (compile phase):
 *   compile failed
 * 
 * Call stack:
 *     ebuild.sh, line  91:  Called src_compile
 *   environment, line 5254:  Called die
 * The specific snippet of code:
 *       emake -C tools ${myopt} || die "compile failed";


The check_curl script relies on the output of `curl-config --libs` and uses it to call ld. If curl was emerged with USE="nss" this will fail because the curl-config output looks like this:

-lcurl -lcares -lidn -lldap -lrt -lz -Wl,-R/usr/lib64 -lssl3 -lsmime3 -lnssutil3 -lnss3 -lplds4 -lplc4 -lnspr4 -lpthread

ld doesn't understand the -W flag and thus fails.

I'm not sure if the existence of the -W flag in that output is a bug in our curl per se (as in: e.g. other tools can rely on that output to work with ld) and if it can be removed somehow.

Please advise if curl or xen-tools needs to be fixed.
Comment 1 Ian Delaney (RETIRED) gentoo-dev 2011-10-13 17:00:09 UTC
Created attachment 289741 [details, diff]
a patch for configuring curl

It could go either way, but it can be managed in xen-tools with this one liner patch.
Comment 2 Ian Delaney (RETIRED) gentoo-dev 2011-10-13 17:07:32 UTC
Created attachment 289743 [details, diff]
diff patch for xen-tools 4.1.1 ebuild
Comment 3 Christoph Mende (RETIRED) gentoo-dev 2011-10-13 17:44:25 UTC
I'd say fix xen. The -Wl,foo flags are for gcc so it passes them to the linker, changing that in curl will break other build systems that rely on the existance of the -Wl (i.e. those that use gcc for linking, autotools for example)
Comment 4 Ian Delaney (RETIRED) gentoo-dev 2011-10-13 18:34:21 UTC
Created attachment 289751 [details, diff]
another patch for configuring curl

alternate method of making a fix for curl in xen-tools
Comment 5 Ian Delaney (RETIRED) gentoo-dev 2011-10-13 20:38:58 UTC

*** This bug has been marked as a duplicate of bug 364565 ***
Comment 6 Ian Delaney (RETIRED) gentoo-dev 2011-10-13 20:43:06 UTC

*** This bug has been marked as a duplicate of bug 361677 ***
Comment 7 Tony Vroon (RETIRED) gentoo-dev 2011-10-18 13:50:40 UTC
*** Bug 361677 has been marked as a duplicate of this bug. ***
Comment 8 Tony Vroon (RETIRED) gentoo-dev 2011-10-18 13:51:28 UTC
Reopening most useful report, as it has patches. Ian, please mark all patches you do not want to use as "obsolete".
Comment 9 Ian Delaney (RETIRED) gentoo-dev 2011-10-18 14:09:17 UTC
Created attachment 290159 [details, diff]
adjusted xen ebuild
Comment 10 Ian Delaney (RETIRED) gentoo-dev 2011-10-18 14:41:21 UTC
Created attachment 290163 [details, diff]
same as last, non-preferred obsoleted
Comment 11 Christoph Mende (RETIRED) gentoo-dev 2011-10-20 17:21:18 UTC
Re-assigning wrt comment #3
Comment 12 Alexey Shvetsov archtester gentoo-dev 2011-10-24 12:01:30 UTC
Fixed in r6
Comment 13 Another Mortal 2011-10-26 13:50:34 UTC
Same problem in xen-tools-4.1.2 ...  )-;
Comment 14 Paul Freeman 2011-10-26 13:59:50 UTC
ahem any testing done here ? :) (this applies equally to 4.1.1-r6 4.1.2 etc as they use the same check_curl script)

this doesn't even look right:

@@ -9,5 +9,5 @@
 fi
 
 has_or_fail curl-config
-curl_libs=`curl-config --libs` || fail "curl-config --libs failed"
+curl_libs=`echo $curl_libs |sed -e 's/-W[^[:space:]]*[[:space:]]//'` || fail "curl-config --libs failed"
 test_link $curl_libs || fail "dependency libraries for curl are missing"

at this point curl_libs would not be set and although the sed is correct curl_libs is unset so this will do nothing for us ;)

as a side note: the sed also needs to be extend slightly if you also have net-misc/curl[kerberos] in your system too, see attached updated check_curl patch


it should be (excuse hand diff editing here :) :

@@ -9,5 +9,6 @@
 fi
 
 has_or_fail curl-config
 curl_libs=`curl-config --libs` || fail "curl-config --libs failed"
+curl_libs=`echo $curl_libs |sed -e 's/-W[^[:space:]]*[[:space:]]//'` || fail "curl-config --libs failed"
 test_link $curl_libs || fail "dependency libraries for curl are missing"


test case, in the ebuild add add shell bounds checking + debug to tools/check/check_curl

sed -i -e 's|has_or_fail curl-config|has_or_fail curl-config\nset -ux|' tools/check/check_curl

emerge... (4.1.2 used here but also applies to 4.1.1*)

Checking check_curl: ./check_curl: line 13: curl_libs: unbound variable
++ sed -e 's/-W[^[:space:]]*[[:space:]]//'
+ curl_libs=
+ test_link
+ unset tmpfile
+ trap 'rm -f "$tmpfile"; exit' 0 1 2 15
++ mktemp
+ tmpfile=/var/tmp/portage/app-emulation/xen-tools-4.1.2-r1/temp/tmp.LI3kr9Wc98
+ ld -o /var/tmp/portage/app-emulation/xen-tools-4.1.2-r1/temp/tmp.LI3kr9Wc98
+ return 1
++ rm -f /var/tmp/portage/app-emulation/xen-tools-4.1.2-r1/temp/tmp.LI3kr9Wc98
++ exit
+ fail 'dependency libraries for curl are missing'
+ echo

++ basename ./check_curl
+ echo ' *** check_curl FAILED: dependency libraries for curl are missing'
 *** check_curl FAILED: dependency libraries for curl are missing
+ exit 1

xen-tools-4.1.x compile correctly with the updated patch and net-misc/curl
Comment 15 Paul Freeman 2011-10-26 14:01:02 UTC
Created attachment 290881 [details]
fix xen check_curl script
Comment 16 Another Mortal 2011-10-26 14:01:21 UTC
Actually, it's not quite the same problem...
It's the patch added in 4.1.1-r6 that seems
to break things in both 4.1.1-r6 and 4.1.2 ...
(4.1.1-r5 built fine with USE=api and no patch...)
Comment 17 Another Mortal 2011-10-26 14:10:55 UTC
Created attachment 290883 [details, diff]
xen-tools-4.1.2.ebuild patch

Verified that xen-tools-4.1.2 builds fine after removing the offending patch...
Comment 18 Paul Freeman 2011-10-26 14:58:34 UTC
(In reply to comment #17)
> Created attachment 290883 [details, diff]
> xen-tools-4.1.2.ebuild patch
> 
> Verified that xen-tools-4.1.2 builds fine after removing the offending patch...

removing the patch will only work for the edge case where you have net-misc/curl[-kerberos,-nss] if you have either of those use flags enabled you will need the updated patch as they change the output of curl-config --libs
Comment 19 Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2011-10-27 11:03:19 UTC
*** Bug 388627 has been marked as a duplicate of this bug. ***
Comment 20 Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2011-10-27 11:04:32 UTC
Can somebody reopen bug while 4.1.2 is not fixed? :)
Comment 21 Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2011-10-27 13:07:23 UTC
Btw, as I can see in work/xen-4.1.2/tools/check/funcs.sh — upstream added stripping of "-W*". In this way, I think it is just enough to remove patch for 4.1.1 from 4.1.2 ;)
Comment 22 Paul Freeman 2011-10-27 13:34:41 UTC
(In reply to comment #21)
> Btw, as I can see in work/xen-4.1.2/tools/check/funcs.sh — upstream added
> stripping of "-W*". In this way, I think it is just enough to remove patch for
> 4.1.1 from 4.1.2u ;)

it's not enough as you need strip more than just -W, like -pipe -march= etc etc
Comment 23 Ian Delaney (RETIRED) gentoo-dev 2011-10-27 13:59:10 UTC
Paul Freeman, you're welcome to hazard a suggested list of content to strip out, but your last suggestion appears to be off the mark.

-lcurl -lcares -lidn -lssh2 -lssl -lcrypto -lrt -lssl -lcrypto -ldl -lz -lz -lssh2
at a glance appears a valid output, all -l entries, and it failed with use api without curl[nss].
Looking for any good way of patching it opposed to removing the thing entirely which allows an effective compile
Comment 24 Paul Freeman 2011-10-27 14:47:16 UTC
(In reply to comment #23)
> Paul Freeman, you're welcome to hazard a suggested list of content to strip
> out, but your last suggestion appears to be off the mark.
> 

hey I'm not here for any acrimonious disputes - just to get xen working :)

> -lcurl -lcares -lidn -lssh2 -lssl -lcrypto -lrt -lssl -lcrypto -ldl -lz -lz
> -lssh2
> at a glance appears a valid output, all -l entries, and it failed with use api
> without curl[nss].
> Looking for any good way of patching it opposed to removing the thing entirely
> which allows an effective compile

well I guess there is always the argument for removing, perhaps you could say that if you have curl installed it will already have pulled in the required runtime depends (and usually headers + libs since it's not the Gentoo norm to separate the dev headers/libs into separate packages) and do we need the xen build check anyway?

so you have a fail with xen-tools[api] & curl[-nss]? interesting, what are your use flags for curl ?


FYI if you add kerberos to curl's use flags you also get -march= -pipe etc in the curl-config --libs output.
Comment 25 Ian Delaney (RETIRED) gentoo-dev 2011-10-27 16:22:48 UTC
Paul, 
seems you forgot to tell me to read your comment 14, I completely missed it in between the to-ing and fro-ing between comments 1 -10,  Chocolates to you, the patch was missing the line that defined the curl_libs, a broken patch.
The notion of deleting it was mentioned in irc by the poster, the rationale exactly as you described in your last comment. Both the patch and deleting the check work to effect xen-tools to compile.

gentoo64 xen-tools # ebuild xen-tools-4.1.2.ebuild clean compile
make: Leaving directory `/var/tmp/portage/portage/app-emulation/xen-tools-4.1.2/work/xen-4.1.2/docs'
>>> Source compiled.

ditto gentoo64 xen-tools # ebuild xen-tools-4.1.1-r6.ebuild compile

#gentoo64 xen-tools # eix curl
       Installed versions:  7.22.0(21:36:14 10/27/11)(gnutls kerberos ldap ssl static-libs threads -ares -idn -ipv6 -libssh2 -nss -test)

  gentoo64 xen-tools # curl-config --libs
-lcurl -lgcrypt -lldap -lrt -L/usr/lib64 -march=athlon64 -fomit-frame-pointer -pipe -O3 -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lkeyutils -lresolv -ldl -lz -lgnutls

I also tried the xen-tools-4.1.2 with your added sed statement
sed -i -e 's|has_or_fail curl-config|has_or_fail curl-config\nset -ux|'
tools/check/check_curl

which also lead to an effective compile.  Seems we are spoilt for choice.  My recommend is the patch as it should have been, your sed statement can be an option for xen dev
Comment 26 Ian Delaney (RETIRED) gentoo-dev 2011-10-30 07:49:55 UTC
Paul, care to test?
Comment 27 Paul Freeman 2011-10-31 14:21:08 UTC
(In reply to comment #25)
> Paul, 
> seems you forgot to tell me to read your comment 14, I completely missed it in
> between the to-ing and fro-ing between comments 1 -10,  Chocolates to you, the

hehe easily done :)
Comment 28 Paul Freeman 2011-10-31 14:21:36 UTC
(In reply to comment #26)
> Paul, care to test?

confirmed also working with simple rm of the check_curl script on 4.1.1-r6 & 4.1.2 as well as with the updated patch.

just as a side note, there are some other check function scripts in the the same directory (tools/check) for checking libxml2 etc, they might also become an issue if for example xml2-config --libs were to change its output.
Comment 29 Ian Delaney (RETIRED) gentoo-dev 2011-11-04 10:39:34 UTC
good one Paul, good contribution

for checking libxml2 etc,

duly noted
Comment 30 Ian Delaney (RETIRED) gentoo-dev 2011-11-07 19:18:57 UTC
*** Bug 389025 has been marked as a duplicate of this bug. ***
Comment 31 ron widler 2012-02-29 01:11:17 UTC
Created attachment 303651 [details, diff]
updated patch to fix check_curl

i just ran into this bug again just now, when trying to compile app-emulation/xen-tools-4.1.2-r2 ...
this time ld failed because of "-pthread", with this patch the check succeeded.
Comment 32 Ian Delaney (RETIRED) gentoo-dev 2013-03-04 14:15:51 UTC
(In reply to comment #31)
> Created attachment 303651 [details, diff] [details, diff]
> updated patch to fix check_curl
> 
> i just ran into this bug again just now, when trying to compile
> app-emulation/xen-tools-4.1.2-r2 ...
> this time ld failed because of "-pthread", with this patch the check
> succeeded.

eeeer, do you mean 4.1.2? It was dropped from portage.  xen-4.2.1/tools/ has no check folder