* Re: [gentoo-dev] [PATCHES] Sub-phase functions in autotools-utils & autotools-multilib
@ 2013-09-23 20:59 Greg Turner
2013-09-23 21:16 ` Michał Górny
0 siblings, 1 reply; 8+ messages in thread
From: Greg Turner @ 2013-09-23 20:59 UTC (permalink / raw
To: gentoo-dev; +Cc: reavertm, multilib, Michał Górny
On Thu, May 2, 2013 at 5:26 AM, Michał Górny <mgorny@gentoo.org> wrote:
> Hi,
>
> I've thought for a bit and got the conclusion that the best solution
> for quite an irritating syntax of autotools-multilib is to use
> sub-phase functions.
Sorry for the delayed response, but having been playing with this
stuff lately, and I'd like to state for the record that I
whole-heartedly endorse this product and/or service.
> autotools_configure()
> autotools_install()
> autotools_install_all()
I like that you manage to avoid syntax like:
autotools_multilib_${phase}_${applicability-specifier}_${etc}...
:)
The name of the game is to get from where we are now, to where we want
to be (presumably, a future in which we can rm -rf
${PORTDIR}/app-emulation/emul-linux-x86-*), with a minimum of
repetitive and/or difficult retrofit labor.
Ideally, to multilib-retrofit an ebuild, the ebuild-repair-person
would just chop up the code a bit, and indicate to the framework which
snippets pertain to which ABI's or are ABI-independent.
We're nowhere near that now. As you suggest, the problem is that
there's no way to "hook" any per-ABI script code into the
autotools-multilib phase functions without copy pasting the whole
boilerplate, which shrinks the value-proposition of autotools-multilib
(vs. direct inheritance to multilib-build) down to almost nothing.
All but the most simple pre-USE_EXPAND-abi-ebuilds have snippets of
script code that want to run on a per-ABI basis, often inconveniently
interspersed between src_prepare() and src_configure(), and there is
no low-effort way to wedge that code into the autotools-multilib
framework as implemented.
Often, there is some clever substitution that can be made to bridge
this feature-gap -- but by now the ebuild-repair-person is well into
"investigating/thinking deeply/drawing-board" mode, precisely where he
doesn't want to find himself if he's trying to quickly blow through a
deeply-entangled batch of 50 or 100 ebuilds requiring simultaneous
retrofitting.
> While this seems rather cosmetic...
It's not just a cosmetic problem. ... but, a brief diversion about
aesthetics: I think, in ebuild-writing, there's a fine line between
cosmetically fucked and just plain fucked. Likewise, the converse
also holds: an aesthetically blessed ebuild is probably blessed for
developers, bugzilla worker-bees, and end-users (gentoo sysadmins)
alike.
So, in short, cosmetic improvements are good and intrinsically
important. Furthermore, the term "cosmetic" has connotations of
"ineffectual": that is not the case here, there are real practical
problems being solved -- your proposal ENABLES the
ebuild-repair-person to shuffle around code in a seemingly trivial
manner, but that's NOT an option with the current implementation,
instead the ebuild-repair-person must struggle against the limitations
of the framework (in addition to figuring out whatever true semantic
change is required by the retrofit).
Anyhow, meanwhile, back on planet Earth...
> The sub-phases without '_all' suffix are run inside BUILD_DIR, and
> repeated for each multilib ABI. The sub-phases with '_all' are always
> run only once, and inside S.
It's clearly a move in the right direction. New choke points would
probably reveal themselves once we were freed from the tyranny of
constantly typing in the same code over and over :)
I do think "all" vs. "" is dsylexia-inducing and should be changed... perhaps:
at_${phase}_abi: per-abi steps (i.e., probably in per-abi ${BUILD_DIR})
at_${phase}: global steps (i.e., in ${S})
s/at/autotools/ obv.... or just leave it! short==good here.
Anyhow, those really are trivial semantic matters.
I also think your proposal could go a bit further in the ability to
slice-and-dice the sub-phase functions. For example, there might be
uses for granularity like:
at_${phase}: as before
at_${phase}_all: as before
at_${phase}_${ABI}: single-abi-specific stuff executed before
at_${phase}, i.e., platform-specific configure tweaks
at_${phase}_best: stuff that needs to happen in ${BUILD_DIR}, but
should only happen for DEFAULT_ABI, i.e.:, compile documentation from
source, full emake installs to deploy unwrapped header files and
/usr/share/doc stuff, etc.
Cross-compile support might suggest a couple of additional sub-phases
(i.e.: a sub-phase to generate ${CBUILD}-targeted intermediate tools
(perhaps only during cross-compiles, but I really wish somehow that
could be coded just once, tagged, and the framework could decide
whether to do anything unusual with it based on context.
> What are your thoughts? The patch is sent in reply to this mail.
Just saw your message that you are abandoning this proposal due to
lack of interest. I think the lack of comments is not particularly
surprising. How many people are actively getting their hands dirty
attempting to mass-retrofit ebuilds for USE_EXPAND abi-based multilib?
I'd wager you're the only one, unless you want to count me over the
last 24 hours or so but I'm just dabbling and will probably lose
interest.
In other words, probably you are the only person in a position to see
what the requirements are. If you are concerned about building stuff
with no "eyeballs" / feedback, then put them in new eclasses instead
of fixing the old ones (it's 'prolly better for back-compatibility to
do so anyhow). But I'm 100% convinced you're on the right track
because I was about to start building what you described myself (and
I'm /never/ wrong! hahaha, ok, far from it, but as they say, "even if
I do say so myself...")
-gmt
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-dev] [PATCHES] Sub-phase functions in autotools-utils & autotools-multilib
2013-09-23 20:59 [gentoo-dev] [PATCHES] Sub-phase functions in autotools-utils & autotools-multilib Greg Turner
@ 2013-09-23 21:16 ` Michał Górny
2013-09-23 21:27 ` Greg Turner
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Michał Górny @ 2013-09-23 21:16 UTC (permalink / raw
To: gentoo-dev; +Cc: gmt, reavertm, multilib
[-- Attachment #1: Type: text/plain, Size: 1221 bytes --]
Dnia 2013-09-23, o godz. 13:59:48
Greg Turner <gmt@malth.us> napisał(a):
> > What are your thoughts? The patch is sent in reply to this mail.
>
> Just saw your message that you are abandoning this proposal due to
> lack of interest. I think the lack of comments is not particularly
> surprising. How many people are actively getting their hands dirty
> attempting to mass-retrofit ebuilds for USE_EXPAND abi-based multilib?
> I'd wager you're the only one, unless you want to count me over the
> last 24 hours or so but I'm just dabbling and will probably lose
> interest.
We have four active Gentoo developers in the team and one very helpful
user. Plus a number of developers who are working in their narrow areas
and supporting us indirectly. That's more than I expected,
and the project has bright future. There are a few people who just like
to trip us up but I think it'll all end up well in the end.
As for this particular idea, I plan to make autotools-multilib use
multilib-minimal and therefore inherit its phase functions. However,
I'm still waiting for bug #485046 [1] to be resolved.
[1]:https://bugs.gentoo.org/show_bug.cgi?id=485046
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-dev] [PATCHES] Sub-phase functions in autotools-utils & autotools-multilib
2013-09-23 21:16 ` Michał Górny
@ 2013-09-23 21:27 ` Greg Turner
2013-09-23 21:28 ` Greg Turner
2013-09-24 8:40 ` Greg Turner
2 siblings, 0 replies; 8+ messages in thread
From: Greg Turner @ 2013-09-23 21:27 UTC (permalink / raw
To: Michał Górny; +Cc: gentoo-dev, multilib, reavertm
On Mon, Sep 23, 2013 at 2:16 PM, Michał Górny <mgorny@gentoo.org> wrote:
> [1]:https://bugs.gentoo.org/show_bug.cgi?id=485046
Hey, that looks familiar... same basic problem exists in bzip2[static]
src_compile:
https://bugs.gentoo.org/show_bug.cgi?id=485690
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-dev] [PATCHES] Sub-phase functions in autotools-utils & autotools-multilib
2013-09-23 21:16 ` Michał Górny
2013-09-23 21:27 ` Greg Turner
@ 2013-09-23 21:28 ` Greg Turner
2013-09-24 8:40 ` Greg Turner
2 siblings, 0 replies; 8+ messages in thread
From: Greg Turner @ 2013-09-23 21:28 UTC (permalink / raw
To: Michał Górny; +Cc: gentoo-dev, multilib, reavertm
On Mon, Sep 23, 2013 at 2:16 PM, Michał Górny <mgorny@gentoo.org> wrote:
> [1]:https://bugs.gentoo.org/show_bug.cgi?id=485046
Hey, that looks familiar... same basic problem exists in bzip2[static]
src_compile:
https://bugs.gentoo.org/show_bug.cgi?id=485690
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-dev] [PATCHES] Sub-phase functions in autotools-utils & autotools-multilib
2013-09-23 21:16 ` Michał Górny
2013-09-23 21:27 ` Greg Turner
2013-09-23 21:28 ` Greg Turner
@ 2013-09-24 8:40 ` Greg Turner
2013-09-24 11:29 ` Michał Górny
2 siblings, 1 reply; 8+ messages in thread
From: Greg Turner @ 2013-09-24 8:40 UTC (permalink / raw
To: Michał Górny; +Cc: gentoo-dev, Greg Turner, reavertm, multilib
On Mon, Sep 23, 2013 at 2:16 PM, Michał Górny <mgorny@gentoo.org> wrote:
>
> We have four active Gentoo developers in the team and one very helpful
> user. Plus a number of developers who are working in their narrow areas
> and supporting us indirectly. That's more than I expected,
> and the project has bright future. There are a few people who just like
> to trip us up but I think it'll all end up well in the end.
Is there a work-in-progress code repository somewhere? Mailing list?
If I'm going to keep hacking on this I should definitely sync up with
you guys, I have a growing number of offline patches (some of which
might be good enough to go in as-is, some needing some work, and a few
abominations).
-gmt
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-dev] [PATCHES] Sub-phase functions in autotools-utils & autotools-multilib
2013-09-24 8:40 ` Greg Turner
@ 2013-09-24 11:29 ` Michał Górny
0 siblings, 0 replies; 8+ messages in thread
From: Michał Górny @ 2013-09-24 11:29 UTC (permalink / raw
To: gentoo-dev; +Cc: gmt, reavertm, multilib
[-- Attachment #1: Type: text/plain, Size: 1116 bytes --]
Dnia 2013-09-24, o godz. 01:40:58
Greg Turner <gmt@malth.us> napisał(a):
> On Mon, Sep 23, 2013 at 2:16 PM, Michał Górny <mgorny@gentoo.org> wrote:
> >
> > We have four active Gentoo developers in the team and one very helpful
> > user. Plus a number of developers who are working in their narrow areas
> > and supporting us indirectly. That's more than I expected,
> > and the project has bright future. There are a few people who just like
> > to trip us up but I think it'll all end up well in the end.
>
> Is there a work-in-progress code repository somewhere? Mailing list?
> If I'm going to keep hacking on this I should definitely sync up with
> you guys, I have a growing number of offline patches (some of which
> might be good enough to go in as-is, some needing some work, and a few
> abominations).
Not really, most of the code goes into gx86 directly. Some of it gets
masked first (like the late OpenGL batch). We can be reached through
multilib@gentoo.org. If you prefer IRC, you're looking for mgorny,
pacho2, aballier, _AxS_, iamnr3.
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* [gentoo-dev] [PATCHES] Sub-phase functions in autotools-utils & autotools-multilib
@ 2013-05-02 12:26 Michał Górny
2013-05-04 7:28 ` Michał Górny
0 siblings, 1 reply; 8+ messages in thread
From: Michał Górny @ 2013-05-02 12:26 UTC (permalink / raw
To: Gentoo Developer Mailing List; +Cc: reavertm, multilib
[-- Attachment #1: Type: text/plain, Size: 2045 bytes --]
Hi,
I've thought for a bit and got the conclusion that the best solution
for quite an irritating syntax of autotools-multilib is to use
sub-phase functions. To increase consistency between ebuilds, the same
phases can be used in autotools-utils directly.
The idea is that current ebuild looking like:
src_prepare() {
sed ...
autotools-utils_src_prepare
}
src_configure() {
local myeconfargs=(
--with-foo
--with-bar
)
autotools-utils_src_configure
}
src_install() {
use doc && local HTML_DOCS=...
autotools-utils_src_install
doinitd ...
dobin "${BUILD_DIR}"/something/something
}
could be written as:
autotools_configure() {
local myeconfargs=(
--with-foo
--with-bar
)
edefault
}
autotools_install() {
edefault
dobin something/something
}
autotools_install_all() {
use doc && local HTML_DOCS=...
edefault
doinitd ...
}
While this seems rather cosmetic, it becomes incredibly helpful when it
comes to multilib or working inside BUILD_DIR.
The sub-phases without '_all' suffix are run inside BUILD_DIR, and
repeated for each multilib ABI. The sub-phases with '_all' are always
run only once, and inside S.
This provides a meaningful split between the two parts
of autotools-utils_src_install (and default_src_install too), and makes
it possible to hack stuff in multilib without having to rewrite
the 'multilib_foreach_impl' lines all the time.
For example:
src_configure() {
my_configure() {
local myeconfargs=(
... # something ABI-conditional here
)
autotools-utils_src_configure
}
multilib_parallel_foreach_abi my_configure
}
can be replaced with much simpler:
autotools_configure() {
local myeconfargs=(
... # something ABI-conditional here
)
edefault
}
What are your thoughts? The patch is sent in reply to this mail.
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [gentoo-dev] [PATCHES] Sub-phase functions in autotools-utils & autotools-multilib
2013-05-02 12:26 Michał Górny
@ 2013-05-04 7:28 ` Michał Górny
0 siblings, 0 replies; 8+ messages in thread
From: Michał Górny @ 2013-05-04 7:28 UTC (permalink / raw
To: gentoo-dev; +Cc: reavertm, multilib
[-- Attachment #1: Type: text/plain, Size: 3148 bytes --]
On Thu, 2 May 2013 14:26:11 +0200
Michał Górny <mgorny@gentoo.org> wrote:
> I've thought for a bit and got the conclusion that the best solution
> for quite an irritating syntax of autotools-multilib is to use
> sub-phase functions. To increase consistency between ebuilds, the same
> phases can be used in autotools-utils directly.
For example, the alsa-lib ebuild could be changed like the following:
Index: alsa-lib-1.0.27-r3.ebuild
===================================================================
RCS file: /var/cvsroot/gentoo-x86/media-libs/alsa-lib/alsa-lib-1.0.27-r3.ebuild,v
retrieving revision 1.1
diff -u -B -r1.1 alsa-lib-1.0.27-r3.ebuild
--- alsa-lib-1.0.27-r3.ebuild 3 May 2013 14:38:28 -0000 1.1
+++ alsa-lib-1.0.27-r3.ebuild 4 May 2013 07:26:08 -0000
@@ -4,9 +4,11 @@
EAPI=5
+AUTOTOOLS_AUTORECONF=1
+AUTOTOOLS_PRUNE_LIBTOOL_FILES=all
PYTHON_COMPAT=( python2_7 )
-inherit autotools eutils multilib multilib-minimal python-single-r1
+inherit autotools-multilib multilib python-single-r1
DESCRIPTION="Advanced Linux Sound Architecture Library"
HOMEPAGE="http://www.alsa-project.org/"
@@ -27,47 +29,47 @@
use python && python-single-r1_pkg_setup
}
-src_prepare() {
+autotools_prepare_all() {
# dlclose, pcm, kernel, inline, inline-2 are all from upstream
- epatch \
+ local PATCHES=(
"${FILESDIR}"/1.0.25-extraneous-cflags.diff \
"${FILESDIR}"/${P}-{dlclose,pcm,kernel}.patch \
"${FILESDIR}"/${P}-inline{,-2}.patch
+ )
sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.in || die #466980
- epatch_user
-
- eautoreconf
# if eautoreconf'd with recent autoconf, then epunt_cxx is
# unncessary wrt #460974
# epunt_cxx
+
+ edefault
}
-multilib_src_configure() {
- local myconf
+autotools_configure() {
+ local myeconfargs=(
+ --enable-shared
+ --disable-resmgr
+ --enable-rawmidi
+ --enable-seq
+ --enable-aload
+ $(use_with debug)
+ $(use_enable alisp)
+ )
+
# enable Python only on final ABI
if [[ ${ABI} == ${DEFAULT_ABI} ]]; then
- myconf="$(use_enable python)"
+ myeconfargs+=( $(use_enable python) )
else
- myconf="--disable-python"
+ myeconfargs+=( --disable-python )
fi
- use elibc_uclibc && myconf+=" --without-versioned"
+ use elibc_uclibc && myeconfargs+=( --without-versioned )
- ECONF_SOURCE=${S} \
- econf \
- --enable-shared \
- --disable-resmgr \
- --enable-rawmidi \
- --enable-seq \
- --enable-aload \
- $(use_with debug) \
- $(use_enable alisp) \
- ${myconf}
+ edefault
}
-multilib_src_compile() {
- emake
+autotools_compile() {
+ edefault
if [[ ${ABI} == ${DEFAULT_ABI} ]] && use doc; then
emake doc
@@ -76,15 +78,9 @@
fi
}
-multilib_src_install() {
- emake DESTDIR="${D}" install
+autotools_install() {
+ edefault
if [[ ${ABI} == ${DEFAULT_ABI} ]] && use doc; then
dohtml -r doc/doxygen/html/.
fi
}
-
-multilib_src_install_all() {
- prune_libtool_files --all
- find "${ED}"/usr/$(get_libdir)/alsa-lib -name '*.a' -exec rm -f {} +
- dodoc ChangeLog TODO
-}
--
Best regards,
Michał Górny
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2013-09-24 11:28 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-23 20:59 [gentoo-dev] [PATCHES] Sub-phase functions in autotools-utils & autotools-multilib Greg Turner
2013-09-23 21:16 ` Michał Górny
2013-09-23 21:27 ` Greg Turner
2013-09-23 21:28 ` Greg Turner
2013-09-24 8:40 ` Greg Turner
2013-09-24 11:29 ` Michał Górny
-- strict thread matches above, loose matches on Subject: below --
2013-05-02 12:26 Michał Górny
2013-05-04 7:28 ` Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox