I have a post Action
attached to a Command
:
my_command = env.Command(out_file, in_file, Action(cmd_str))
env.AddPostAction(my_command, Action(...))
This works well enough unless out_file is pulled from a cachefile via sccache. Then, it seems that the post action no longer runs.
Is it true that post actions are not run on targets pulled from cachefiles? If so, how can I ensure my post action always run?
Thanks!
The question here would be why exactly you want to run your post action "always", even when simply retrieving a built file from the cache. I assume that your post action is some kind of debug or print output that you always want to see when the target in question gets "accessed". This is not what the concept of an Action is there for. Action()s define the single steps that are required to actually build a target. Once its created, and can be retrieved from the cache, there is no need to run those Action()s a second time...it can, in fact, be counter-productive: Just imagine that your post action adds a special trailer with debug infos to your final object file or executable. Would you want to add this info every time the target is retrieved from the cache? I don't think so.
To sum this all up, when a file is retrieved from the cache, no actions whatsoever---neither pre- nor post- nor the actual action list---are run. This is by design, as I tried to outline in the first paragraph.