summaryrefslogtreecommitdiff
path: root/transitions
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2023-07-11 14:23:22 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2023-07-12 15:25:49 +0200
commit093a0c8fe2eaa9be7d8e539f3e35236c7df0449b (patch)
treed2e373cb238d1eb4c968afb3e20dae4d3eead473 /transitions
parentc032265f93745e410236c9a73c60164aa66cdf23 (diff)
downloadrules-cc-093a0c8fe2eaa9be7d8e539f3e35236c7df0449b.tar.gz
Add new transtion "maybe for host"
... that transitions to host, unless the ARCH_DISPATCH map indicates that there is an execution-property transition allowing to run actions on the TARGET_ARCH. Also make the "target properties" available as expression as they will be needed when executing the action on the foreign architecture.
Diffstat (limited to 'transitions')
-rw-r--r--transitions/EXPRESSIONS44
1 files changed, 44 insertions, 0 deletions
diff --git a/transitions/EXPRESSIONS b/transitions/EXPRESSIONS
index 8ea7550..4fd0d1e 100644
--- a/transitions/EXPRESSIONS
+++ b/transitions/EXPRESSIONS
@@ -10,4 +10,48 @@
}
}
}
+, "target properties":
+ { "vars": ["ARCH", "TARGET_ARCH", "ARCH_DISPATCH"]
+ , "expression":
+ { "type": "let*"
+ , "bindings":
+ [ [ "TARGET_ARCH"
+ , { "type": "var"
+ , "name": "TARGET_ARCH"
+ , "default": {"type": "var", "name": "ARCH"}
+ }
+ ]
+ ]
+ , "body":
+ { "type": "if"
+ , "cond":
+ { "type": "=="
+ , "$1": {"type": "var", "name": "TARGET_ARCH"}
+ , "$2": null
+ }
+ , "then": {"type": "empty_map"}
+ , "else":
+ { "type": "lookup"
+ , "map":
+ { "type": "var"
+ , "name": "ARCH_DISPATCH"
+ , "default": {"type": "empty_map"}
+ }
+ , "key": {"type": "var", "name": "TARGET_ARCH"}
+ , "default": {"type": "empty_map"}
+ }
+ }
+ }
+ }
+, "maybe for host":
+ { "vars": ["ARCH", "HOST_ARCH", "TARGET_ARCH", "ARCH_DISPATCH"]
+ , "imports":
+ {"target properties": "target properties", "for host": "for host"}
+ , "expression":
+ { "type": "if"
+ , "cond": {"type": "CALL_EXPRESSION", "name": "target properties"}
+ , "then": {"type": "empty_map"}
+ , "else": {"type": "CALL_EXPRESSION", "name": "for host"}
+ }
+ }
}