Description of the problem:
Bazel fails with java.lang.IllegalStateException: method invocation returned null: toolchains() when invoking rules_go's go_context from a Starlark build setting rule.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I have created a minimal example as this gist. If the line go_context(ctx) is replaced with pass, the build succeeds without an exception. I suspect that rules_go is not really needed to trigger the exception here, but don't know enough about toolchains to minimize this example further.
I found this example while trying to create a config setting that would automatically generate code based on its current value.
What operating system are you running Bazel on?
Linux
What's the output of bazel info release?
release 3.7.1
Have you found anything relevant by searching the web?
Unfortunately not.
Any other information, logs, or outputs that you want to share?
See https://gist.github.com/fmeum/86bd43948210ba2fc9fb64f6a3a3f6af#file-trace for the trace.
Description of the problem:
Bazel fails with
java.lang.IllegalStateException: method invocation returned null: toolchains()when invokingrules_go'sgo_contextfrom a Starlark build setting rule.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I have created a minimal example as this gist. If the line
go_context(ctx)is replaced withpass, the build succeeds without an exception. I suspect thatrules_gois not really needed to trigger the exception here, but don't know enough about toolchains to minimize this example further.I found this example while trying to create a config setting that would automatically generate code based on its current value.
What operating system are you running Bazel on?
Linux
What's the output of
bazel info release?release 3.7.1Have you found anything relevant by searching the web?
Unfortunately not.
Any other information, logs, or outputs that you want to share?
See https://gist.github.com/fmeum/86bd43948210ba2fc9fb64f6a3a3f6af#file-trace for the trace.