[gentoo-dev] Re: Proposed change to base.eclass: EAPI-2 support
Thomas Rösner <[EMAIL PROTECTED]> posted [EMAIL PROTECTED], excerpted below, on Thu, 06 Nov 2008 02:27:15 +0100: > But with rotating storage, don't you (very much) only want one I/O-bound > job at a time? Invalid assumption(s). This is more a user list topic or personal wiki/ google research project, but there are at least four levels at which that is a likely invalid assumption on a well configured Gentoo Linux installation on modern hardware, particularly one where the user is not setting MAKEOPTS=1, thus indicating that he has and wants to use sufficient resources for parallel jobs in the first place. If you like, mail me offlist and we can continue the discussion, as it really is off topic for the gentoo-dev list. -- Duncan - List replies preferred. No HTML msgs. "Every nonfree program has a lord, a master -- and if you use the program, he is your master." Richard Stallman
Re: [gentoo-dev] Re: Proposed change to base.eclass: EAPI-2 support
Thomas Sachau wrote: > Do you really think, a package that supports parallel make while compiling > fails support for > parallel make support on install? > See bug 196728. It's an (old) automake issue. > And emake is and still should be the default. If there is an issue with it, > the ebuild author has to > change his ebuild. But this should not be taken to force only one makejob for > everyone else. > On Gentoo/FreeBSD where "make" is BSD make, emake knows when to use "gmake" instead, so pretty please, use emake instead of make.
Re: [gentoo-dev] Re: Proposed change to base.eclass: EAPI-2 support
Hi, > And emake is and still should be the default. If there is an issue with it, > the ebuild author has to > change his ebuild. But this should not be taken to force only one makejob for > everyone else. > But with rotating storage, don't you (very much) only want one I/O-bound job at a time? Regards, T.
Re: [gentoo-dev] Re: Proposed change to base.eclass: EAPI-2 support
On Wed, Nov 05, 2008 at 09:20:07PM +0100, Thomas Sachau wrote: > Peter Alfredsen schrieb: > Do you really think, a package that supports parallel make while compiling > fails support for > parallel make support on install? Happened for jabberd and jabberd2 to me. pgpjnLZOswT2t.pgp Description: PGP signature
Re: [gentoo-dev] Re: Proposed change to base.eclass: EAPI-2 support
On Wed, 05 Nov 2008 21:20:07 +0100 Thomas Sachau <[EMAIL PROTECTED]> wrote: > Do you really think, a package that supports parallel make while > compiling fails support for parallel make support on install? Yup, that's fairly common. -- Ciaran McCreesh signature.asc Description: PGP signature
Re: [gentoo-dev] Re: Proposed change to base.eclass: EAPI-2 support
Peter Alfredsen schrieb: > On Wednesday 05 November 2008, Thomas Sachau wrote: > >> You should at least use emake instead of make in src_install. And i >> would suggest to use something like this instead of the make install >> line (maybe add some other default docs, if they are common): >> >> if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then >> emake DESTDIR="${D}" install || die "emake install failed" >> fi >> if [ -n "${DOCS}" ]; then >> dodoc ${DOCS} || die "dodoc failed" >> else >> for x in AUTHORS ChangeLog NEWS README; do >> if [ -e ${x} ]; then >> dodoc ${x} || die "dodoc ${x} failed" >> fi >> done >> fi > > I only propose changes to update the base.eclass to using EAPI-2 > functions, IOW the above is outside the scope of what I propose. > > Besides, using emake instead of make is not a good change to make to an > eclass unless you know for a fact that all ebuilds using the eclass > have parallel make friendly makefiles. And even then... > So change your src_compile ;-) Do you really think, a package that supports parallel make while compiling fails support for parallel make support on install? And emake is and still should be the default. If there is an issue with it, the ebuild author has to change his ebuild. But this should not be taken to force only one makejob for everyone else. -- Thomas Sachau Gentoo Linux Developer signature.asc Description: OpenPGP digital signature
Re: [gentoo-dev] Re: Proposed change to base.eclass: EAPI-2 support
On Wednesday 05 November 2008, Thomas Sachau wrote: > You should at least use emake instead of make in src_install. And i > would suggest to use something like this instead of the make install > line (maybe add some other default docs, if they are common): > > if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then > emake DESTDIR="${D}" install || die "emake install failed" > fi > if [ -n "${DOCS}" ]; then > dodoc ${DOCS} || die "dodoc failed" > else > for x in AUTHORS ChangeLog NEWS README; do > if [ -e ${x} ]; then > dodoc ${x} || die "dodoc ${x} failed" > fi > done > fi I only propose changes to update the base.eclass to using EAPI-2 functions, IOW the above is outside the scope of what I propose. Besides, using emake instead of make is not a good change to make to an eclass unless you know for a fact that all ebuilds using the eclass have parallel make friendly makefiles. And even then... -- /PA signature.asc Description: This is a digitally signed message part.
Re: [gentoo-dev] Re: Proposed change to base.eclass: EAPI-2 support
Peter Alfredsen schrieb: > On Monday 03 November 2008, Steve Long wrote: >> Peter Alfredsen wrote: >>> debug-print-function $FUNCNAME $* >> You should be using "$@" not unquoted $*. > > Fixed. Also fixed base_src_unpack and base_src_compile calling their > grunt functions with $1, when clearly it should have been [EMAIL PROTECTED] > >> Seems like the FUNCNAME bit should just be rolled into the function >> with "${FUNCNAME[1]}" which could be done tree-wide quite easily. > > I guess that function was written before bash-3 when FUNCNAME was turned > into an array. > > > You should at least use emake instead of make in src_install. And i would suggest to use something like this instead of the make install line (maybe add some other default docs, if they are common): if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then emake DESTDIR="${D}" install || die "emake install failed" fi if [ -n "${DOCS}" ]; then dodoc ${DOCS} || die "dodoc failed" else for x in AUTHORS ChangeLog NEWS README; do if [ -e ${x} ]; then dodoc ${x} || die "dodoc ${x} failed" fi done fi -- Thomas Sachau Gentoo Linux Developer signature.asc Description: OpenPGP digital signature
Re: [gentoo-dev] Re: Proposed change to base.eclass: EAPI-2 support
On Monday 03 November 2008, Steve Long wrote: > Peter Alfredsen wrote: > > debug-print-function $FUNCNAME $* > > You should be using "$@" not unquoted $*. Fixed. Also fixed base_src_unpack and base_src_compile calling their grunt functions with $1, when clearly it should have been [EMAIL PROTECTED] > Seems like the FUNCNAME bit should just be rolled into the function > with "${FUNCNAME[1]}" which could be done tree-wide quite easily. I guess that function was written before bash-3 when FUNCNAME was turned into an array. -- /PA --- /usr/portage/eclass/base.eclass 2008-07-17 12:06:27.0 +0200 +++ base.eclass 2008-11-03 20:45:44.0 +0100 @@ -2,32 +2,78 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.34 2008/07/17 09:49:14 pva Exp $ # @ECLASS: base.eclass # @MAINTAINER: -# ??? +# Peter Alfredsen <[EMAIL PROTECTED]> # # Original author Dan Armak <[EMAIL PROTECTED]> # @BLURB: The base eclass defines some default functions and variables. # @DESCRIPTION: # The base eclass defines some default functions and variables. Nearly # everything else inherits from here. +# +# NOTE: You must define EAPI before inheriting from base, or the wrong functions +# may be exported. inherit eutils +case "${EAPI:-0}" in + 2) + EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_install + ;; + *) + EXPORT_FUNCTIONS src_unpack src_compile src_install + ;; +esac + DESCRIPTION="Based on the $ECLASS eclass" # @FUNCTION: base_src_unpack # @USAGE: [ unpack ] [ patch ] [ autopatch ] [ all ] # @DESCRIPTION: # The base src_unpack function, which is exported. If no argument is given, -# "all" is assumed. +# "all" is assumed if EAPI!=2, "unpack" if EAPI=2. base_src_unpack() { - debug-print-function $FUNCNAME $* - [ -z "$1" ] && base_src_unpack all + debug-print-function $FUNCNAME "$@" + + if [ -z "$1" ] + then + case "${EAPI:-0}" in + 2) +base_src_util unpack +;; + *) +base_src_util all +;; + esac + else + base_src_util $@ + fi +} + +# @FUNCTION: base_src_prepare +# @DESCRIPTION: +# The base src_prepare function, which is exported when EAPI=2. Performs +# "base_src_util autopatch". +base_src_prepare() { + + debug-print-function $FUNCNAME "$@" + + base_src_util autopatch +} + +# @FUNCTION: base_src_util +# @USAGE: [ unpack ] [ patch ] [ autopatch ] [ all ] +# @DESCRIPTION: +# The base_src_util function is the grunt function for base src_unpack +# and base src_prepare. +base_src_util() { + + debug-print-function $FUNCNAME "$@" cd "${WORKDIR}" while [ "$1" ]; do @@ -57,28 +103,62 @@ done fi ;; all) debug-print-section all - base_src_unpack unpack autopatch + base_src_util unpack autopatch ;; esac shift done } +# @FUNCTION: base_src_configure +# @DESCRIPTION: +# The base src_prepare function, which is exported when EAPI=2. Performs +# "base_src_work configure". +base_src_configure() { + + debug-print-function $FUNCNAME "$@" + + base_src_work configure +} + # @FUNCTION: base_src_compile # @USAGE: [ configure ] [ make ] [ all ] # @DESCRIPTION: # The base src_compile function, which is exported. If no argument is given, -# "all" is asasumed. +# "all" is assumed if EAPI!=2, "make" if EAPI=2. base_src_compile() { - debug-print-function $FUNCNAME $* - [ -z "$1" ] && base_src_compile all + debug-print-function $FUNCNAME "$@" + + if [ -z "$1" ] + then + case "${EAPI:-0}" in + 2) +base_src_work make +;; + *) +base_src_work all +;; + esac + else + base_src_work $@ + fi +} + +# @FUNCTION: base_src_work +# @USAGE: [ configure ] [ make ] [ all ] +# @DESCRIPTION: +# The base_src_work function is the grunt function for base src_configure +# and base src_compile. +base_src_work() { + + debug-print-function $FUNCNAME "$@" cd "${S}" while [ "$1" ]; do @@ -91,11 +171,11 @@ debug-print-section make emake || die "died running emake, $FUNCNAME:make" ;; all) debug-print-section all - base_src_compile configure make + base_src_work configure make ;; esac shift done @@ -107,11 +187,11 @@ # @DESCRIPTION: # The base src_install function, which is exported. If no argument is given, # "all" is assumed. base_src_install() { - debug-print-function $FUNCNAME $* + debug-print-function $FUNCNAME "$@" [ -z "$1" ] && base_src_install all cd "${S}" while [ "$1" ]; do @@ -129,7 +209,5 @@ shift done } - -EXPORT_FUNCTIONS src_unpack src_compile src_install signature.asc Description: This is a digitally signed message part.
[gentoo-dev] Re: Proposed change to base.eclass: EAPI-2 support
Peter Alfredsen wrote: > debug-print-function $FUNCNAME $* You should be using "$@" not unquoted $*. Seems like the FUNCNAME bit should just be rolled into the function with "${FUNCNAME[1]}" which could be done tree-wide quite easily.