pants icon indicating copy to clipboard operation
pants copied to clipboard

Rules consuming Pex's should respect the Pex's target platform.

Open hrfuller opened this issue 6 years ago • 3 comments

As a follow up to #8090 rules that consume platform dependent output (Pex for instance) should respect the target_platform that it was built for. Currently we have the ability to restrict the execution platform of a request, but the target_platform is not respected. For instance the run_python_test rule creates a pytest Pex. That Pex is built on the local platform but if speculation is enabled it could be shipped and run on the remote platform, which if different would result in a stochastic error.

To prevent this we need to add a target platform field to the Pex class that consuming rules can respect. Then execution they request can happen on the platform that the Pex is compatible with. Once we have #7490 and Platforms are yieldable in Get's we can request Pex's for multiple platforms and make the run_python_test rule multi platform compatible.

hrfuller avatar Oct 02 '19 22:10 hrfuller

It would be good to expand the design doc (and link it here) to account for this case: we probably want to fix this more generally via the graph, rather than necessarily fixing it only for Pex.

stuhood avatar Oct 03 '19 04:10 stuhood

Agreed. I think the "fixing via the graph" is the same as #8353 which already has speculation on inputs as a follow up. Dependency wise I think we need:

  • Platform as a param #8375
  • Multi param Get #7490
  • Node based speculation in #8353

That will allow this to be fixed correctly.

hrfuller avatar Oct 03 '19 15:10 hrfuller

This issue has been open for over one year without activity and is not labeled as a bug. It has been labeled as stale to invite any further updates. If you can confirm whether the issue is still applicable to the latest version of Pants, appears in other contexts, or its priority has changed, please let us know. Please feel free to close this issue if it is no longer relevant.

github-actions[bot] avatar Dec 03 '25 04:12 github-actions[bot]