As part of an effort to find and eliminate direct calls to 'make', I devised a function in /etc/portage/bashrc that shadows make, prints a warning, then calls the real one (or calls emake, depending on the exact goal). However, this also catches uses of make that happen to be safe, such as the one in linux-info.eclass, where getfilevar invokes make to parse the kernel Makefile and print data produced from it. By changing getfilevar to use emake, this warning can be avoided, making it easier to see if an ebuild that includes linux-info also uses make in an improper manner. For users who do not have the shadowing helper function, this change will only have the effect of passing their MAKEOPTS to the temporary make, which should be harmless. This shadow function premiered in bug #226789, but I have not been aggressive about pushing its use elsewhere. (Although, Diego did promptly incorporate it into his tinderbox. :) If you want to use it, it is available as bug #226789, comment #7; a slightly newer version is shown here. make() { eqawarn "Local QA notice: 'make' called by ${FUNCNAME[1]}: $CATEGORY/$PF" # Derived from die()'s stack tracer _local_dump_trace eqawarn 1 emake -j1 "$@" }
There is a problem. emake invokes helpers_die on failure, which pollutes the output or dies entirely, which we don't want.
I see that in the presently installed amd64 Portage, but I do not recall seeing that there when I wrote the emake shadow. Even so, my version which chains to emake does not seem to induce failures when building on systems with no kernel sources available. I usually only make sources available if an ebuild absolutely refuses to proceed without a configured kernel. I recently successfully built udev-164-r2, which uses linux-info.eclass and thus triggered the warnings that prompted me to file this enhancement request.
we can [ab]use nonfatal to avoid the noise issue http://sources.gentoo.org/eclass/linux-info.eclass?r1=1.97&r2=1.98