summaryrefslogtreecommitdiff
path: root/doc/concepts
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2022-06-15 16:22:21 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2022-06-20 16:54:03 +0200
commit399fb01fef0d9ccdbdf840970d4d65c0352244e5 (patch)
tree7e3139cec068d0651bc862b685b6a314a2d0cdd4 /doc/concepts
parentd9e35f9d82acbc661aca0cb5608e052434e52dc8 (diff)
downloadjustbuild-399fb01fef0d9ccdbdf840970d4d65c0352244e5.tar.gz
Disallow comparison of names
In our semantics, it was always intended that names are completely opaque and only used by passing them to functions providing information about a target. However, we never enforced that they not be compared for equality, even though we always had this in mind, and the computation of the target-level cache key was designed with this semantics in mind. Enforce this restriction now.
Diffstat (limited to 'doc/concepts')
-rw-r--r--doc/concepts/expressions.org14
1 files changed, 10 insertions, 4 deletions
diff --git a/doc/concepts/expressions.org b/doc/concepts/expressions.org
index 5b7e2f2c..2dff612a 100644
--- a/doc/concepts/expressions.org
+++ b/doc/concepts/expressions.org
@@ -121,7 +121,8 @@ expression.
****** Sequential case distinction on arbitrary values: ~"case*"~
If the key ~"case"~ is present, it has to be a list of pairs. In this
-case, the key ~"expr"~ is evaluated. The result of that evaluation
+case, the key ~"expr"~ is evaluated. It is an error if that evaluates
+to a name-containg value. The result of that evaluation
is sequentially compared to the evaluation of the first components
of the ~"case"~ list until an equal value is found. In this case,
the evalaution of the second component of the pair is the value of
@@ -188,7 +189,8 @@ those) argument(s) to obtain the final result.
***** Unary functions
-- ~"nub_right"~ The argument has to be a list. The result is the
+- ~"nub_right"~ The argument has to be a list. It is an error if that list
+ contains (directly or indirectly) a name. The result is the
input list, except that for all duplicate values, all but the
rightmost occurence is removed.
@@ -268,11 +270,14 @@ those) argument(s) to obtain the final result.
conflicts can also occur in non-flat staging if two keys are
different as strings, but name the same path (like ~"foo.txt"~
and ~"./foo.txt"~), and are assigned different values.
+ It also is an error if the values for keys in conflicting positions
+ are name-containing.
***** Binary functions
- ~"=="~ The result is ~true~ is the arguments are equal, ~false~
- otherwise.
+ otherwise. It is an error if one of the arguments are name-containing
+ values.
- ~"concat_target_name"~ This function is only present to simplify
transitions from some other build systems and normally not used
@@ -325,4 +330,5 @@ that evaluation included in the error message presented to the user.
- ~"disjoint_map_union"~ Like ~"map_union"~ but it is an error,
if two (or more) maps contain the same key, but map it to
- different values.
+ different values. It is also an error if the argument is a
+ name-containing value.