Gentoo Archives: gentoo-dev

From: George Shapovalov <george@g.o>
To: gentoo-dev <gentoo-dev@l.g.o>
Subject: [gentoo-dev] gnatbuild.eclass refactoring: new/transitory eclass?
Date: Thu, 03 Sep 2015 14:00:29
Message-Id: 1964623.1PWUb7kWtd@phycelpc12.univ-lille1.fr
1 I am about to start a long-overdue refactoring of the gnat (Ada compilers)
2 build system, governed by the gnatbuild.eclass. Given that nature of the
3 packages concerned and, for quite some time, I was the only person brave
4 enough to even touch this beast this probably does not concern too many
5 people. However, since I am likely to produce some observable effects, such as
6 introduction of a (possibly transitory) new eclass, I am giving a requisite
7 heads-up here.
8
9 First a short but necessary introduction:
10 gnatbuild.eclass is a complex and ancient beast controlling the build of the
11 two Ada compilers we have in the tree - gnat-gcc (by FSF) and gnat-gpl (by
12 AdaCore). It has been created some 10 years ago, following the toolchain.eclas
13 of then, long before even functions like src_prepare were envisioned and the
14 term pms existed only in medical terminology. Correspondingly, it is composed
15 of big blocks of code, not very modular and can benefit greatly of new
16 practices.
17
18 The catch is that all the gnat-xxx ebuilds depend on it and replacing the
19 eclass would require modifying all of the ebuilds at the same time. Given the
20 typical adjustmentsto address gcc backend gets bumps and the differences
21 between two implementations, doing a big, all-in-one change like that is a
22 perfect recipe for disaster that would likely lead to total breakage of gnat
23 build system and the project that is never complete at the same time.
24 Therefore I am thinking to do it in a more usual and gradual manner:
25
26 1. introduce a new eclass, say gnatbuild2.eclass, which will be new,
27 refactored and much cleaned-up version of an existing gnatbuild.eclass
28
29 2. Update ebuilds independently to use the new eclass.
30
31 3. Stabilize new ebuilds and gradually phase out old ones.
32
33 4. When old eclass is no longer necessary, remove it.
34
35 5. (optional) Rename new eclass to use old name and update all inherits in
36 ebuilds correspondingly..
37
38
39 So, this is it for the heads-up.
40 Now, here come two questions:
41
42 1. Is there some kind of convention for such situations: should I go on with
43 the optional step 5 when all is done or is the preference to keep old eclass
44 forever? I can see the rationale for keeping it forever in some cases (say
45 for some very conservative core libs), but here this should not be necessary,
46 this is just an internal detail of build system for these compilers..
47
48 2. Is there some standard naming scheme? Should the new eclass be called, say,
49 gnatbuild2.eclass or gnatbuild-ng.eclass? Of course this only matters if old
50 eclass is there to stay. If not I'll just call the transitory eclass something
51 like gnatbuild-refactor.eclass for the duration of its existence..

Replies