This is more or less a bug about the problem dbus will become if FEATURES="test" would become default in any profile, devel as well as regular. Posted after dirtyepic told me to on gentoo-dev@l.g.o. The problem is that if dbus is compiled with FEATURES="test" then there is a lot of functions enabled in the bins/libs that are meant for unittesting and only unittesting, which renders the library more unstable and more insecure. Therefore it is not advised to use it wth FEATURES="test", only test it and then recompile. The problem is that if FEATURES="test" would become default for any profile is pretty obvious. So how we should handle this is an interesting question, since in another bug it was mentioned that these tests are good for ATs. So anuther test-useflag like USE="unsafetests" or something more obscure to solve this? And a policy to handle these kinds of packages, if more packages then dbus has these kinds of problems?
Please start a discussion about this on the mailing list, this is likely something that other packages might do.
i'm planning on bringing it up soon.
I think general policy for packages should be -- do not install broken packages in case user did not requested that. FEATURES=test looks like 'safe' as it was just request to test our package... So I think best solution for this bug (as Jeroen suggested on gentoo-dev and since out-of-sources build is possible here) is to build dbus twice with and without tests enabled. http://archives.gentoo.org/gentoo-dev/msg_fc8d40428c73b510a429467569b28ec8.xml
I agree it is a reasonable solution here, anyone mind providing a patch ?
Created attachment 207478 [details, diff] Build tests in ${T}/tests Here's a patch that copies the prepared sources into ${T}/tests and then runs configure/make/make check in src_test. --enable-tests need to be passed to configure, and hence out-of-tree builds can't be done (afaik, they're done at the `make` level). The big chunk of changes to econf args are just removal of the '\' at the end. The only change is unconditional --disable-tests
it sounds wrong to not respect phases even for something specific like this.
(In reply to comment #6) > it sounds wrong to not respect phases even for something specific like this. > But since we definitely have to run ./configure again (but in a separate place); do we have a choice? We could make it transparent to the user by sending all output from econf and emake in src_test to /dev/null ~ it'll certainly reduce noise.
Why not move: + # We need to build in a separate tree for the tests because + # having unit tests enabled results in an insecure library + cd "${T}/tests" || die "cd tests failed" + + einfo "Configuring a separate tree for building tests" + econf ${ECONF} \ + $(use_enable test tests) \ + $(use_enable test asserts) \ + || die "test econf failed" + + einfo "Building tests" + emake || die "test make failed" to src_compile phase running it only when USE=test? I mean, src_compile could run econf&&emake for normal build and, after that, if use=test, go to "${T}/tests" and run econf&&emake for tests. Then, when reaching src_test phase, it would simply run "DBUS_VERBOSE=1 make check" under "${T}/tests"
Created attachment 207676 [details, diff] dbus-1.3.0.ebuild-tests.patch This patch works here. It uses 2 directories for build: $BD aka build directory - for normal build, $TBD aka tests build directory - build dbus for tests. All other modifications jump around this change.
I like this patch. Any objections from other fdo guys ?
a) I thought dbus is not EAPI=2 for a reason (maybe system-package logic?) b) Aren't the regenerated html docs with USE=doc going to waste here? I think the cd ${BD} followed by emake install should be done at the beginning of src_install; not the end
(In reply to comment #11) > a) I thought dbus is not EAPI=2 for a reason (maybe system-package logic?) not that I know, python, bash and everything that revolves around portage would match that, but certainly not dbus. > b) Aren't the regenerated html docs with USE=doc going to waste here? depends on if there is a make check for docs
Created attachment 207705 [details, diff] dbus-1.3.0.ebuild-tests.patch (In reply to comment #12) > (In reply to comment #11) > > b) Aren't the regenerated html docs with USE=doc going to waste here? > > depends on if there is a make check for docs Hm, as I see doc USE flag does not work in original ebuild too. At least I see: !!! dohtml: doc/*html does not exist and checking sources reveals that --enable-doxygen just defines conditional: AM_CONDITIONAL(DBUS_DOXYGEN_DOCS_ENABLED, test x$enable_doxygen_docs = xyes) and this conditional is not used anywhere outside configure... The patch in attachement fixes this and drops unused doxygen dep.
Should be fixed in 1.3.0-r1. Feel free to reopen if it's still causing you problems. Thanks all for your contributions.