Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 321303 - media-tv/ivtv-utils: fails with forced --as-needed
Summary: media-tv/ivtv-utils: fails with forced --as-needed
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High QA (vote)
Assignee: Steve Dibb (RETIRED)
URL: http://www.gentoo.org/proj/en/qa/asne...
Whiteboard:
Keywords:
Depends on:
Blocks: as-needed
  Show dependency tree
 
Reported: 2010-05-24 12:21 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2010-06-29 19:32 UTC (History)
4 users (show)

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


Attachments
Build log (ivtv-utils-1.4.0-r1:20100524-062439.log,4.71 KB, text/plain)
2010-05-24 12:22 UTC, Diego Elio Pettenò (RETIRED)
Details
ivtv-utils-1.4.0-r1.diff (ivtv-utils-1.4.0-r1.diff,1.15 KB, patch)
2010-05-24 16:01 UTC, Kacper Kowalik (Xarthisius) (RETIRED)
Details | Diff
multiple fixes (ivtv-utils-1.4.0-gentoo.patch,2.49 KB, patch)
2010-05-24 16:01 UTC, Kacper Kowalik (Xarthisius) (RETIRED)
Details | Diff
multiple fixes (ivtv-utils-1.4.0-gentoo.patch,2.49 KB, patch)
2010-06-08 19:49 UTC, Kacper Kowalik (Xarthisius) (RETIRED)
Details | Diff
multiple fixes (ivtv-utils-1.4.0-gentoo.patch,2.41 KB, patch)
2010-06-09 05:42 UTC, Kacper Kowalik (Xarthisius) (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2010-05-24 12:21:57 UTC
I'm reporting this bug because the package in summary fails to build when forcing --as-needed on through spec files (check out http://blog.flameeyes.eu/2008/11/14/problems-and-mitigation-strategies-for-as-needed for details).

Please note that this bug _might_ apply to -Wl,--as-needed in LDFLAGS as well; in both cases it should be fixed. Also, if this is due to the package in question not respecting user-defined LDFLAGS, you should get to fix that too.

Check the attached build log.

Thanks,
Diego
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-05-24 12:22:18 UTC
Created attachment 232701 [details]
Build log
Comment 2 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2010-05-24 16:01:04 UTC
Created attachment 232733 [details, diff]
ivtv-utils-1.4.0-r1.diff

Build system of this package is a mess and I had to patch all Makefiles to make it sane. Additionally I did following changes to ebuild itself:
 * move compilation phase to src_compile()
 * don't install unneeded files rather than remove them from ${D} (see patch)
 * force build system to respect CC and CXX
 * add missing die's

NOTE: building of test could be entirely skipped (by e.g. adding -C utils to all emakes) as binaries are not used nor installed.
Comment 3 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2010-05-24 16:01:35 UTC
Created attachment 232735 [details, diff]
multiple fixes

see patch header for full description
Comment 4 Kevin Pyle 2010-05-25 02:22:48 UTC
(In reply to comment #3)
> Created an attachment (id=232735) [details]
> see patch header for full description

The cleanups are appreciated, but I noticed one change you may not have intended.  Your patch to the top level Makefile switches from two calls of make -C to instead use a shell for loop.  Aside from the potentially unwanted serialization this enforces, this can mask errors.  As written, only a failure of the for loop will cause make to exit failure, and the for loop will only exit with failure if the last directory processed fails.  Thus, a compilation failure might not cause make to report failure, which would cause your new ||die to be ineffective.  To see the unwanted behavior:

mkdir a b
echo -e 'all:\n\tfalse' > a/Makefile
echo -e 'all:\n\ttrue' > b/Makefile
echo -e 'all:\n\tfor d in a b; do $(MAKE) -C $$d $@; done' >Makefile
make || echo Build failed

Since b/ succeeds, the top level succeeds, and the ||echo is never executed.  Adding "|| exit $$?" after $@ causes the subshell to bail out early with a failure code, so that the top level make reports an error.
Comment 5 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2010-06-08 19:49:43 UTC
Created attachment 234575 [details, diff]
multiple fixes

Fixing my attempt to be too smart. Thanks Kyle for noticing.

@Kyle
Next time if you notice I do something stupid please CC me (if I'm not already there). I've stumbled upon your comment by accident...
Comment 6 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2010-06-08 19:51:51 UTC
(In reply to comment #5)
s/Kyle/Kevin/g 
I'm terribly sorry :( I've merged you name with surname, too tired...

Comment 7 Kevin Pyle 2010-06-09 03:00:28 UTC
(In reply to comment #5)
> Created an attachment (id=234575) [details]
> multiple fixes
> 
> Fixing my attempt to be too smart. Thanks Kyle for noticing.

I think you attached the wrong file.  The new file (attachment #234575 [details, diff]) is byte-for-byte identical to the old file (attachment #232735 [details, diff]) that you superseded.

> @Kyle
> Next time if you notice I do something stupid please CC me (if I'm not already
> there).

I shall do so.

(In reply to comment #6)
> (In reply to comment #5)
> s/Kyle/Kevin/g 
> I'm terribly sorry :( I've merged you name with surname, too tired...

This happens to me on a fairly regular basis.  You are not the first, and will doubtless not be the last.
Comment 8 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2010-06-09 05:42:48 UTC
Created attachment 234639 [details, diff]
multiple fixes

(In reply to comment #7)
> I think you attached the wrong file.
Fixed. Thanks! I solemnly swear not to spam this bug anymore...
Comment 9 Kacper Kowalik (Xarthisius) (RETIRED) gentoo-dev 2010-06-29 19:32:03 UTC
+  29 Jun 2010; Kacper Kowalik <xarthisius@gentoo.org>
+  ivtv-utils-1.4.0-r1.ebuild, +files/ivtv-utils-1.4.0-gentoo.patch:
+  QA clean up and fixing build with --as-needed wrt bug 321303. Thanks to
+  Diego for reporting.
+