blueimp / aws-smtp-relay

SMTP server to relay emails via Amazon SES or Amazon Pinpoint using IAM roles.
MIT License
76 stars 34 forks source link

Having trouble building #13

Closed pcolmer closed 4 years ago

pcolmer commented 4 years ago

I'm trying to build aws-smtp-relay from source because I need an Arm-architecture version.

I should start by saying that I know absolutely nothing about go or building software that uses go ... but that may become readily apparent :)

If I clone the git repository and try to build the software, I get these errors:

main.go:11:2: cannot find package "github.com/blueimp/aws-smtp-relay/internal/auth" in any of:
        /usr/lib/go-1.10/src/github.com/blueimp/aws-smtp-relay/internal/auth (from $GOROOT)
        /home/ubuntu/go/src/github.com/blueimp/aws-smtp-relay/internal/auth (from $GOPATH)
main.go:12:2: cannot find package "github.com/blueimp/aws-smtp-relay/internal/relay" in any of:
        /usr/lib/go-1.10/src/github.com/blueimp/aws-smtp-relay/internal/relay (from $GOROOT)
        /home/ubuntu/go/src/github.com/blueimp/aws-smtp-relay/internal/relay (from $GOPATH)
main.go:13:2: cannot find package "github.com/blueimp/aws-smtp-relay/internal/relay/pinpoint" in any of:
        /usr/lib/go-1.10/src/github.com/blueimp/aws-smtp-relay/internal/relay/pinpoint (from $GOROOT)
        /home/ubuntu/go/src/github.com/blueimp/aws-smtp-relay/internal/relay/pinpoint (from $GOPATH)
main.go:14:2: cannot find package "github.com/blueimp/aws-smtp-relay/internal/relay/ses" in any of:
        /usr/lib/go-1.10/src/github.com/blueimp/aws-smtp-relay/internal/relay/ses (from $GOROOT)
        /home/ubuntu/go/src/github.com/blueimp/aws-smtp-relay/internal/relay/ses (from $GOPATH)
main.go:15:2: cannot find package "github.com/mhale/smtpd" in any of:
        /usr/lib/go-1.10/src/github.com/mhale/smtpd (from $GOROOT)
        /home/ubuntu/go/src/github.com/mhale/smtpd (from $GOPATH)

If I then run go get to fetch the missing packages and try again to build the software, I then get these errors:

main.go:11:2: use of internal package not allowed
main.go:12:2: use of internal package not allowed
main.go:13:2: use of internal package not allowed
main.go:14:2: use of internal package not allowed

What steps do I need to take to correctly build the software? Curiously, go get github.com/blueimp/aws-smtp-relay does work but that isn't sufficient for me to be able to build a Docker image that I can then use on an Arm processor.

Thanks.

pcolmer commented 4 years ago

I had the source for aws-smtp-relay in the wrong place. Once it was in /home/ubuntu/go/src/github.com/blueimp, the build worked.

Sorry for the noise

blueimp commented 4 years ago

Hi @pcolmer, thanks for coming back and posting your solution.

For reference, it looks like you have an older Go version installed, one that does not yet support Go modules.

If you upgrade to a version that supports modules, you should be able to build this project from any folder (e.g. I'm developing from a folder which is not in the Go source path on my machine).