pgspider / influxdb_fdw

InfluxDB Foreign Data Wrapper for PostgreSQL.
Other
58 stars 14 forks source link

Compilation with go 1.22 #52

Open antonijakubiak-samsung opened 6 months ago

antonijakubiak-samsung commented 6 months ago

Hi,

Compilation fails with go 1.22.

make USE_PGXS=1 with_llvm=no GO_CLIENT=1
[...]
go build -buildmode=c-archive query.go
query.go:67:2: no required module provides package github.com/influxdata/influxdb1-client/models: go.mod file not found in current directory or any parent directory; see 'go help modules'
query.go:68:2: no required module provides package github.com/influxdata/influxdb1-client/v2: go.mod file not found in current directory or any parent directory; see 'go help modules'
make: *** [Makefile:95: query.a] Error 1

A fix is to add go.mod file.

module github.com/pgspider/influxdb_fdw

go 1.22

require github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c // indirect

Kind regards Antoni Jakubiak

weiting1lee commented 6 months ago

@antonijakubiak-samsung

Thank you for highlighting the issue with Go 1.22. I have confirmed that your suggestion to add a go.mod file is correct. Alternatively, to resolve the problem, I initialized the Go module and added the necessary dependencies with the following commands:

go mod init github.com/pgspider/influxdb_fdw
go get github.com/influxdata/influxdb1-client/v2
go mod tidy

I will consider adding the go.mod file to the repository in the next update. Thanks again for your valuable input.