From 399fb01fef0d9ccdbdf840970d4d65c0352244e5 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Wed, 15 Jun 2022 16:22:21 +0200 Subject: 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. --- doc/concepts/expressions.org | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'doc/concepts') 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. -- cgit v1.2.3