Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error #145

Closed
kernelb00t opened this issue Jun 13, 2023 · 10 comments
Closed

Build error #145

kernelb00t opened this issue Jun 13, 2023 · 10 comments
Labels
invalid This doesn't seem right

Comments

@kernelb00t
Copy link

kernelb00t commented Jun 13, 2023

Hey !
Trying to build Caddy with the tailscale module on RPi 4 (RPi OS Bullseye, up-to-date), with xcaddy downloaded from apt. Caddy worked previously by installing it with apt.

I just exec xcaddy build master --with github.com/tailscale/caddy-tailscale, but it fails also when compiling vanilla (xcaddy build and it's the same error)

Here are the logs :

2023/06/13 09:33:38 [INFO] Temporary folder: /tmp/buildenv_2023-06-13-0933.839310816
2023/06/13 09:33:38 [INFO] Writing main module: /tmp/buildenv_2023-06-13-0933.839310816/main.go
package main
import (
        caddycmd "github.com/caddyserver/caddy/v2/cmd"
        // plug in Caddy modules here
        _ "github.com/caddyserver/caddy/v2/modules/standard"
        _ "github.com/tailscale/caddy-tailscale"
)
func main() {
        caddycmd.Main()
}
2023/06/13 09:33:38 [INFO] Initializing Go module
2023/06/13 09:33:38 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/bin/go mod init caddy
go: creating new go.mod: module caddy
2023/06/13 09:33:38 [INFO] Pinning versions
2023/06/13 09:33:38 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/bin/go get -d -v github.com/caddyserver/caddy/v2@master
go: github.com/caddyserver/caddy/v2 master => v2.7.0-beta.1.0.20230612153522-2ddb7171440c
2023/06/13 09:33:44 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/bin/go get -d -v github.com/tailscale/caddy-tailscale github.com/caddyserver/caddy/v2@master
go: github.com/tailscale/caddy-tailscale upgrade => v0.0.0-20230226043552-57178f8d1cb2
2023/06/13 09:33:48 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/bin/go get -d -v
2023/06/13 09:33:51 [INFO] Build environment ready
2023/06/13 09:33:51 [INFO] Building Caddy
2023/06/13 09:33:51 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/bin/go mod tidy -e
flag provided but not defined: -e
usage: go mod tidy [-v]
Run 'go help mod tidy' for details.
2023/06/13 09:33:51 [INFO] Cleaning up temporary folder: /tmp/buildenv_2023-06-13-0933.839310816
2023/06/13 09:33:51 [FATAL] exit status 2
@francislavoie
Copy link
Member

Make sure you're using the latest Go version.

@kernelb00t
Copy link
Author

I think I am, apt update says all packages are up-to-date, and I have golang installed with apt.

@francislavoie
Copy link
Member

Distros usually ship old versions of Go. Make sure you have at least Go 1.20. You may need to install it manually (essentially just download and unzip it).

@mholt
Copy link
Member

mholt commented Jun 13, 2023

Yep, surely an old go version. Maybe we should have xcaddy print it.

@kernelb00t
Copy link
Author

I have go 1.15, you were right. I'll try when I have the time (tomorrow I think).

@francislavoie francislavoie closed this as not planned Won't fix, can't repro, duplicate, stale Jun 13, 2023
@francislavoie francislavoie added the invalid This doesn't seem right label Jun 13, 2023
@kernelb00t
Copy link
Author

Haha, it broke again 😂
Here are the logs :

pi@john:~/temp $ xcaddy
2023/06/15 18:26:01 [INFO] Temporary folder: /tmp/buildenv_2023-06-15-1826.22055553
2023/06/15 18:26:01 [INFO] Writing main module: /tmp/buildenv_2023-06-15-1826.22055553/main.go
package main

import (
        caddycmd "github.com/caddyserver/caddy/v2/cmd"

        // plug in Caddy modules here
        _ "github.com/caddyserver/caddy/v2/modules/standard"
        _ "caddy"
)

func main() {
        caddycmd.Main()
}
2023/06/15 18:26:01 [INFO] Initializing Go module
2023/06/15 18:26:01 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/local/go/bin/go mod init caddy
go: creating new go.mod: module caddy
go: to add module requirements and sums:
        go mod tidy
2023/06/15 18:26:01 [INFO] Replace caddy => /home/pi/temp
2023/06/15 18:26:01 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/local/go/bin/go mod edit -replace caddy=/home/pi/temp
2023/06/15 18:26:01 [INFO] Pinning versions
2023/06/15 18:26:01 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/local/go/bin/go get -d -v github.com/caddyserver/caddy/v2
go: downloading github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38
go: added github.com/beorn7/perks v1.0.1
go: added github.com/caddyserver/caddy/v2 v2.6.4
go: added github.com/caddyserver/certmagic v0.17.2
go: added github.com/cespare/xxhash/v2 v2.1.2
go: added github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0
go: added github.com/golang/mock v1.6.0
go: added github.com/golang/protobuf v1.5.2
go: added github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38
go: added github.com/google/uuid v1.3.0
go: added github.com/klauspost/cpuid/v2 v2.2.3
go: added github.com/libdns/libdns v0.2.1
go: added github.com/matttproud/golang_protobuf_extensions v1.0.1
go: added github.com/mholt/acmez v1.1.0
go: added github.com/miekg/dns v1.1.50
go: added github.com/onsi/ginkgo/v2 v2.2.0
go: added github.com/prometheus/client_golang v1.14.0
go: added github.com/prometheus/client_model v0.3.0
go: added github.com/prometheus/common v0.37.0
go: added github.com/prometheus/procfs v0.8.0
go: added github.com/quic-go/qpack v0.4.0
go: added github.com/quic-go/qtls-go1-18 v0.2.0
go: added github.com/quic-go/qtls-go1-19 v0.2.0
go: added github.com/quic-go/qtls-go1-20 v0.1.0
go: added github.com/quic-go/quic-go v0.32.0
go: added go.uber.org/atomic v1.9.0
go: added go.uber.org/multierr v1.6.0
go: added go.uber.org/zap v1.24.0
go: added golang.org/x/crypto v0.5.0
go: added golang.org/x/exp v0.0.0-20221205204356-47842c84f3db
go: added golang.org/x/mod v0.6.0
go: added golang.org/x/net v0.7.0
go: added golang.org/x/sys v0.5.0
go: added golang.org/x/term v0.5.0
go: added golang.org/x/text v0.7.0
go: added golang.org/x/tools v0.2.0
go: added google.golang.org/protobuf v1.28.1
2023/06/15 18:26:12 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/local/go/bin/go get -d -v
2023/06/15 18:26:25 [INFO] Build environment ready
2023/06/15 18:26:25 [INFO] Building Caddy
2023/06/15 18:26:25 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/local/go/bin/go mod tidy -e
go: downloading github.com/stretchr/testify v1.8.1
go: downloading go.uber.org/goleak v1.1.12
go: downloading github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262
go: downloading github.com/onsi/gomega v1.20.1
go: downloading gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
go: downloading github.com/benbjohnson/clock v1.1.0
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/alecthomas/assert/v2 v2.2.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading github.com/kr/pretty v0.3.1
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/alecthomas/repr v0.2.0
go: downloading github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1
go: downloading github.com/aws/aws-sdk-go v1.44.185
go: downloading cloud.google.com/go/kms v1.8.0
go: downloading github.com/googleapis/gax-go/v2 v2.7.0
go: downloading google.golang.org/api v0.108.0
go: downloading github.com/cockroachdb/apd v1.1.0
go: downloading cloud.google.com/go v0.107.0
go: downloading github.com/gofrs/uuid v4.0.0+incompatible
go: downloading github.com/hexops/gotextdiff v1.0.3
go: downloading github.com/go-stack/stack v1.8.0
go: downloading github.com/kr/text v0.1.0
go: downloading github.com/rogpeppe/go-internal v1.9.0
go: downloading github.com/chzyer/logex v1.1.10
go: downloading github.com/jackc/pgmock v0.0.0-20210724152146-4ad1a8207f65
go: downloading github.com/lib/pq v1.10.2
go: downloading cloud.google.com/go/iam v0.8.0
go: downloading github.com/spaolacci/murmur3 v1.1.0
go: downloading github.com/OneOfOne/xxhash v1.2.2
go: downloading golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783
go: downloading go.opencensus.io v0.24.0
go: downloading cloud.google.com/go/compute/metadata v0.2.3
go: downloading google.golang.org/appengine v1.6.7
go: downloading cloud.google.com/go/compute v1.14.0
go: downloading github.com/googleapis/enterprise-certificate-proxy v0.2.1
2023/06/15 18:27:00 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/local/go/bin/go build -o /home/pi/temp/caddy -ldflags -w -s -trimpath
package caddy
        imports caddy: import cycle not allowed
2023/06/15 18:27:00 [INFO] Cleaning up temporary folder: /tmp/buildenv_2023-06-15-1826.22055553
2023/06/15 18:27:00 [ERROR] exit status 1

@kernelb00t
Copy link
Author

pi@john:~/temp $ go version
go version go1.20.5 linux/arm64

@kernelb00t
Copy link
Author

Same error without module caddy-tailscale.

@francislavoie
Copy link
Member

You're not supposed to run xcaddy with no arguments unless you're trying to build a development build of a plugin you're working on which is in your PWD. You need to use xcaddy build --with ...

@kernelb00t
Copy link
Author

kernelb00t commented Jun 15, 2023

Yes, I realised this too late. It's actually all right, it built without errors without the caddy-tailscale module, but with it it throws an error, so I'll just post an issue there and not forget to read the doc 😅
Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants