rules_go icon indicating copy to clipboard operation
rules_go copied to clipboard

Was compiled with... but was linked with...

Open teivah opened this issue 2 years ago • 1 comments

What version of rules_go are you using?

0.40.0

What version of gazelle are you using?

0.31.1

What version of Bazel are you using?

6.1.2

Does this issue reproduce with the latest releases of all the above?

Yes

What operating system and processor architecture are you using?

Mac OS / M!

Any other potentially useful information about your toolchain?

What did you do?

Repo: https://github.com/teivah/enola, branch: web.

Building a Go project being a gRPC client. The proto rule is described here and contains a dependency to any_proto (as the proto imports) google/protobuf/any.proto. Yet, it seems to cause a conflict.

The problem occurs when running the following command:

bazelisk run --verbose_failures //web/ui-go

What did you expect to see?

Success

What did you see instead?

link: package conflict error: google.golang.org/protobuf/types/known/anypb: package imports google.golang.org/protobuf/proto
          was compiled with: @@gazelle~0.31.1~go_deps~org_golang_google_protobuf//proto:proto
        but was linked with: @@org_golang_google_protobuf//proto:proto
See https://github.com/bazelbuild/rules_go/issues/1877.
Target //web/ui-go:ui-go failed to build
INFO: Elapsed time: 35.709s, Critical Path: 1.04s
INFO: 2 processes: 2 internal.
FAILED: Build did NOT complete successfully
ERROR: Build failed. Not running target

Additional notes

I tried delving into the issue referenced but without success.

teivah avatar Jun 26 '23 07:06 teivah

Has anyone had a chance to look at this? I am seeing a similar issue right now and would love a hint on what the misaligment may be. Using rules_go 0.40.1 and gazelle 0.33.0.

dbernadett avatar Apr 03 '24 22:04 dbernadett