google / cel-go

Fast, portable, non-Turing complete expression evaluation with gradual typing (Go)
https://cel.dev
Apache License 2.0
2.3k stars 224 forks source link

Issue importing github.com/google/cel-go #872

Closed yerkortiz closed 11 months ago

yerkortiz commented 11 months ago

Describe the bug My project is unable to build after importing cel-go as a blank import.

To Reproduce Check which components this affects:

Sample expression and input that reproduces the issue:

import _ "github.com/google/cel-go/cel".

Expected behavior Build the program as expected, the program builds correctly without importing cel-go.

Additional context This is the error message that I get when I am testing or running the program.

vendor/github.com/google/cel-go/common/ast/conversion.go:207:38: l.GetOptionalIndices undefined (type *expr.Expr_CreateList has no field or method GetOptionalIndices)
vendor/github.com/google/cel-go/common/ast/conversion.go:402:5: unknown field OptionalIndices in struct literal of type expr.Expr_CreateList

Versions Go 1.19 github.com/google/cel-go v0.18.2

I am unable to reproduce the error importing cel-go in other projects. Therefore, it can be a dependency issue, but I am unsure about which dependency is causing this behavior.

TristonianJones commented 11 months ago

@yerkortiz this might be related to a very old import of googleapis/go-genproto, could you check your dependency graph?

yerkortiz commented 11 months ago

@TristonianJones for sure! In the project, there are three indirect dependencies of gen proto: google.golang.org/genproto/googleapis/rpc@v0.0.0-20230803162519-f966b187b2e5 (from cel-go) google.golang.org/genproto@v0.0.0-20200526211855-cb27e3aa2013 (from a private package) google.golang.org/genproto@v0.0.0-20211118181313-81c1377c94b1 (from github.com/grpc-ecosystem/grpc-gateway/v2@v2.7.0)

This issue is related to the warning here, right?

TristonianJones commented 11 months ago

Yep, that's the exact issue that the warning is describing. I would hazard a guess that an update to a newer version gRPC and the private dependency will fix the issue