Gentoo Archives: gentoo-dev

From: Arfrever Frehtes Taifersar Arahesis <Arfrever@g.o>
To: Gentoo Development <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] Support for multiple ABIs (for Python modules etc.)
Date: Sat, 25 Jul 2009 15:31:00
Message-Id: 200907251732.31464.Arfrever@gentoo.org
In Reply to: [gentoo-dev] Support for multiple ABIs (for Python modules etc.) by Arfrever Frehtes Taifersar Arahesis
1 2009-07-25 12:28:44 Arfrever Frehtes Taifersar Arahesis napisaƂ(a):
2 > I would like to present the plan of support for multiple ABIs. It should be sufficient for
3 > Python modules and might be also appropriate for some other ABI types (e.g. for Ruby modules).
4 >
5 > 1. Portage will support repository-specific, profile-independent ${REPOSITORY}/profiles/settings
6 > configuration files (filename can be changed). They will set some variables (similarly to
7 > make.defaults files). These variables shouldn't be overrideable by profiles, eclasses, ebuilds
8 > or by user's configuration files (e.g. /etc/portage/*). For future compatibility these files
9 > could also support lists/indexed arrays and dictionaries/associative arrays/maps.
10 >
11 > 2. ${REPOSITORY}/profiles/settings will set ABI_TYPES and ${ABI_TYPE^^}_ABI_SUPPORTED_VALUES variables.
12 > ABI_TYPES defines supported ABI types. ${ABI_TYPE^^}_ABI_SUPPORTED_VALUES defines supported ABIs
13 > for given ABI type.
14 >
15 > Example (${REPOSITORY}/profiles/settings):
16 > ABI_TYPES="python ruby ..."
17 > PYTHON_ABI_SUPPORTED_VALUES="2.4 2.5 2.6 3.0 3.1"
18 > RUBY_ABI_SUPPORTED_VALUES="1.8 1.9"
19 >
20 > 3. make.defaults files will support ${ABI_TYPE^^}_ABI_FORCED_VALUES/${ABI_TYPE^^}_ABI_MASKED_VALUES
21 > variables to force/mask specific ABIs in given profiles.
22 >
23 > Example (make.defaults):
24 > PYTHON_ABI_MASKED_VALUES="2.4 2.5"
25 > PYTHON_ABI_FORCED_VALUES="3.1"
26 >
27 > 4. For convenience of developers ABI dependencies will be able to be specified in explicit and
28 > slightly implicit way. Ebuilds/eclasses, which support multiple ABIs, will set USED_ABI_TYPES.
29 > Ebuilds/eclasses will be able to set RESTRICT_${ABI_TYPE^^}_ABIS variables which will support
30 > '*' wildcard. USED_ABI_TYPES and RESTRICT_${ABI_TYPE^^}_ABIS variables should be cumulative
31 > (across eclasses and ebuild).
32 >
33 > Example (ebuild):
34 > USED_ABI_TYPES="python"
35 > # This package doesn't work yet with Python 2.6 and 3.*
36 > RESTRICT_PYTHON_ABIS="2.6 3*"
37 >
38 > 4.1. Implicitly specified ABI dependencies. During calculation of dependencies of given package,
39 > Portage will verify if all dependencies, which use given ABI type, have been built with enabled
40 > support for these ABIs, which are enabled for given package.
41 >
42 > Example (ebuild):
43 > # dev-python/bsddb3
44 > USED_ABI_TYPES="python"
45 > RDEPEND=">=sys-libs/db-4.6"
46 > DEPEND="${RDEPEND}
47 > dev-python/setuptools
48 > doc? ( dev-python/sphinx )"
49 >
50 > Assuming that dev-python/setuptools and dev-python/sphinx set USED_ABI_TYPES="python",
51 > Portage will verify that, when user runs `USE_PYTHON="2.5 2.6" emerge dev-python/bsddb3`,
52 > dev-python/setuptools and dev-python/sphinx (when USE="doc" is enabled) are built with
53 > enabled support for at least "2.5" and "2.6" Python ABIs. If they are already installed
54 > without support for e.g. "2.5" Python ABI, Portage will print appropriate error message
55 > (similarly to unsatisfied USE dependencies) and exit.
56 >
57 > 4.2. Explicitly specified ABI dependencies. {,P,R}DEPEND variables will support specifying
58 > ABI dependencies in explicit way. {,P,R}DEPEND variables will also support ABI conditionals.
59 > I suggest using {ABI_type[comma-delimited values]} syntax, but it can be changed.
60 >
61 > Example (ebuild):
62 > DEPEND="category/package1{python[2.5,2.6],ruby[-1.8]}"
63 > RDEPEND="{python[2.6]}? ( category/package2 )
64 >
65 > Example (python.eclass):
66 > DEPEND="
67 > {python[2.4]}? ( dev-lang/python:2.4 )
68 > {python[2.5]}? ( dev-lang/python:2.5 )
69 > {python[2.6]}? ( dev-lang/python:2.6 )
70 > {python[3.0]}? ( dev-lang/python:3.0 )
71 > {python[3.1]}? ( dev-lang/python:3.1 )
72 > "
73 > RDEPEND="${RDEPEND}"
74 >
75 > 5. 18th line of metadata cache files will contain the list of ABI types and values supported
76 > (i.e. not restricted by RESTRICT_${ABI_TYPE^^}_ABIS variables) by given package.
77 >
78 > Example (18th line of metadata cache file):
79 > python[2.5,2.6,3.0,3.1] ruby[1.8,1.9]
80 >
81 > Every change to ${REPOSITORY}/profiles/settings should probably invalidate whole metadata
82 > cache of given repository.
83 >
84 > 6. Portage will support USE_${ABI_TYPE^^} variables in /etc/make.conf to specify which ABIs
85 > should be enabled.
86
87 Portage will also allow to set USE_${ABI_TYPE^^} variables per-package etc.
88
89 >
90 > Example (/etc/make.conf):
91 > USE_PYTHON="2.5 2.6 3.1"
92 > USE_RUBY="1.8 1.9"
93 >
94 > 7. Portage will set ${ABI_TYPE^^}_ABIS variables in ebuild environment. ${ABI_TYPE^^}_ABIS
95 > should contain ABIs forced by ${ABI_TYPE^^}_ABI_FORCED_VALUES and these ABIs enabled by user
96 > in /etc/make.conf by USE_${ABI_TYPE^^} which aren't masked by ${ABI_TYPE^^}_ABI_MASKED_VALUES.
97
98 ${ABI_TYPE^^}_ABIS variables won't contain ABIs restricted by RESTRICT_${ABI_TYPE^^}_ABIS
99 variables. Eclasses/ebuilds will be able to change the values of ${ABI_TYPE^^}_ABIS variables
100 in ebuild phases. For example python.eclass will support ignoring of build failures for Python
101 ABIs specified by user in FAILURE_TOLERANT_PYTHON_ABIS variable. Python ABIs, for which
102 building has failed, would be removed from PYTHON_ABIS variable.
103
104 >
105 > Example (ebuild):
106 > src_compile() {
107 > for abi in ${PYTHON_ABIS}; do
108 > emake PYTHON=$(get_PYTHON ${abi})
109 > done
110 > }
111 >
112 > Ebuilds/eclasses should implicitly enable support for one ("default") ABI, when user hasn't
113 > set appropriate USE_${ABI_TYPE^^} variable. For example Python modules would use ABI of
114 > /usr/bin/python.
115 >
116 > 8. Portage will store the list of supported ABIs in /var/db/pkg/${CATEGORY}/${PF}/SUPPORTED_ABIS
117 > and the list of enabled ABIs in /var/db/pkg/${CATEGORY}/${PF}/ABIS.
118
119 The list of enabled ABIs in /var/db/pkg/${CATEGORY}/${PF}/ABIS will depend on final values of
120 ${ABI_TYPE^^}_ABIS variables after installation.
121
122 >
123 > Example (/var/db/pkg/${CATEGORY}/${PF}/SUPPORTED_ABIS):
124 > python[2.4,2.5,2.6,3.0,3.1] ruby[1.8,1.9]
125 >
126 > Example (/var/db/pkg/${CATEGORY}/${PF}/ABIS):
127 > python[2.6,3.1] ruby[1.9]
128 >
129 > Names/syntax of specific variables etc. can be changed. Please write constructive comments.
130
131 --
132 Arfrever Frehtes Taifersar Arahesis

Attachments

File name MIME type
signature.asc application/pgp-signature