Are there any sanctioned/Pants-based mechanics to ...
# plugins
g
Are there any sanctioned/Pants-based mechanics to prevent a rule from running in parallel? I've got a race condition in my Rust plugin while running tests; where I think that multiple rule runners end up installing the toolchain at the same time, and
rustup
crashing out because of that.
I guess the rule runner might be the problematic part here, actually... It wouldn't have global knowledge, which might actually be the root issue. Maybe.
c
there’s ways to have tests run in serial, I guess..? https://www.pantsbuild.org/docs/reference-python_tests#codebatch_compatibility_tagcode Ah, it’s kind of the other way around.. that may get them into the same pytest process..
g
Yeah. In this case I think my problem is that both all rule runners write to the same append-only cache anyways, or at least that's the way it looks like.
Ended up with this: https://github.com/tgolsson/pants-cargo-porcelain/pull/5/files -- ensures that even if you were to work with Rust in two different repositories they'll not race.