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

Support go1.21 #617

Closed
chenrui333 opened this issue Jul 18, 2023 · 7 comments
Closed

Support go1.21 #617

chenrui333 opened this issue Jul 18, 2023 · 7 comments

Comments

@chenrui333
Copy link
Contributor

While pre-release testing go1.21, we found some regression test issue

error build log
  ==> Testing ibazel
  iBazel [4:01PM]: Querying for files to watch...
  iBazel [4:01PM]: Building //:bazel-test
  Loading: 
  Loading: 
  Loading: 0 packages loaded
  Analyzing: target //:bazel-test (0 packages loaded, 0 targets configured)
  ERROR: /tmp/ibazel-test-20230625-66545-1f7x4j4/_bazel/925cec60fe9edcc34fd0fd7780b797bf/external/go_sdk/version.bzl:5:21: unclosed string literal
  ERROR: /tmp/ibazel-test-20230625-66545-1f7x4j4/_bazel/925cec60fe9edcc34fd0fd7780b797bf/external/go_sdk/version.bzl:6:1: syntax error at 'time': expected newline
  ERROR: /tmp/ibazel-test-20230625-66545-1f7x4j4/_bazel/925cec60fe9edcc34fd0fd7780b797bf/external/go_sdk/version.bzl:6:11: invalid octal literal: 06 (use '0o6')
  ERROR: /tmp/ibazel-test-20230625-66545-1f7x4j4/_bazel/925cec60fe9edcc34fd0fd7780b797bf/external/go_sdk/version.bzl:6:20: invalid octal literal: 00 (use '0o0')
  ERROR: /tmp/ibazel-test-20230625-66545-1f7x4j4/_bazel/925cec60fe9edcc34fd0fd7780b797bf/external/go_sdk/version.bzl:6:23: invalid octal literal: 01 (use '0o1')
  ERROR: /tmp/ibazel-test-20230625-66545-1f7x4j4/_bazel/925cec60fe9edcc34fd0fd7780b797bf/external/go_sdk/version.bzl:7:1: unclosed string literal
  ERROR: /tmp/ibazel-test-20230625-66545-1f7x4j4/BUILD:3:10: While resolving toolchains for target //:bazel-test: invalid registered toolchain '@go_sdk_toolchains//:go_aix_ppc64': error loading package '@go_sdk_toolchains//': compilation of module 'version.bzl' failed
  ERROR: Analysis of target '//:bazel-test' failed; build aborted: 
  INFO: Elapsed time: 0.541s
  INFO: 0 processes.
  FAILED: Build did NOT complete successfully (29 packages loaded, 6 targets configured)
  iBazel [4:01PM]: Build error: exit status 1
  
  ################################################################################
  # Did you know iBazel can invoke programs like Gazelle, buildozer, and         #
  # other BUILD file generators for you automatically based on bazel output?     #
  # Documentation at: https://github.com/bazelbuild/bazel-watcher#output-runner  #
  ################################################################################
  
  Killing child processes...

full build log, https://github.com/Homebrew/homebrew-core/actions/runs/5370484128/jobs/9742789964?pr=134468#step:4:514
relates to Homebrew/homebrew-core#134468

@achew22
Copy link
Member

achew22 commented Jul 19, 2023

What repo are you testing? In the BUILD file in the root we do not have a target //:bazel-test

@chenrui333
Copy link
Contributor Author

oh, that might be some test we need to update in the homebrew side, let me check really quick

@chenrui333
Copy link
Contributor Author

indeed an issue with updating the rules_go to use the commit in this PR

iBazel [1:15PM]: You are using an experimental filesystem watcher. If you would like to disable that, please set the environment variable
	IBAZEL_USE_LEGACY_WATCHER=1
iBazel [1:15PM]: Error getting Bazel info exit status 1
iBazel [1:15PM]: Querying for files to watch...
iBazel [1:15PM]: Error getting Bazel info exit status 1
iBazel [1:15PM]: Error finding bazel info: exit status 1

iBazel [1:15PM]: Error querying for source files: exit status 1
iBazel [1:15PM]: Error getting Bazel info exit status 1
iBazel [1:15PM]: Error finding bazel info: exit status 1

