Gentoo Archives: gentoo-dev

From: Garry Roseman <memphis_tech_support@×××.com>
To: Gentoo-Dev <gentoo-dev@g.o>
Subject: [gentoo-dev] Stow it in the warehouse
Date: Fri, 05 Jul 2002 17:23:53
Message-Id: 1025907823.5550.61.camel@silver.perimeter
1 On Fri, 2002-07-05 at 11:33, Wout Mertens wrote:
2 > Hey there,
3 >
4 > I agree, stow is cool and at work we use it to maintain our 12GB
5 > /usr/local tree that is exported over nfs to our workstations.
6 > Some drawbacks, however:
7 >
8 > - You have a slight speed loss because of the symlinking adding
9 > extra lookups. Luckily, Linux has very good caching :)
10 > - Some packages hate it when you symlink stuff; e.g. sudo needs its
11 > sudoers file to be a regular file. Granted, this is a configuration
12 file
13 > and as such may not need to be symlinked in a general gentoo
14 context, so
15 > this could be solved by just creating a regular file in the
16 > pkg_postinst.
17 > - stow -R can grind your server to a screeching halt if you have many
18 > files. I'm sure this is solveable by rewriting the code a little,
19 and I
20 > don't know if recent versions have trouble with it since we don't
21 try it
22 > anymore ;)
23 > - You have a lot of symlinks in your /usr, which makes ls -l a bit
24 less
25 > attractive to look at. Of course, there's still ls -lL ;-)
26 >
27 > I've been considering nagging to drobbins about changing Portage so
28 that
29 > merging actually means
30 > [build the image somewhere where it will remain and install by
31 symlinking]
32
33 That would be a nice option. Portage developers already do all of the
34 hard work that we stowers often face in assuring that a package will
35 install into a tree outside of its target location. For example, it
36 would be nice if I could emerge a package to a "warehouse" such as
37 /usr/local/stow and just build the package in <warehouse>/<package>
38 (instead of /var/tmp/portage/<section>/<package>/image). Symlinking
39 should be left for a separate manual step.
40
41 One advantage of emerging into a warehouse is that it becomes possible
42 to define software build environments that are different for different
43 users or for different projects. This is done with Stow by stowing to a
44 special target directory, often a home directory. For example, a user
45 who wants to do development with GCC-3.1 could
46 cd <warehouse>; stow -t ~/ gcc-3.1 etc.
47 and assuming that his PATH includes ~/bin and the loader is configured
48 to search his $HOME/lib for libraries, etc., then that user can proceed
49 to use gcc 3.1 without interfering with the gcc that is used for normal
50 software installation on the system. I have seen some discussion of
51 using stow for creating and archiving entire project-specific build
52 environments, but I haven't tried it yet. It seems like a good match
53 for portage.
54
55 > This would have the advantage that you can always revert to a certain
56 > version of a package with certainty, since no files are removed from
57 the
58 > previous package. And you see where a file comes from really quickly
59 by
60 > looking at the symlink, which is very useful.
61
62 It becomes possible, maybe even easy (so far I find it easy on my 700 MB
63 /usr/local), to revert to the previous release or to jump back and forth
64 between package versions. As I suggested above, it also may become
65 possible to define, track, and archive the entire build environment for
66 software development projects. That is essential for me --- it must be
67 possible to recreate the environment that produced software that I have
68 running in field installations, potentially a different version for each
69 installation.
70
71 >
72 > And actually, I think it would be possible to let portage optionally
73 have
74 > that feature, because the only thing it changes is where the files are
75 > installed and what merge and unmerge do. All the rest would stay the
76 > same. That way, people who want it can turn it on and the rest aren't
77 > bothered.
78 >
79 > Thoughts?
80
81 I think there's potential for using portage to build into a warehouse
82 and use stow to withdraw custom environments from the warehouse. But we
83 need experience doing it --- does anyone know how to force emerge to
84 install into a warehouse as I have described it?
85
86 It appears to me that all we can do right now with portage is to define
87 BUILD_PREFIX to point to the warehouse and portage would put the image
88 into a <package> subfolder but it would create an "image" sub-subfolder
89 -- that's not what we want. The "image" subfolder is superfluous. We
90 would also want emerge to track this package version separately from
91 those installed into /. If an update is released for a warehoused
92 package then let emerge -u world just install the updated version
93 alongside it in the warehouse and let me know that it is available.
94 Updating a warehoused package would not automatically put the new
95 version on the path for execution.
96
97 Right now using portage to install packages into the local warehouse
98 requires use of "ebuild <package>.ebuild install" followed by "mv
99 <image>/* <warehouse>/<package>" and there is no automatic updating of
100 packages warehoused that way.
101
102 Given a black-and-white choice between an elaborated system of
103 dependency tracking and file tracking via a database, and a simple
104 warehouse of available versions that can be quickly symlinked into an
105 environment (and allowing user and project-specific environments) ---
106 but with no "query" tool other than "ls" --- I'd take the warehouse and
107 dump the database!
108
109 But maybe it's not a black and white choice?
110
111 --
112 Fuper, Memphis, LPIC-1