summaryrefslogtreecommitdiff
path: root/rules/cargo/RULES
diff options
context:
space:
mode:
Diffstat (limited to 'rules/cargo/RULES')
-rw-r--r--rules/cargo/RULES21
1 files changed, 18 insertions, 3 deletions
diff --git a/rules/cargo/RULES b/rules/cargo/RULES
index 59ef326..dd48c4d 100644
--- a/rules/cargo/RULES
+++ b/rules/cargo/RULES
@@ -8,7 +8,8 @@
, "provided by the \"defaults\" for the \"HOST_ARCH\"."
]
, "string_fields": ["name", "edition", "stage", "version", "pkg_name"]
- , "target_fields": ["crate_root", "srcs", "deps", "cargo_features"]
+ , "target_fields":
+ ["crate_root", "srcs", "deps", "cargo_features", "extra_data"]
, "field_doc":
{ "name": ["The name of the crate being built."]
, "cargo_features":
@@ -37,6 +38,7 @@
, "three elements are used for the major, minor, and patch"
, "number respectively."
]
+ , "extra_data": ["Extra files needed while running the build script."]
}
, "config_vars": ["ARCH", "HOST_ARCH", "ENV"]
, "config_doc":
@@ -68,7 +70,7 @@
{ "call rustc artifact": ["./", "../rust", "call rustc artifact"]
, "for host": ["./", "../rust", "for host"]
, "for host as rlib": ["./", "../rust", "for host as rlib"]
- , "get_runfiles": ["./", "..", "get_runfiles"]
+ , "get_artifacts": ["./", "..", "get_artifacts"]
}
, "implicit": {"defaults": [["./", "../rust", "defaults"]]}
, "expression":
@@ -134,6 +136,13 @@
, "map": {"type": "var", "name": "artifact result"}
}
]
+ , [ "extra_data"
+ , { "type": "let*"
+ , "bindings":
+ [["field_content", {"type": "FIELD", "name": "extra_data"}]]
+ , "body": {"type": "CALL_EXPRESSION", "name": "get_artifacts"}
+ }
+ ]
, [ "out_name"
, { "type": "join"
, "$1": [{"type": "var", "name": "stage"}, "out"]
@@ -143,7 +152,13 @@
, [ "out"
, { "type": "ACTION"
, "outs": [{"type": "var", "name": "out_name"}]
- , "inputs": {"type": "var", "name": "exe"}
+ , "inputs":
+ { "type": "map_union"
+ , "$1":
+ [ {"type": "var", "name": "extra_data"}
+ , {"type": "var", "name": "exe"}
+ ]
+ }
, "cmd":
[ "sh"
, "-ce"