age: The Go driver becomes "undefined: parser", and the application cannot be built.

Describe the bug When trying to build an application that uses the Go driver, an error occurs. “undefined: parser” is output by the Go driver.

What data setup do we need to do? What is the necessary configuration info needed? Specify the following version of the Go driver in go.mod.

github.com/apache/age/drivers/golang v0.0.0-20231212232227-0ea118689d78

What is the command that caused the error? Build the application that is using the Go driver.

#0 5.670 # github.com/apache/age/drivers/golang/age
#0 5.670 /go/pkg/mod/github.com/apache/age/drivers/golang@v0.0.0-20231212232227-0ea118689d78/age/builder.go:42:22: undefined: parser.AgeParser
#0 5.670 /go/pkg/mod/github.com/apache/age/drivers/golang@v0.0.0-20231212232227-0ea118689d78/age/builder.go:43:21: undefined: parser.AgeVisitor
#0 5.670 /go/pkg/mod/github.com/apache/age/drivers/golang@v0.0.0-20231212232227-0ea118689d78/age/builder.go:114:9: undefined: parser.AgeVisitor
#0 5.670 /go/pkg/mod/github.com/apache/age/drivers/golang@v0.0.0-20231212232227-0ea118689d78/age/builder.go:129:52: undefined: parser.AgeoutContext
#0 5.670 /go/pkg/mod/github.com/apache/age/drivers/golang@v0.0.0-20231212232227-0ea118689d78/age/builder.go:135:52: undefined: parser.VertexContext
#0 5.670 /go/pkg/mod/github.com/apache/age/drivers/golang@v0.0.0-20231212232227-0ea118689d78/age/builder.go:151:50: undefined: parser.EdgeContext
#0 5.670 /go/pkg/mod/github.com/apache/age/drivers/golang@v0.0.0-20231212232227-0ea118689d78/age/builder.go:164:50: undefined: parser.PathContext
#0 5.670 /go/pkg/mod/github.com/apache/age/drivers/golang@v0.0.0-20231212232227-0ea118689d78/age/builder.go:186:51: undefined: parser.ValueContext
#0 5.670 /go/pkg/mod/github.com/apache/age/drivers/golang@v0.0.0-20231212232227-0ea118689d78/age/builder.go:201:56: undefined: parser.PropertiesContext
#0 5.670 /go/pkg/mod/github.com/apache/age/drivers/golang@v0.0.0-20231212232227-0ea118689d78/age/builder.go:216:50: undefined: parser.PairContext
#0 5.670 /go/pkg/mod/github.com/apache/age/drivers/golang@v0.0.0-20231212232227-0ea118689d78/age/builder.go:216:50: too many errors

Expected behavior The application can be built.

Environment (please complete the following information):

  • golang 1.21.5

Additional context

About this issue

  • Original URL
  • State: closed
  • Created 6 months ago
  • Comments: 33 (16 by maintainers)

Commits related to this issue

Most upvoted comments

Verified on the latest master branch. we can close the issue.

@jrgemignani Thank you for your support.

I will have a team member look at merging #1582

@maehara-n Building requires -

  • Java 11 or higher to be installed.
  • ANTLR 4.11.1 or higher to be installed and included in the CLASSPATH
  • Golang 1.18 or higher to be installed.

As I mentioned, the README.md and associated installer scripts aren’t very good. I have updated the README.md and the install.sh script in PR #1527 to verify that the above conditions are met. However, I have removed the installation of Java, ANTLR, and Golang from install.sh script as this should be done by the system administrator i.e. it is not our responsibility. Currently, I am waiting for that PR to be merged.

Once the above criteria are met, the parser and lexer can be built in the driver/golang/age directory via the install.sh script. The current generate.sh script in that directory generally works, but also needs to be updated or removed.

I think the reason behind this might be broken antlr dependencies, which are ridden with issues such as invalid function signatures and seem pretty low maintenance, so I’ll try discussing ditching these with the project maintainers. I’ve tried using pgx as an alternative but it causes a memory leak while scanning 😞. @maehara-n, did you figure out any temporary solution?