Information passing between extra_actions

时间:2017-06-09 12:47:26

标签: bazel bazel-extra-action

I have an action_listener:

action_listener(
    name = "foo_listen",
    mnemonics = [
        "Foo", # Foo might usually take several minutes
    ],
    extra_actions = [
        "foo_action_pre", # Start some processing
        "foo_action_post", # Finish parts of processing that needs action output
    ],
)

In foo_action_pre, I set

out_templates=[
    "foo_action_pre_data",
],

in order to pass information to foo_action_post.

Now when I add $(location foo_action_pre_data) to the cmd of foo_action_post Bazel complains, that it is not a prereq.

No matter whether I add that to tools or data though, it never is detected as a prereq. How can I declare the correct dependency?

1 个答案:

答案 0 :(得分:0)

您必须使用$(output foo_action_pre_data)代替$(location foo_action_pre_data)

请参阅extra_action.cmd