rules_go icon indicating copy to clipboard operation
rules_go copied to clipboard

Rules_go 0.47.0 downgraded the gomock dependency from 1.7.0-rc1 to 1.6.0, which broke support for generics in mocks

Open andersbach-dp opened this issue 1 year ago • 1 comments

What version of rules_go are you using?

0.47.0

What version of gazelle are you using?

0.36.0

What version of Bazel are you using?

6.5.0

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

Mocks using generics are broken, as the gomock lib downgrade has no support for generics.

What operating system and processor architecture are you using?

Linux amd64, Darwin arm64

What did you do?

We have several mocks generated from cloud provider interfaces using generics, which with the latest rules_go fail as gomock 1.6.0 can not handle generics correctly.

What did you expect to see?

Mocks generated under rules_go 0.46.0 worked as expected.

What did you see instead?

A error message failed parsing returns: don't know how to parse type *ast.IndexExpr

andersbach-dp avatar May 02 '24 08:05 andersbach-dp

CC @tyler-french

@andersbach-dp You should be able to work around this by adding your own repository for gomock in WORKSPACE before invoking rules_go's dependency macro. In the mid- to long-term, I would strongly recommend switching to MODULE.bazel, which prevents issues like this thanks to proper version resolution.

fmeum avatar May 02 '24 10:05 fmeum