~alpine/devel

2 2

[alpine-devel] change in the APKBUILD format

Details
Message ID
<1255963126.30583.77.camel@ncopa-desktop.nor.wtbts.net>
Sender timestamp
1255963126
DKIM signature
missing
Download raw message
Hi,

We just did a big discover when testing a new 8 core build box. We
noticed that fakeroot kills performance on multicore big time. Compiling
kernel with abuild (via fakeroot) took 1 hour +. Total CPU usage was on
15%. So I tested to run it without fakeroot. CPU usage went to 96% and
kernel compile time took 10-11 minutes.

So, basicly, we want avoid fakeroot during compile. Its not needed til
'make install' and packaging anyways. The drawback is that it means we
need to change every APKBUILD we have.

The problem is that abuild runs "rootpkg" in fakeroot, which will call
the build() function. We would need run build() without fakeroot, then
run "make install" in a separate function (like gentoo does).

So... I'm open to ideas. What do we do? This is also a good time to stop
up and think if we want to do the package splitting differently. Arch
linux have added support for package splitting too recently.

I can see 3 options:
1. we follow archlinux style:
http://www.archlinux.org/pacman/PKGBUILD.5.html (see the splitting part)

2. we follow gentoo style, and create src_prepare() (for applying
patches), src_configure() to run ./configure, src_compile() to run make
and src_install() to do the make install - as fakeroot.

3. we do our own, something.

I would like to avoid building up an entire API with lots of helper
funcs, like gentoo has. I want the APKBUILD's be simple to understand
whats going on. We already have some special things for -dev and -doc
packages that contradicts that, but at th same time, its nice to not
need rewrite everything in every APKBUILD. We also have our own pkgusers
and pkggroups additions that creates users in build environment needed
build time.

I'm leaning at the direction on doing someething similar what Arch Linux
does. That is, go for package_foo() functions.

Ideas? Opinions?

-nc



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Timo Teräs <timo.teras@iki.fi>
Details
Message ID
<4ADC7B56.7040507@iki.fi>
In-Reply-To
<1255963126.30583.77.camel@ncopa-desktop.nor.wtbts.net> (view parent)
Sender timestamp
1255963478
DKIM signature
missing
Download raw message
Natanael Copa wrote:
> 2. we follow gentoo style, and create src_prepare() (for applying
> patches), src_configure() to run ./configure, src_compile() to run make
> and src_install() to do the make install - as fakeroot.

I definitely want "unpack+patch sources" to be doable as separate
step. It helps when I need to get the exact sources used to
build a debuggable binary.

Not sure if configure/compile needs to be separated.

- Timo


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Details
Message ID
<1255968016.30583.99.camel@ncopa-desktop.nor.wtbts.net>
In-Reply-To
<4ADC7B56.7040507@iki.fi> (view parent)
Sender timestamp
1255968016
DKIM signature
missing
Download raw message
On Mon, 2009-10-19 at 17:44 +0300, Timo Teräs wrote:
> Natanael Copa wrote:
> > 2. we follow gentoo style, and create src_prepare() (for applying
> > patches), src_configure() to run ./configure, src_compile() to run make
> > and src_install() to do the make install - as fakeroot.
> 
> I definitely want "unpack+patch sources" to be doable as separate
> step. It helps when I need to get the exact sources used to
> build a debuggable binary.

It is possible do something like this already:

_prepare() {
	# do patching
}

_compile() {
	# do compiling
}

build() {
	_prepare && _compile
}

Then you can run:
abuild fetch unpack _prepare

and you have your patches sources	

We can still make prepare() as an official step.

> Not sure if configure/compile needs to be separated.


How about something like

prepare() {
	# patch sources here
}

build() {
	./configure
	make
}

package() {
	make install DESTDIR=$pkgdir
}


Then in abuild we do something like, if package is not a defined
function, we run build() in fakeroot as normal. Otherwise we run package
and subpackage split functions as fakeroot only. that way we keep
compability.

We end up with an API (3 functions) which needs to be learned to build
packages, but i suppose its not possible to completely avoid it.

-nc



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Reply to thread Export thread (mbox)