1 |
Hi guys. We've had discussion on optional runtime dependencies in bug |
2 |
361255, but I think it's worth to have broader discussion of this issue. |
3 |
|
4 |
================================================================= |
5 |
Abstract |
6 |
|
7 |
Optional runtime dependencies are dependent packages that are not |
8 |
required to run program but when installed enhance program run-time |
9 |
features. Below new use flag prefix is suggested to handle such rdeps. |
10 |
|
11 |
Motivation |
12 |
|
13 |
Optional run time dependencies are packages that are not required at |
14 |
runtime |
15 |
but when installed provide additional features for program. For example, |
16 |
app-text/asciidoc works fine without media-gfx/graphviz, but to generate |
17 |
diagrams from a textual specification media-gfx/graphviz have to be |
18 |
installed. |
19 |
|
20 |
Currently there are two common approaches for this problem: |
21 |
|
22 |
1. add a use flag to control runtime dependency |
23 |
2. add elog message into pkg_postinst to notify users that some features |
24 |
depend |
25 |
on installing package A, B, etc. |
26 |
|
27 |
Both of this approaches are suboptimal. |
28 |
|
29 |
Use-flags (1) will require user to rebuild package just to install |
30 |
optional runtime |
31 |
dependency. |
32 |
|
33 |
elog messages do not present possible features during emerge --preted. |
34 |
So |
35 |
after reading elog message this requires user to run another emerge just |
36 |
to |
37 |
have all asciidoc features installed. |
38 |
|
39 |
elog-message approach complicates developement. Let's consider case |
40 |
where |
41 |
package foo depends on asciidoc with graph support. Without use flags |
42 |
foo-ver.ebuild have to contain something like: |
43 |
|
44 |
RDEPEND=" |
45 |
app-text/asciidoc |
46 |
media-gfx/graphviz" |
47 |
|
48 |
Now it is possible that graph provider for app-text/asciidoc changes |
49 |
(e.g. on |
50 |
graphviz-ng). In such case all this packages that require asciidoc with |
51 |
graph support |
52 |
will have to be updated (controrary to use-flag approach where |
53 |
asciidoc[graphviz] |
54 |
dependency is sufficient). |
55 |
|
56 |
Also sometimes more then one package is required to provide feature. |
57 |
net-im/psi it requires both net-im/psimedia and app-crypt/qca-ossl:2 for |
58 |
voice calls (jingle) support: |
59 |
|
60 |
PDEPEND=" |
61 |
jingle? ( net-im/psimedia |
62 |
app-crypt/qca-ossl:2 )" |
63 |
|
64 |
net-im/psimedia builds fine without app-crypt/qca-ossl:2 but it is still |
65 |
required |
66 |
to have working jingle in psi. Such dependencies are not very evident |
67 |
for |
68 |
non-maintainer and may cause problems during upgrade if, say, another |
69 |
bar |
70 |
dependency will became required for jingle support, but user/developer |
71 |
will be |
72 |
not very attentive rereading yet another time ewarn messages. |
73 |
|
74 |
Also elog approach adds text into anyway overloaded elog output. |
75 |
|
76 |
Specification |
77 |
|
78 |
Starting with EAPI=X new prefix ~ is allowed in IUSE use flag |
79 |
definition. Use |
80 |
flags prefixed with ~ are not allowed to be used anywhere but only |
81 |
inside |
82 |
PDEPEND dependency specification. This USE flags are used during |
83 |
dependency |
84 |
resolution as normal. Package manager is allowed to skip re-installation |
85 |
of the |
86 |
package due to this USE flag change but still it should record such USE |
87 |
change |
88 |
into package database. |
89 |
|
90 |
Rationale |
91 |
|
92 |
Since use-flag approach has only one drawback it's good idea to fix it. |
93 |
|
94 |
Backwards Compatibility |
95 |
|
96 |
This should be inside some future EAPI thus is backward compatible. |
97 |
Already existing prefixes (+ and -) are allowed to be in any part of |
98 |
prefix, i.e. IUSE="~foo ~+bar +~baz" should work. |
99 |
================================================================= |
100 |
|
101 |
Comments? |
102 |
|
103 |
May be instead of ~ introduce three additional prefixes (~ and another |
104 |
two for +~ and -~ cases)? |
105 |
|
106 |
-- |
107 |
Peter. |