foxcpp / maddy

✉️ Composable all-in-one mail server.
https://maddy.email
GNU General Public License v3.0
5.13k stars 249 forks source link

cross compilation error : pq.Error does not implement error (method Error has pointer receiver) #681

Open athoune opened 9 months ago

athoune commented 9 months ago

Describe the bug

Cross compilation error. The error comes from go-imap-sql package.

Steps to reproduce

> git rev-parse --short HEAD
2da4ece
> go version
go version go1.21.7 darwin/amd64
> GOOS=linux GOARCH=arm64 ./build.sh
-- Version: 0.7.1+2da4ece
-- Building main server executable...
# github.com/foxcpp/go-imap-sql
/Users/mlecarme/go/pkg/mod/github.com/foxcpp/go-imap-sql@v0.5.1-0.20240121160244-7f314a0fe78a/errors_noncgo.go:12:18: impossible type assertion: err.(pq.Error)
    pq.Error does not implement error (method Error has pointer receiver)

No error with native compilation. I guess with cross compilation less C stuff is used and the clue is *_noncgo.

Environment information

foxcpp commented 9 months ago

Indeed, looks like I forgot to update non-CGo version of the file. Pushed 1d6cd8c to fix this.

athoune commented 9 months ago

LGTM with 1d6cd8c35f4c4a1279084ae974ecfcf73a426743