Skip to content
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

SDK registration no longer detecting go_download_sdk #3510

Closed
sluongng opened this issue Apr 1, 2023 · 2 comments · Fixed by #3511
Closed

SDK registration no longer detecting go_download_sdk #3510

sluongng opened this issue Apr 1, 2023 · 2 comments · Fixed by #3511

Comments

@sluongng
Copy link
Contributor

sluongng commented Apr 1, 2023

This PR broke buildbuddy repo when upgrading from v0.38.1 to v0.39.1.

ERROR: Traceback (most recent call last):
        File "/Users/sluongng/work/buildbuddy/buildbuddy/WORKSPACE", line 81, column 23, in <toplevel>
                go_register_toolchains(
        File "/private/var/tmp/_bazel_sluongng/06e573a93bc2d6a9cad4ad41f00b4310/external/io_bazel_rules_go/go/private/sdk.bzl", line 641, column 17, in go_register_toolchains
                fail('go_register_toolchains: version must be a string like "1.15.5" or "host"')
Error in fail: go_register_toolchains: version must be a string like "1.15.5" or "host"

Here is the bisect that I used

> cat test-build.sh
#!/bin/bash

(
  cd /Users/sluongng/work/buildbuddy/buildbuddy
  bazel build cli --override_repository=io_bazel_rules_go=/Users/sluongng/work/bazelbuild/rules_go
)

Bisect run

  cd /Users/sluongng/work/bazelbuild/rules_go
  git bisect start --first-parent
  git bisect bad HEAD # this is latest master (e558f56df9995f571e49de336c3831d407d9ff70)
  git bisect good v0.38.1
  git bisect run ./test-build.sh

Most likely this has something to do with how our repo is registering separate Go SDK using go_download_sdk calls to avoid some transition cross-compilation we found in the past. https://github.com/buildbuddy-io/buildbuddy/blob/ede1e1d07122a3bdd22a61b31dd7c6a8d8bd458d/WORKSPACE#L53-L83

cc: @fmeum @tyler-french

sluongng added a commit to buildbuddy-io/buildbuddy that referenced this issue Apr 1, 2023
- Upgraded rules_go to v0.39.0
- Upgraded gazelle to v0.30.0
  + Patch visibility of @gazelle//internal/module to build `bb` CLI
- Upgraded go to 1.20.2
- Upgrade several golang.org/x/... packages

This also required us to change how we are registering go_sdk. An issue
was reported upstream here bazelbuild/rules_go#3510
sluongng added a commit to buildbuddy-io/buildbuddy that referenced this issue Apr 1, 2023
- Upgraded rules_go to v0.39.0
- Upgraded gazelle to v0.30.0
  + Patch visibility of @gazelle//internal/module to build `bb` CLI
- Upgraded go to 1.20.2
- Upgrade several golang.org/x/... packages

This also required us to change how we are registering go_sdk. An issue
was reported upstream here bazelbuild/rules_go#3510
@fmeum
Copy link
Collaborator

fmeum commented Apr 1, 2023

I suspect that this line is now out-of-date:

sdk_kinds = ("_go_download_sdk", "_go_host_sdk", "_go_local_sdk", "_go_wrap_sdk")

@sluongng Could you check whether that's all that broke and potentially submit a PR?

@sluongng
Copy link
Contributor Author

sluongng commented Apr 1, 2023

thanks for the hint, PR submitted 🤗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants