1 |
On 2/23/08, Alec Warner <antarus@g.o> wrote: |
2 |
> On 2/20/08, Felipe Contreras <felipe.contreras@×××××.com> wrote: |
3 |
> > Hi gentooists, |
4 |
> > |
5 |
> > I've been reading news sites about some changes happening in Gentoo |
6 |
> > and I thought it might be a good time to submit some ideas I've been |
7 |
> > baking for several years. |
8 |
> > |
9 |
> > I come from a Linux From Scratch background, I like the feeling of |
10 |
> > knowing every single corner of my system and the fact that there isn't |
11 |
> > anything that I don't want or need. However, typing every single |
12 |
> > command by hand is far from ideal, so at first I started writing some |
13 |
> > scripts and eventually I wrote a build system that suited my needs. I |
14 |
> > did it in bash for several reasons. |
15 |
> > |
16 |
> > After a while I realized bash wasn't exactly the best language to |
17 |
> > write such thing. Mainly because: |
18 |
> > |
19 |
> > a) The code ends up with a lot of stuff for handling strings properly |
20 |
> > (like escaping sequences) |
21 |
> |
22 |
> |
23 |
> Yes this is annoying |
24 |
> |
25 |
> |
26 |
> > b) Error are difficult to handle since bash doesn't have exceptions |
27 |
> |
28 |
> |
29 |
> I disagree here: most errors are fatal anyway any non fatal errors can |
30 |
> be printed and saved via the elog facility. |
31 |
> |
32 |
> |
33 |
> > c) Persistent information is difficult to achieve (no database stuff) |
34 |
> |
35 |
> |
36 |
> How is this a bash limitation? Most languages don't have 'database |
37 |
> stuff' built in. |
38 |
> I don't see how saving stuff to files is much different than the env |
39 |
> dumping we do in bash? |
40 |
|
41 |
Er, I meant saving stuff to databases ;) |
42 |
|
43 |
> |
44 |
> |
45 |
> > d) Package information is difficult to fetch/store (no objects/struct) |
46 |
> |
47 |
> |
48 |
> Yes. |
49 |
> |
50 |
> |
51 |
> > |
52 |
> > A more featured language could allow for example: filtered output, |
53 |
> > exception handling->state storage->resuming. |
54 |
> > |
55 |
> > But the big deal is with the package definition, recently I learned |
56 |
> > about Domain Specific Languages, and I think that is the best option. |
57 |
> > |
58 |
> > A new dsl allows many interesting features in the package definition |
59 |
> > itself like: inheritance, exceptions, arrays, hash tables, objects, |
60 |
> > modules, documentation, information messages, etc. |
61 |
> |
62 |
> |
63 |
> Note that most languages allow for the same things...so why would we |
64 |
> author our own language? What runtime would it use? |
65 |
> |
66 |
> |
67 |
> > |
68 |
> > Take this example: |
69 |
> > |
70 |
> > package Binutils < Gnu |
71 |
> > definition |
72 |
> > @version = "2.17" |
73 |
> > @name = "binutils" |
74 |
> > super() # run the Gnu definition stuff |
75 |
> > |
76 |
> > @config_opts = "--disable-nls --with-sysroot=\"#{$sys_root}\" |
77 |
> > --enable-shared --disable-multilib" |
78 |
> > end |
79 |
> > |
80 |
> > steps |
81 |
> > build |
82 |
> > cd #{$top_build_dir} |
83 |
> > mkdir -p #{@build_dir} |
84 |
> > cd #{@build_dir} |
85 |
> > :configure "script" => "../#{@dir}/configure", "opts" => @config_opts |
86 |
> > make configure-host |
87 |
> > make |
88 |
> > end |
89 |
> > |
90 |
> > install |
91 |
> > cd #{$top_build_dir} |
92 |
> > cd #{@build_dir} |
93 |
> > make install |
94 |
> > end |
95 |
> > end |
96 |
> > end |
97 |
> > |
98 |
> > This is based on an already working prototype made in Ruby, so it's |
99 |
> > biased towards Ruby facilities. |
100 |
> |
101 |
> |
102 |
> It looks Rakish ;) |
103 |
> |
104 |
> |
105 |
> > |
106 |
> > I've tried different build systems: rpm, dpkg, autopackage. |
107 |
> > Unfortunately I never tried ebuild because it was based on bash as far |
108 |
> > as I could tell. |
109 |
> |
110 |
> |
111 |
> Typically a 'build system' would refer to 'autotools' or 'ant' or |
112 |
> 'setuptools' not an ebuild. |
113 |
> |
114 |
> |
115 |
> > |
116 |
> > After almost a decade of using Linux I still haven't found a build |
117 |
> > system that suits all my needs. AFAIK ebuild is the most advanced but |
118 |
> > it's still relying on ancient technology (bash scripts) so there will |
119 |
> > always be limitations despite the brilliant ideas. |
120 |
> |
121 |
> |
122 |
> Bash is not 'ancient' and it works suprisingly well for the vast |
123 |
> majority of cases. I realize using a high level language would |
124 |
> probably make some tasks easier (mmm dicts and real arrays). There is |
125 |
> the matter of porting over 10000 ebuilds however ;) |
126 |
> |
127 |
> |
128 |
> > |
129 |
> > The core of a distribution is the "packaging" system, and the core of |
130 |
> > the packaging system is the building system, which has no reason not |
131 |
> > to be distribution agnostic, and actually, packaging system agnostic. |
132 |
> > |
133 |
> > Why not create a new build system with a state of the art programming |
134 |
> > language, and an advanced DSL that actually other distributions could |
135 |
> > use? |
136 |
> |
137 |
> |
138 |
> I would talk to Drobbins, he was talking about something like this to |
139 |
> manage complexity. |
140 |
> |
141 |
> |
142 |
> > |
143 |
> > I would like to hear your opinions on this matter. |
144 |
> > |
145 |
> > -- |
146 |
> > Felipe Contreras |
147 |
> > |
148 |
> > -- |
149 |
> > gentoo-dev@l.g.o mailing list |
150 |
> > |
151 |
> > |
152 |
> |
153 |
-- |
154 |
gentoo-dev@l.g.o mailing list |