Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/pms:eapi-7 commit in: /
Date: Sun, 01 Oct 2017 07:11:55
Message-Id: 1506841881.83161067ec7fd04a0a3d8dbd403732b72bf99238.mgorny@gentoo
1 commit: 83161067ec7fd04a0a3d8dbd403732b72bf99238
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 30 21:59:50 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 1 07:11:21 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/pms.git/commit/?id=83161067
7
8 [WIP] EAPI 7 limits dependency group nesting.
9
10 Restrict allowed dependency group nesting in EAPI 7. Most of the groups
11 can only be used at top-level and inside USE-conditional groups (which
12 can be reduced predictably). All-of groups are only permitted where they
13 are really meaningful -- in any-of groups. Any more complex nesting is
14 forbidden.
15
16 This not only ensures that the dependency syntax variables stay more
17 readable but also put lower requirements on the dependency parser
18 and other mechanisms working with the variables.
19
20 [TODO: add label & update eapi-differences]
21
22 Bug: https://bugs.gentoo.org/632000
23
24 dependencies.tex | 37 +++++++++++++++++++++++++++++++++----
25 1 file changed, 33 insertions(+), 4 deletions(-)
26
27 diff --git a/dependencies.tex b/dependencies.tex
28 index fa818b7..fd142bb 100644
29 --- a/dependencies.tex
30 +++ b/dependencies.tex
31 @@ -88,31 +88,36 @@ be surrounded on both sides by whitespace, except at the start and end of the st
32 followed by zero or more of (a dependency item of any kind followed by whitespace), followed
33 by a close parenthesis. More formally:
34 \t{all-of} \t{::=} \t{'(' whitespace (item whitespace)* ')'}. Permitted in all specification
35 - style variables.
36 + style variables. Permitted inside groups listed in table~\ref{tab:depend-nesting}.
37 \item An any-of group, which consists of the string \t{||}, followed by whitespace,
38 followed by an open parenthesis, followed by whitespace, followed by zero or more
39 of (a dependency item of any kind followed by whitespace), followed by a close parenthesis.
40 More formally: \t{any-of} \t{::=} \t{'||' whitespace '(' whitespace (item whitespace)* ')'}.
41 Permitted in \t{DEPEND}, \t{RDEPEND}, \t{PDEPEND}, \t{LICENSE}, \t{REQUIRED_USE}.
42 + Permitted inside groups listed in table~\ref{tab:depend-nesting}.
43 \item An exactly-one-of group, which consists of the string \t{\textasciicircum\textasciicircum},
44 followed by whitespace, followed by an open parenthesis, followed by whitespace, followed by
45 zero or more of (a dependency item of any kind followed by whitespace), followed by a close
46 parenthesis. More formally: \t{exactly-one-of} \t{::=} \t{'\textasciicircum\textasciicircum'
47 whitespace '(' whitespace (item whitespace)* ')'}.
48 - Permitted in \t{REQUIRED_USE}.
49 + Permitted in \t{REQUIRED_USE}. Permitted inside groups listed in table~\ref{tab:depend-nesting}.
50 \item \featurelabel{at-most-one-of} An at-most-one-of group, which consists of the string \t{??},
51 followed by whitespace, followed by an open parenthesis, followed by whitespace, followed by
52 zero or more of (a dependency item of any kind followed by whitespace), followed by a close
53 parenthesis. More formally: \t{at-most-one-of} \t{::=} \t{'??'\ whitespace '(' whitespace
54 (item whitespace)* ')'}. Permitted in \t{REQUIRED_USE} in EAPIs listed in
55 - table~\ref{tab:at-most-one-of-table} as supporting \t{REQUIRED_USE ??}\ groups.
56 + table~\ref{tab:at-most-one-of-table} as supporting \t{REQUIRED_USE ??}\ groups. Permitted inside
57 + groups listed in table~\ref{tab:depend-nesting}.
58 +
59 + In EAPIs blah blah permitted only at top-level and inside USE-conditional group.
60 \item A use-conditional group, which consists of an optional exclamation mark, followed by
61 a use flag name, followed by a question mark, followed by whitespace, followed by
62 an open parenthesis, followed by whitespace, followed by zero or more of (a dependency item
63 of any kind followed by whitespace), followed by a close parenthesis. More formally:
64 \t{use-conditional} \t{::=} \t{'!'?\ flag-name '?'\ whitespace '(' whitespace (item
65 whitespace)* ')'}.
66 - Permitted in all specification style variables.
67 + Permitted in all specification style variables. Permitted inside groups listed
68 + in table~\ref{tab:depend-nesting}.
69 \end{compactitem}
70
71 In particular, note that whitespace is not optional.
72 @@ -159,6 +164,30 @@ In particular, note that whitespace is not optional.
73 \end{tabular}
74 \end{centertable}
75
76 +\ChangeWhenAddingAnEAPI{7}
77 +\begin{centertable}{EAPI-specific group nesting restrictions}
78 + \label{tab:depend-nesting}
79 + \begin{tabular}{lP{4em}P{4em}P{4em}P{4em}P{4em}}
80 + \toprule
81 + \multicolumn{1}{c}{\textbf{EAPI}} &
82 + \multicolumn{1}{c}{\textbf{all-of}} &
83 + \multicolumn{1}{c}{\textbf{any-of}} &
84 + \multicolumn{1}{c}{\textbf{exactly-one-of}} &
85 + \multicolumn{1}{c}{\textbf{at-most-one-of}} &
86 + \multicolumn{1}{c}{\textbf{use-conditional}} \\
87 + & \multicolumn{5}{c}{\textbf{permitted inside}} \\
88 + \midrule
89 + 0, 1, 2, 3, 4 & all groups & all groups & all groups & n/a & all groups \\
90 + 5, 6 & all groups & all groups & all groups & all groups & all groups \\
91 + 7 & any-of
92 + & top, use-conditional
93 + & top, use-conditional
94 + & top, use-conditional
95 + & top, use-conditional \\
96 + \bottomrule
97 + \end{tabular}
98 +\end{centertable}
99 +
100 \subsection{All-of dependency specifications}
101
102 In an all-of group, all of the child elements must be matched.