summaryrefslogtreecommitdiff
blob: 281960b459b0bd831978f3d3eebae9b30bb41b03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
GLEP: 22
Title: New "keyword" system to incorporate various userlands/kernels/archs
Version: $Revision$
Last-Modified: $Date$
Author: Grant Goodyear <g2boojum@gentoo.org>
Status: Final
Type: Standards Track
Content-Type: text/x-rst
Created: 6-Mar-2004
Post-History: 6-Mar-2004, 5-Jun-2004, 20-Jul-2004

Status
======

After withdrawing this GLEP temporarily, a rewritten version has
now been resubmitted.  This version no longer tries to prevent a
keyword explosion, but merely tries to make it manageable.  

This version was approved on 14-Jun-2004, with the amendment that cascading
profiles should be used. 

Credits
=======

This GLEP originated from the concerns that Daniel Robbins had with the
*x86obsd* keyword, and his desire to make the KEYWORDS variable more
"feature-rich".  Drobbins' original idea was that we should allow compound
keywords such as gnu/x86, gnu/ppc, and macos/ppc (which would be explicit
versions of the more familiar x86, ppc, and macos keywords).  Method noted
that userland/arch failed to capture the full range of possibilities (what
about a GNU userland on a BSD kernel+libc?), and the issue has languished due
to a lack of reasonable solutions.  The original version of this GLEP
generated quite useful comments which hopefully have been addressed here to
make the GLEP much more reasonable.

Abstract
========

As Gentoo branches out to support non-Linux and non-GNU systems (such as Hurd,
the \*BSDs, or even the soon-to-be-open-sourced Solaris), the potential for an
"explosion" of possible keywords becomes rather large, since each new
userland/kernel/arch/whatever combination will require a new keyword.  This
GLEP proposes a simple extension to the current KEYWORDS variable that
encompasses the four parameters ARCH, USERLAND, KERNEL, and LIBC, but uses
sensible defaults to keep the new system manageable.

Motivation
==========

Since the beginning, Gentoo Linux has been conceived as a "metadistribution"
that combines remarkable flexibility with sensible defaults and exceptional
maintainablilty.  The goal of the Gentoo-Alt_ project has been to extend that
flexibility to include systems other than GNU/Linux.  For example, the author
of this GLEP has been working to create a version_ of Gentoo that uses
OpenBSD_ as the underlying kernel, userland, and libc.  OpenBSD_ supports a
variety of different architectures, so, in principle, we would need a new
*openbsd-arch* keyword for each supported architecture.  In fact, the
situation is even more complicated, because the Gentoo-Alt_ project would
eventually like to support the option of "mixing-and-matching"
GNU/\*BSD/whatever userlands and libcs irrespective of the underlying kernel.
(Debian_, for example has a similar BSD project_, except that they have
replaced the BSD userland with a GNU userland.)  The net result is that we
need keywords that can specify all possible permutations of arch,
userland, kernel and libc.  A systematic nomenclature is needed.
Fortunately, the author is a Chemist.  *Grin*

.. _Gentoo-Alt: http://www.gentoo.org/proj/en/gentoo-alt/index.xml
.. _OpenBSD: http://www.openbsd.com
.. _version: http://www.gentoo.org/proj/en/gentoo-alt/bsd/index.xml
.. _Debian: http://www.debian.org
.. _project: http://www.debian.org/ports/netbsd/

Specification
=============

Keyword Fragments
-----------------

Each keyword needs to specify, either explicitly or 
implicitly, the following parameters: ARCH, USERLAND, LIBC, and KERNEL.

    ARCH: 
        x86, amd64, cobalt, mips64, arm, hppa, ia64, ppc64, sparc
    KERNEL: 
        linux, selinux, openbsd, freebsd, netbsd, macosx
    USERLAND: 
        gnu, bsd
    LIBC: 
        glibc, openbsd, freebsd, netbsd, macosx

(The above examples are not meant to be complete.  Hurd, for example
is not included because I know very little about Hurd.)

A fully-specified keyword would look like 
"ARCH-KERNEL-USERLAND-LIBC", so, for example,
"ppc-fbsd-gnu-glibc" would indicate a Gentoo system corresponding to
a ppc architecture running the FreeBSD kernel with a GNU userland and glibc 
as the system C library.

Reasonable Defaults
-------------------

To keep this system manageable (and both to reduce typing and maintain
backwards compatibility), we need sensible defaults.  For backwards 
compatibility, the Gentoo default is a Linux kernel with a GNU userland
and glibc C library.  Thus, the current crop of ARCH-based keywords 
(x86, ppc, etcetera) require no change whatsoever.  For the \*BSD-based
systems the default USERLAND and LIBC would be those normally associated
with the corresponding KERNEL, so "x86-obsd" describes an x86 system
with an OpenBSD kernel, a BSD userland, and the OpenBSD C library.  If
either USERLAND or LIBC is specified, and thus not the default, then the
entire four-parameter string must be used.


Ebuild Keyword Database?
------------------------

One issue that has been raised is that adding a large number of keywords
to ebuilds is likely to become cumbersome over the long run.  (One could
imagine that for a simple `econf && emake && einstall` ebuild that the
list of keywords could grow to be the lengthiest part of the ebuild.)
Instead, perhaps it would make more sense to move each ebuild's keywords
out of the ebuild proper into a separate, perhaps online, database.
Nothing in this GLEP would be incompatible with such an approach, so
any further discussion will be deferred to a possible future GLEP on
that topic.


Profiles
--------

Along with an explosion of keywords comes a concomitant explosion of potential
profiles.  Just as in the current system, the profile name would be
"FLAVOR-KEYWORD-VERSION" (such as "default-s390-2004.1").  One drawback
to having a large number of profiles is that maintenance becomes a
significant problem.  In fact, one could reasonably argue that the current
number of profiles is already too many to be easily maintained.  One proposal
that has been raised to simplify matters is the idea of stackable, or
cascading, profiles, so that only differences between profiles would have to
be maintained.


Rationale
=========

The proposed new "keywording" system is far from elegant, which is
a substantial drawback.  On the other hand, it is simple, it requires
relatively minor changes, and the changes can be implemented
gradually over time.


Implementation
==============

Since the new keyword system is backwards-compatible with the current
system, "implementation" just means adding new keywords to ebuilds
as new systems are supported.


Backwards Compatibility
=======================

Backwards compatibility has already been addressed in some detail,
with the stated goal being a system that would leave all current
ebuilds working exactly as they are now.


Copyright
=========

This work is licensed under the Creative Commons Attribution-ShareAlike 3.0
Unported License.  To view a copy of this license, visit
http://creativecommons.org/licenses/by-sa/3.0/.