-
Notifications
You must be signed in to change notification settings - Fork 654
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
nogo 1.18/1.19 #3230
Comments
fyi: commit df02d01 is also not working |
which version of org_golang_google_protobuf are you using? |
|
But this belongs to all other packages too: earth-service-example git:(main) ✗ b build //...
INFO: Analyzed 104 targets (0 packages loaded, 0 targets configured).
INFO: Found 104 targets...
ERROR: /private/var/tmp/_bazel_loeffel/4ddf5fe6752b149c847ee673897a36c2/external/org_golang_x_net/context/BUILD.bazel:3:11: GoCompilePkg external/org_golang_x_net/context/context.a failed: (Exit 1): builder failed: error executing command bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/go_sdk/builder compilepkg -sdk external/go_sdk -installsuffix darwin_arm64 -src external/org_golang_x_net/context/context.go -src ... (remaining 29 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
compilepkg: nogo: errors found by nogo during build-time code analysis:
analyzer "asmdecl" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "assign" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "atomicalign" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "bools" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "buildssa" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "buildtag" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "ctrlflow" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "deepequalerrors" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "errorsas" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "httpresponse" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "ifaceassert" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "loopclosure" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "lostcancel" failed: failed prerequisites: ctrlflow@golang.org/x/net/context
analyzer "nilfunc" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "nilness" failed: failed prerequisites: buildssa@golang.org/x/net/context
analyzer "pkgfact" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "printf" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "shadow" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "shift" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "sortslice" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "stdmethods" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "stringintconv" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "testinggoroutine" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "tests" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "unmarshal" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "unsafeptr" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "unusedresult" failed: analysis skipped due to type-checking error: external/org_golang_x_net/context/go17.go:11:2: could not import context (cannot import "context" (unknown iexport format version 2), export data is newer version - update tool)
INFO: Elapsed time: 0,295s, Critical Path: 0,17s
INFO: 11 processes: 10 internal, 1 darwin-sandbox.
FAILED: Build did NOT complete successfully |
|
I found this issue by googling as I was encountering the same issue trying to update to Go version 1.18.4 in the repository for a project I have that's unfortunately more than a bit of a mess. https://github.com/hxtk/yggdrasil/tree/f80750ce6091eb88a914db0bb4ca5a83faf0740a However, I've been unable to reproduce the error in a minimal format thus far. My initial suspicion was that my workspace is somehow broken and this is just a symptom. |
reproducible with: WORKSPACE: load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
http_archive(
name = "io_bazel_rules_go",
sha256 = "16e9fca53ed6bd4ff4ad76facc9b7b651a89db1689a2877d6fd7b82aa824e366",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.34.0/rules_go-v0.34.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.34.0/rules_go-v0.34.0.zip",
],
)
http_archive(
name = "bazel_gazelle",
sha256 = "501deb3d5695ab658e82f6f6f549ba681ea3ca2a5fb7911154b5aa45596183fa",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.26.0/bazel-gazelle-v0.26.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.26.0/bazel-gazelle-v0.26.0.tar.gz",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
load("//:repositories.bzl", "go_repositories")
# gazelle:repository_macro repositories.bzl%go_repositories
go_repositories()
go_rules_dependencies()
go_register_toolchains(
"1.19",
nogo = "@//:nogo",
)
gazelle_dependencies() BUILD.bazel load("@bazel_gazelle//:def.bzl", "gazelle")
load("@io_bazel_rules_go//go:def.bzl", "TOOLS_NOGO", "nogo")
# gazelle:prefix github.com/mindful-hq/spansql-query-builder
gazelle(name = "gazelle")
nogo(
name = "nogo",
config = ":nogo.json",
visibility = ["//visibility:public"],
deps = TOOLS_NOGO + [],
) Output: INFO: Analyzed 4 targets (0 packages loaded, 0 targets configured).
INFO: Found 3 targets and 1 test target...
ERROR: /private/var/tmp/_bazel_loeffel/0ee7f835c562cb606ba891ce059f7c6d/external/com_google_cloud_go/civil/BUILD.bazel:3:11: GoCompilePkg external/com_google_cloud_go/civil/civil.a failed: (Exit 1): builder failed: error executing command bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/go_sdk/builder compilepkg -sdk external/go_sdk -installsuffix darwin_arm64 -src external/com_google_cloud_go/civil/civil.go -embedroot '' ... (remaining 20 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
compilepkg: nogo: errors found by nogo during build-time code analysis:
analyzer "asmdecl" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "assign" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "atomicalign" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "bools" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "buildssa" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "buildtag" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "ctrlflow" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "deepequalerrors" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "errorsas" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "httpresponse" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "ifaceassert" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "loopclosure" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "lostcancel" failed: failed prerequisites: ctrlflow@cloud.google.com/go/civil
analyzer "nilfunc" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "nilness" failed: failed prerequisites: buildssa@cloud.google.com/go/civil
analyzer "pkgfact" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "printf" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "shadow" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "shift" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "sortslice" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "stdmethods" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "stringintconv" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "testinggoroutine" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "tests" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "unmarshal" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "unsafeptr" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "unusedresult" failed: analysis skipped due to type-checking error: external/com_google_cloud_go/civil/civil.go:25:2: could not import fmt (cannot import "fmt" (unknown iexport format version 2), export data is newer version - update tool)
ERROR: /private/var/tmp/_bazel_loeffel/0ee7f835c562cb606ba891ce059f7c6d/external/com_github_pmezard_go_difflib/difflib/BUILD.bazel:3:11: GoCompilePkg external/com_github_pmezard_go_difflib/difflib/difflib.a failed: (Exit 1): builder failed: error executing command bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/external/go_sdk/builder compilepkg -sdk external/go_sdk -installsuffix darwin_arm64 -src external/com_github_pmezard_go_difflib/difflib/difflib.go ... (remaining 22 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
compilepkg: nogo: errors found by nogo during build-time code analysis:
analyzer "asmdecl" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "assign" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "atomicalign" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "bools" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "buildssa" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "buildtag" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "ctrlflow" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "deepequalerrors" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "errorsas" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "httpresponse" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "ifaceassert" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "loopclosure" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "lostcancel" failed: failed prerequisites: ctrlflow@github.com/pmezard/go-difflib/difflib
analyzer "nilfunc" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "nilness" failed: failed prerequisites: buildssa@github.com/pmezard/go-difflib/difflib
analyzer "pkgfact" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "printf" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "shadow" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "shift" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "sortslice" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "stdmethods" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "stringintconv" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "testinggoroutine" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "tests" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "unmarshal" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "unsafeptr" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool)
analyzer "unusedresult" failed: analysis skipped due to type-checking error: external/com_github_pmezard_go_difflib/difflib/difflib.go:19:2: could not import bufio (cannot import "bufio" (unknown iexport format version 2), export data is newer version - update tool) |
In your example you reference two files: |
I can replicate the same issue in many of our repos. The only reliable way of making things work for me is to force-require latest stable x/tools. If I put
into my go.mod file and then update gazelle repos, things work as expected. I would be lying if I would say that I know why this fixes isses (I am not really a go dev, just a poor infra/CI/CD engineer tasked with keeping CI pipelines green after upgrade to go 1.18). I hope this helps. |
works! 🚀 |
Works for me as well. It is certainly the case that rules_go/go/tools/builders/nogo_main.go Lines 41 to 43 in efc3212
It gets declared here, using a recent enough version that our builds would work if we were using it: rules_go/go/private/repositories.bzl Lines 64 to 83 in ff92842
It appears the issue is that somewhere in our repositories we are overriding it with an older version, probably via some indirect dependency. I'm not sure how |
I also think this is the way to go. Just surfacing the information from the #3175 (the Updated dependencies section) would help a lot. |
Can close? |
What version of rules_go are you using?
v0.33.0
What version of gazelle are you using?
v0.26.0
What version of Bazel are you using?
v5.2.0
Does this issue reproduce with the latest releases of all the above?
Y
What operating system and processor architecture are you using?
Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000
What did you do?
nogo is working with the current config and
gov1.17.11
:switching to
gov1.18.3
results in:is there any information about that? would like to use go1.18.x
Thanks
The text was updated successfully, but these errors were encountered: