rules_go icon indicating copy to clipboard operation
rules_go copied to clipboard

Add dependency on cpp toolchain to rules that also depend on cgo_context_data

Open jesses-canva opened this issue 1 year ago • 2 comments

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

This diff fixes the below issue by adding a cpp toolchain dependency to all the rules that depend on cgo_context_data, so they also have their execution platform constrained to the platforms compatible with the selected cpp toolchain.

Which issues(s) does this PR fix?

Fixes https://github.com/bazelbuild/rules_go/issues/4127

Other notes for review

A more ideal fix for this problem would be to turn cgo_context_data into a toolchain, however that would be a bigger diff.

jesses-canva avatar Oct 02 '24 16:10 jesses-canva

This is a change that I have wanted to make for a long time, thanks for sending it!

I would be in favor of obtaining cgo_context_info from the toolchain directly, even if that results in a larger diff. I think that it will make the user-visible parts of this change less confusing by not mixing toolchains in different configurations (that of the context dep and that of the current target).

fmeum avatar Oct 02 '24 22:10 fmeum

@fmeum Yep that would also work, I don't think I will be able to spend any more time on this for a while though.

jesses-canva avatar Oct 03 '24 06:10 jesses-canva