Cherry pick into integrated_dev: [tools] Use bazel-provided Python for fusesoc subprocesses #24756
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been noticing that builds involving FuseSoC were being done twice: in Verilator simulations, I found my RTL verilated twice, and in Vivado bitstream builds, I found that Vivado was going through the entire process twice.
Doing some digging, I found bazelbuild/rules_python#675, which calls the entry point of anything in
py_binary
twice. This was version 0.9 of rules_python, which incidentally is the version pinned by lowRISC/rules_python: https://github.com/lowRISC/rules_python/blob/07c3f8547abbd5b97839a48af226a0fbcfaa5e7c/python/pip_install/extract_wheels/lib/bazel.py#L38-L49I initially tried bumping the version of rules_python, but found this interacted badly with other deps. I found #19162 which sidesteps rules_python's
py_binary
entirely with its own explicit FuseSoC wrapper script. Incidentally, after this PR got merged in the master branch, CW310 Earl Grey bitstream build times dropped from 123 minutes before this PR got merged (76713f7) to 61 mintues afterwards (91befd8).This PR simply cherry picks e38937c to integrated_dev with a trivial merge conflict fixup.