iBazel [1:15PM]: Error querying for source files: exit status 1
iBazel [1:15PM]: Building //:bazel-test
ERROR: Error computing the main repository mapping: Every .bzl file must have a corresponding package, but '@io_bazel_rules_go//go:deps.bzl' does not have one. Please create a BUILD file in the same or any parent directory. Note that this BUILD file does not need to do anything except exist.
Loading:
iBazel [1:15PM]: Build error: exit status 1

################################################################################
# Did you know iBazel can invoke programs like Gazelle, buildozer, and         #
# other BUILD file generators for you automatically based on bazel output?     #
# Documentation at: https://github.com/bazelbuild/bazel-watcher#output-runner  #
################################################################################

@achew22
Copy link
Member

achew22 commented Aug 8, 2023

I'm not sure I understand what the linked PR has to do with this. Can you elaborate a little bit more?

@jmhodges
Copy link
Contributor

jmhodges commented Aug 8, 2023

@chenrui333 I believe the underlying problem is actually that homebrew needs to update the version of rules_go in the ibazel test to support Go 1.21's new version output. There's a new rules_go v0.41.0 that does so

Let me walk both of y'all down a garden path to explain that.

The bazel-test target is one that the Homebrew project creates to test when ibazel or one of its dependencies is bumped to a new version or changed. You can see the test definition in homebrew's repo

However, the log outputs linked in this ticket aren't super explanatory and don't match what's elsewhere. I suspect that's because the links that GitHub generates for the failed checks in on this page don't include the same --verbose info that's on that page.

If you look at that page, you see these error outputs mentioned in a section titled "brew test --retry --verbose ibazel failed on Linux!":

ERROR: /tmp/ibazel-test-20230808-72283-emd4kd/_bazel/2223a70abfa57191e29592d0d9893a55/external/go_sdk/version.bzl:5:21: unclosed string literal
ERROR: /tmp/ibazel-test-20230808-72283-emd4kd/_bazel/2223a70abfa57191e29592d0d9893a55/external/go_sdk/version.bzl:6:1: syntax error at 'time': expected newline
ERROR: /tmp/ibazel-test-20230808-72283-emd4kd/_bazel/2223a70abfa57191e29592d0d9893a55/external/go_sdk/version.bzl:6:11: invalid octal literal: 08 (use '0o8')
ERROR: /tmp/ibazel-test-20230808-72283-emd4kd/_bazel/2223a70abfa57191e29592d0d9893a55/external/go_sdk/version.bzl:6:14: invalid octal literal: 04 (use '0o4')
ERROR: /tmp/ibazel-test-20230808-72283-emd4kd/_bazel/2223a70abfa57191e29592d0d9893a55/external/go_sdk/version.bzl:6:23: invalid octal literal: 06 (use '0o6')
ERROR: /tmp/ibazel-test-20230808-72283-emd4kd/_bazel/2223a70abfa57191e29592d0d9893a55/external/go_sdk/version.bzl:7:1: unclosed string literal
ERROR: /tmp/ibazel-test-20230808-72283-emd4kd/BUILD:3:10: While resolving toolchains for target //:bazel-test: invalid registered toolchain '@go_sdk_toolchains//:go_aix_ppc64': error loading package '@go_sdk_toolchains//': compilation of module 'version.bzl' failed
ERROR: Analysis of target '//:bazel-test' failed; build aborted: 

When you inspect the code, it's the bits parsing the output of the go command's version code.

So, homebrew might need to bump the rules_go version in the ibazel formula tests. Something like:

      http_archive(
        name = "io_bazel_rules_go",
        sha256 = "278b7ff5a826f3dc10f04feaf0b70d48b68748ccd512d7f98bf442077f043fe3",
        urls = [
            "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip",
            "https://github.com/bazelbuild/rules_go/releases/download/v0.41.0/rules_go-v0.41.0.zip",
        ],
      )

@chenrui333
Copy link
Contributor Author

cool, I am gonna try that later, thanks!

@github-actions
Copy link

github-actions bot commented Oct 9, 2023

Stale issue message

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants