Skip to content

Proper use of --platforms for 'bazel run' and --run_under #21805

Answered by katre
moroten asked this question in Q&A
Discussion options

You must be logged in to vote

bazel run is currently not working well with platforms.

I agree that the right approach would be for run to ignore the target platform (or ensure it matches the host) and use --host_platform, since it's implicitly running on the bazel host. We haven't ever prioritized doing anything special here because the default is that --platforms defaults to --host_platform, so it's mostly there. (But I'd be happy to review a PR!)

The intersection of bazel run, --platforms, and --run_under is much more confusing and needs more thought though, but my first instinct is:

  1. The actual thing that runs is whatever --run_under points to (@rules_oci//:push in your example), and that's running on the host plat…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by moroten
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants