From 161772df4241adefd2ff3440f00ee72d13987bf8 Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Fri, 21 Jul 2023 15:20:51 +0200 Subject: rules: Propagate PATH list from defaults ... instead of creating an ENV from it and propagating this. The idea is to keep PATH entries separate and only join them with ":" when we need it. In this way, we can accumulate PATHs from multiple defaults later, and perform a deduplication ("nub_left") to shorten the final string length. --- CC/auto/RULES | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'CC/auto') diff --git a/CC/auto/RULES b/CC/auto/RULES index 247ee01..0e156c9 100644 --- a/CC/auto/RULES +++ b/CC/auto/RULES @@ -156,6 +156,7 @@ , "flags-cc": ["./", "..", "flags-cc"] , "flags-cxx": ["./", "..", "flags-cxx"] , "default-ENV": ["./", "..", "default-ENV"] + , "default-PATH": ["./", "..", "default-PATH"] , "default-TOOLCHAIN": ["./", "..", "default-TOOLCHAIN"] , "default-NON_SYSTEM_TOOLS": ["./", "..", "default-NON_SYSTEM_TOOLS"] } @@ -222,6 +223,36 @@ ] } ] + , [ "ENV_PATH" + , { "type": "lookup" + , "map": {"type": "var", "name": "ENV"} + , "key": "PATH" + } + ] + , [ "ENV" + , { "type": "map_union" + , "$1": + [ {"type": "var", "name": "ENV"} + , { "type": "singleton_map" + , "key": "PATH" + , "value": + { "type": "join" + , "separator": ":" + , "$1": + { "type": "++" + , "$1": + [ {"type": "CALL_EXPRESSION", "name": "default-PATH"} + , { "type": "if" + , "cond": {"type": "var", "name": "ENV_PATH"} + , "then": [{"type": "var", "name": "ENV_PATH"}] + } + ] + } + } + } + ] + } + ] , [ "c.flags" , { "type": "BLOB" , "data": -- cgit v1.2.3