diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-07-29 11:06:44 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2024-07-29 13:28:44 +0200 |
commit | 54393b2288110c8d2ebcc0c19c14b62e286a6ab9 (patch) | |
tree | 4d1ae7364f885e460dbe4c3eb394844489ea98d9 /CC | |
parent | 965d97835da8dd2cb71a6444537003577b60a0ad (diff) | |
download | rules-cc-54393b2288110c8d2ebcc0c19c14b62e286a6ab9.tar.gz |
["CC", "libary"] properly stage ar action
In this action we support a user provided toolchain, hence all the
components of the library need to go into a subdirectory to avoid
staiging conflicts.
Diffstat (limited to 'CC')
-rw-r--r-- | CC/EXPRESSIONS | 69 |
1 files changed, 51 insertions, 18 deletions
diff --git a/CC/EXPRESSIONS b/CC/EXPRESSIONS index c7ee9e0..34c0ed4 100644 --- a/CC/EXPRESSIONS +++ b/CC/EXPRESSIONS @@ -1047,26 +1047,59 @@ , "cond": {"type": "var", "name": "objects"} , "else": {"type": "empty_map"} , "then": - { "type": "ACTION" - , "outs": [{"type": "var", "name": "libpath"}] - , "inputs": - { "type": "map_union" - , "$1": - [ {"type": "var", "name": "TOOLCHAIN"} - , {"type": "var", "name": "objects"} + { "type": "let*" + , "bindings": + [ [ "staged objects" + , { "type": "to_subdir" + , "subdir": "work" + , "$1": {"type": "var", "name": "objects"} + } ] - } - , "env": - {"type": "var", "name": "ENV", "default": {"type": "empty_map"}} - , "cmd": - { "type": "++" - , "$1": - [ [ {"type": "var", "name": "AR", "default": "ar"} - , "cqs" - , {"type": "var", "name": "libpath"} - ] - , {"type": "keys", "$1": {"type": "var", "name": "objects"}} + , [ "staged libpath" + , { "type": "join" + , "$1": ["work/", {"type": "var", "name": "libpath"}] + } + ] + , [ "staged lib" + , { "type": "ACTION" + , "outs": [{"type": "var", "name": "staged libpath"}] + , "inputs": + { "type": "map_union" + , "$1": + [ {"type": "var", "name": "TOOLCHAIN"} + , {"type": "var", "name": "staged objects"} + ] + } + , "env": + { "type": "var" + , "name": "ENV" + , "default": {"type": "empty_map"} + } + , "cmd": + { "type": "++" + , "$1": + [ [ {"type": "var", "name": "AR", "default": "ar"} + , "cqs" + , {"type": "var", "name": "staged libpath"} + ] + , { "type": "keys" + , "$1": {"type": "var", "name": "staged objects"} + } + ] + } + } + ] + , [ "lib artifact" + , { "type": "lookup" + , "map": {"type": "var", "name": "staged lib"} + , "key": {"type": "var", "name": "staged libpath"} + } ] + ] + , "body": + { "type": "singleton_map" + , "key": {"type": "var", "name": "libpath"} + , "value": {"type": "var", "name": "lib artifact"} } } } |