-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop registering a Go SDK in the Gazelle submodule #411
Conversation
@shs96c Do you have to add an SDK explicitly? The rules_go module should register an SDK for you that is picked up if no module closer to the root registers a custom one. |
This module can be used as a transitive dep, and so we want to avoid forcing users to futz with their SDKs.
@fmeum I did not know that. Altering the PR to take this into account. |
Test failures on |
@shs96c That's probably on me: bazelbuild/bazel@839ce7f This was intended to be backwards compatible, I will debug why it isn't. |
When run in the context of the bazel-skylib unit test setup, the new repo mapping logic in the Bash runfiles library failed due to a non-matching grep in a pipe. Fix this by using a wrapper around grep throughout that does not exit with exit code 1 if there is no match. Fixes bazelbuild/bazel-skylib#411 (comment) Closes #16755. PiperOrigin-RevId: 488749744 Change-Id: I087b03d9e95ba27a409c551bdc27d0027919a0fe
When run in the context of the bazel-skylib unit test setup, the new repo mapping logic in the Bash runfiles library failed due to a non-matching grep in a pipe. Fix this by using a wrapper around grep throughout that does not exit with exit code 1 if there is no match. Fixes bazelbuild/bazel-skylib#411 (comment) Closes #16755. PiperOrigin-RevId: 488749744 Change-Id: I087b03d9e95ba27a409c551bdc27d0027919a0fe
When run in the context of the bazel-skylib unit test setup, the new repo mapping logic in the Bash runfiles library failed due to a non-matching grep in a pipe. Fix this by using a wrapper around grep throughout that does not exit with exit code 1 if there is no match. Fixes bazelbuild/bazel-skylib#411 (comment) Closes #16755. PiperOrigin-RevId: 488749744 Change-Id: I087b03d9e95ba27a409c551bdc27d0027919a0fe Co-authored-by: Fabian Meumertzheim <[email protected]>
@fmeum just to confirm, do you think this change is good? If so, I'll go ahead and merge it |
@Wyverald Yup, the change it's good, it just no longer matches the PR description. |
I'm not sure if this is the best way to solve this problem, but there are two cases where we want to use this repo:
1/ We're developing the repo itself. We should be responsible for
registering the Go toolchain.
2/ We're being used transitively by another module (eg.
contrib_rules_jvm
. We should not be responsible forregistering the Go toolchain
Now, in the ideal world, we'd declare the Go SDK as a dev dependency, and everything would be fine. However, we can't do this because there's no way to gate the call to
register_toolchain
on us being the root module or not.The workaround? Attempt to use a unique name for the Go SDK that we need and hope that this works as we think it does.