bazel-contrib / rules_go

Go rules for Bazel
Apache License 2.0
1.38k stars 656 forks source link

Support matching release candidate toolchain versions #3998

Closed JacobOaks closed 2 months ago

JacobOaks commented 2 months ago

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

Go release candidate versions are of the format X.YrcZ. (ex: https://github.com/golang/go/commit/30b6fd60a63c738c2736e83b6a6886a032e6f269)

Unfortunately, this format doesn't get matched properly in go_toolchain.bzl so it's not possible to use rc versions without patching VERSION, or you'll run into the error, for e.g., with the added test case:

no matching toolchains found for types @io_bazel_rules_go//go:toolchain

This PR adds a way to match rc versions for the toolchain.