bazelbuild / rules_python

Bazel Python Rules
https://rules-python.readthedocs.io
Apache License 2.0
538 stars 542 forks source link

tests: use $(rootpaths) to get executable files paths for Bazel 8 compatibility #2395

Closed rickeylev closed 1 week ago

rickeylev commented 1 week ago

In Bazel 8, the singular $(rootpath) expansions require that the target expands to a single file. The py rules have an unfortunate legacy behavior where their default outputs are the executable and the main py file, thus causing an error.

To fix, use the plural $(rootpaths), then post-process the space-separated string to get just the executable portion of it.

Along the way...

Work towards https://github.com/bazelbuild/rules_python/issues/2378