Gentoo Archives: gentoo-alt

From: Fabian Groffen <grobian@g.o>
To: gentoo-alt@l.g.o
Subject: Re: [gentoo-alt] [prefix] Different install and build path
Date: Thu, 08 Nov 2007 14:33:34
Message-Id: 20071108143305.GA1020@gentoo.org
In Reply to: Re: [gentoo-alt] [prefix] Different install and build path by Dirk Heinrichs
1 On 08-11-2007 14:18:54 +0200, Dirk Heinrichs wrote:
2 > Am Mittwoch, 7. November 2007 schrieb ext Fabian Groffen:
3 > > On 07-11-2007 17:28:04 +0200, Dirk Heinrichs wrote:
4 > > > Hi,
5 > > >
6 > > > I just found out about the prefixed portage project. Looks like it
7 > > > finally implements functionality I requested already two years ago.
8 > > > That's good news.
9 > >
10 > > My memory is bad, what in particular were/are you looking for?
11 >
12 > See background below.
13 >
14 > > > What I would like to know is the following: Would it be possible to
15 > > > build for one prefix, but install into another?
16 > >
17 > > I'm not sure if I get what exactly it is that you want, and I'm not
18 > > familiar with AFS (sorry Stefaan ;) ), but it looks a bit like
19 > > automounted stuff, and in particular the BSD automounter's scheme.
20 >
21 > No, it's far superior than that. It creates a global directory tree
22 > under /afs. The clients only mount /afs, the tree is assembled on the
23 > servers. Volumes are created on the servers and mounted into the tree
24 > somewhere, making them instantly visible on the clients. Volumes can be
25 > replicated (ro) for higher availability. However, if a ro replica of a
26 > volume exist, the client always prefers it over the rw replica, unless the
27 > path to the rw replica is used explicitely.
28 >
29 > And that's the problem I want to solve. Install software into a different
30 > path than it was compiled for, automatically. Plus, after installation of
31 > each package, release the volume (replicate the changes to all ro
32 > replicas).
33
34 In a way what you ask for is impossible, and can only be hacked around.
35
36 The actual problem you have, is that your afs setup basically prevents
37 you from "doing things right". The path of the ro replicas, which is
38 the path your clients use, should match your EPREFIX, for the simple
39 reason that things like library deps are looked for in EPREFIX.
40
41 Installing into another location basically means a sort of what portage
42 does before it merges the package, in $D the image dir. If you apply my
43 binpkg trick I wrote about before, you run into trouble as the EPREFIX
44 is actually changed, making the software useless for the ro replica
45 clients.
46
47 I looks like you can either hack with ROOT support a symlink pointing to
48 your rw location. This however, has some side effects, because ebuilds
49 in general consider certain tasks not to be performed when $ROOT != "/".
50 Additionally, this assumes that EPREFIX is set up in such a way that the
51 rw mount point can actually have a full EPREFIX in it. This is not the
52 case with the example you gave (a dot in the second dir from the root).
53
54 Since I don't feel like hacking afs release volume support in Portage --
55 it feels way to specific, and far beyond the task of the package
56 manager, I think it is much better to have a special build machine,
57 which some special setup, that basically does something like this:
58
59 (I have no clue if something like this was implemented:
60 http://osdir.com/ml/linux.gentoo.portage.devel/2004-12/msg00047.html
61 You might, however, be able to trigger some stuff via
62 etc/portage/bashrc)
63
64 a) modify the image before installing (this will upset portage a lot)
65 b) create a binpkg, extract it, copy to the path for the rw volume, run release script
66
67 Portage can also --buildpkgonly which means you can just emerge with
68 EPREFIX on the ro volume, but Portage never trying to install the
69 package, instead leaving the binpkg behind. I guess some clever
70 scripting around this with option b) in mind would be able to do most of
71 the stuff you want. I could even imagine when you set PKGDIR to a rw
72 volume and have one server periodically look for new files installed
73 there, that you can "autodeploy" anything emerged by any client this
74 way. There would only be a little delay between the actuall merge
75 completion and the deployment of the package.
76
77 Does this help?
78
79
80 --
81 Fabian Groffen
82 Gentoo on a different level
83 --
84 gentoo-alt@g.o mailing list

Replies

Subject Author
Re: [gentoo-alt] [prefix] Different install and build path Dirk Heinrichs <dirk.heinrichs.ext@×××.com>