Subject: [alpine-devel] change in the APKBUILD format

From: Natanael Copa <[email-masked]>
Date: Mon, 19 Oct 2009 16:38:46 +0200

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:  [email-masked]
Help:         [email-masked]
---

---

From: Timo Teräs <[email-masked]>
Date: Mon, 19 Oct 2009 17:44:38 +0300

> 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

---

---

From: Natanael Copa <[email-masked]>
Date: Mon, 19 Oct 2009 18:00:16 +0200

> 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

---