aspect-build / rules_py

More compatible Bazel rules for running Python tools and building Python projects
Apache License 2.0
86 stars 29 forks source link

chore: don't cancel concurrent main builds #342

Closed gregmagolan closed 6 months ago

gregmagolan commented 6 months ago

Fixing this in all our rulesets.

This updates the GHA ci.yaml concurrency block to match all of our other rule sets. In particular, the cancel-in-progress is updated to not cancel in progress main builds ${{ github.ref_name != 'main' }} so that if two commits land on main back-to-back the 2nd one does not cancel the first if it is still running CI.

gregmagolan commented 6 months ago

Oddly I got the following checksum error on the test-release CI job:

INFO: Repository aspect_rules_py~override~py_tools~rules_py_tools.linux_amd64 instantiated at:
  <builtin>: in <toplevel>
Repository rule prebuilt_tool_repo defined at:
  /tmp/tmp.Bya2tw5Cxt/external/aspect_rules_py~override/py/private/toolchain/tools.bzl:147:37: in <toplevel>
ERROR: An error occurred during the fetch of repository 'aspect_rules_py~override~py_tools~rules_py_tools.linux_amd64':
   Traceback (most recent call last):
    File "/tmp/tmp.Bya2tw5Cxt/external/aspect_rules_py~override/py/private/toolchain/tools.bzl", line 134, column [22](https://github.com/aspect-build/rules_py/actions/runs/9009670158/job/24754572411?pr=342#step:3:23), in _prebuilt_tool_repo_impl
        rctx.download(
Error in download: java.io.IOException: Error downloading [https://github.com/aspect-build/rules_py/releases/download/v0.7.3/unpack-x86_64-unknown-linux-gnu] to /tmp/tmp.Bya2tw5Cxt/external/aspect_rules_py~override~py_tools~rules_py_tools.linux_amd64/unpack: Checksum was 35fc4335877a852a6fa1bd3ac2f99d756376ef8540d1bfa36ac7abf9c4fcc8f8 but wanted fd265552bfd[23](https://github.com/aspect-build/rules_py/actions/runs/9009670158/job/24754572411?pr=342#step:3:24)6efef519f81ce783322a50d8d7ab5af5d08a713e519cedff87f
ERROR: <builtin>: fetching prebuilt_tool_repo rule //:aspect_rules_py~override~py_tools~rules_py_tools.linux_amd64: Traceback (most recent call last):
    File "/tmp/tmp.Bya2tw5Cxt/external/aspect_rules_py~override/py/private/toolchain/tools.bzl", line 134, column 22, in _prebuilt_tool_repo_impl
        rctx.download(
Error in download: java.io.IOException: Error downloading [https://github.com/aspect-build/rules_py/releases/download/v0.7.3/unpack-x86_64-unknown-linux-gnu] to /tmp/tmp.Bya2tw5Cxt/external/aspect_rules_py~override~py_tools~rules_py_tools.linux_amd64/unpack: Checksum was 35fc4335877a852a6fa1bd3ac2f99d756376ef8540d1bfa36ac7abf9c4fcc8f8 but wanted fd[26](https://github.com/aspect-build/rules_py/actions/runs/9009670158/job/24754572411?pr=342#step:3:27)5552bfd236efef519f81ce783322a50d8d7ab5af5d08a713e519cedff87f
INFO: Repository rules_python~0.29.0~python~python_3_11_x86_64-unknown-linux-gnu instantiated at:
  <builtin>: in <toplevel>
Repository rule python_repository defined at:
  /tmp/tmp.Bya2tw5Cxt/external/rules_python~0.29.0/python/repositories.bzl:397:36: in <toplevel>
ERROR: no such package '@@aspect_rules_py~override~py_tools~rules_py_tools.linux_amd64//': java.io.IOException: Error downloading [https://github.com/aspect-build/rules_py/releases/download/v0.7.3/unpack-x86_64-unknown-linux-gnu] to /tmp/tmp.Bya2tw5Cxt/external/aspect_rules_py~override~py_tools~rules_py_tools.linux_amd64/unpack: Checksum was 35fc4335877a852a6fa1bd3ac2f99d756376ef8540d1bfa36ac7abf9c4fcc8f8 but wanted fd265552bfd236efef519f81ce783322a50d8d7ab5af5d08a713e519cedff87f
ERROR: /home/runner/work/rules_py/rules_py/e2e/use_release/BUILD.bazel:3:10: //:main depends on @@aspect_rules_py~override~py_tools~rules_py_tools.linux_amd64//:venv_toolchain in repository @@aspect_rules_py~override~py_tools~rules_py_tools.linux_amd64 which failed to fetch. no such package '@@aspect_rules_py~override~py_tools~rules_py_tools.linux_amd64//': java.io.IOException: Error downloading [https://github.com/aspect-build/rules_py/releases/download/v0.7.3/unpack-x86_64-unknown-linux-gnu] to /tmp/tmp.Bya2tw5Cxt/external/aspect_rules_py~override~py_tools~rules_py_tools.linux_amd64/unpack: Checksum was 35fc4335877a852a6fa1bd3ac2f99d756376ef8540d1bfa36ac7abf9c4fcc8f8 but wanted fd265552bfd236efef519f81ce783322a50d8d7ab5af5d08a713e519cedff87f

Fixed in 2nd commit

gregmagolan commented 6 months ago

Please update the commit body with the motivation and reasons behind this change and split into two PRs for landing.

Looks like main was broken on the last landed commit by this PR https://github.com/aspect-build/rules_py/pull/333. I'll pre-factor the fix into a separate PR.