Gentoo Archives: gentoo-dev

From: "Robin H. Johnson" <robbat2@g.o>
To: Gentoo Developers <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] what to do when an ebuild needs loads of RAM?
Date: Fri, 19 Nov 2004 09:28:48
Message-Id: 20041119092821.GA1896@curie-int.orbis-terrarum.net
In Reply to: Re: [gentoo-dev] what to do when an ebuild needs loads of RAM? by Marius Mauch
1 On Fri, Nov 19, 2004 at 09:18:36AM +0100, Marius Mauch wrote:
2 > On Thu, 18 Nov 2004 16:27:07 -0800
3 > "Robin H. Johnson" <robbat2@g.o> wrote:
4 >
5 > > As the requirements for a package can vary based on a number of things
6 > > or be reasonably fixed, I see a solution like this:
7 > > An ebuild defines two variables:
8 > > NEEDED_COMPILE_DISK
9 > > NEEDED_COMPILE_RAM
10 > > NEEDED_FINAL_DISK
11 > > NEEDED_FINAL_RAM
12 > >
13 > > which should evaluate to a constant numeric value in Kb of the
14 > > absolute maximum.
15 > *If* we do that please lets use Mb as a few Kb won't make a difference
16 > anyway. That said I don't think this is really an option in general as
17 > we'd have to consider too many variables, CFLAGS and USE being the major
18 > ones, to a lesser degree toolchain versions and ARCH. What combination
19 > should be used to determine the "absolute maximum"?
20 We don't need a super accurate number, just a ballpark figure. This
21 could generally be improvised or just measured. The diskspace
22 measurements would be the easiest - just sample the size of the active
23 tree at various times.
24
25 I'd generally expect this should be used only for ebuilds with abnormal
26 requirements: >1Gb of disk, or >256Mb of RAM (subject to change).
27
28 > Also I don't see any specifics how these variables should be used, would
29 > that be up to the ebuild, an eclass or portage? Too many open questions
30 > to seriously consider this yet.
31 I'd throw all the requirement checking stuff into an eclass, but I do
32 see one thing that would be suitable for portage to have (and it's more
33 broadly useful):
34 Ability to do an arbitary calculation at depend/pretend time so that it
35 can stop the entire emerge process before any packages are
36 unpacked/compiled/installed.
37
38 Eg portage can calc the deptree, and then before printing it out, it
39 evaluates the testing function for every ebuild in the deptree that has
40 the function. I already see ebuilds that have something similar in
41 pkg_setup(), but that runs too late - it should check things before any
42 installs start.
43
44 If portage cached which ebuilds had the testing function this makes the
45 evaluation of it O(n) with a very small n.
46
47 As one place that would definetly use this as well, see PHP packages for
48 combinations of USE flags that are competely incompatible and automatic
49 logic to exclude one of the USE flags is not appropriate (currently we
50 just call die).
51
52 --
53 Robin Hugh Johnson
54 E-Mail : robbat2@××××××××××××××.net
55 Home Page : http://www.orbis-terrarum.net/?l=people.robbat2
56 ICQ# : 30269588 or 41961639
57 GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85

Replies

Subject Author
Re: [gentoo-dev] what to do when an ebuild needs loads of RAM? Paul de Vrieze <pauldv@g.o>