Closed text01001 closed 5 months ago
Works just fine for me. Make sure you're using the latest Go version.
$ xcaddy build master
2024/03/18 10:46:42 [INFO] Temporary folder: /tmp/buildenv_2024-03-18-1046.651728473
2024/03/18 10:46:42 [INFO] Writing main module: /tmp/buildenv_2024-03-18-1046.651728473/main.go
package main
import (
caddycmd "github.com/caddyserver/caddy/v2/cmd"
// plug in Caddy modules here
_ "github.com/caddyserver/caddy/v2/modules/standard"
)
func main() {
caddycmd.Main()
}
2024/03/18 10:46:42 [INFO] Initializing Go module
2024/03/18 10:46:42 [INFO] exec (timeout=0s): /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
2024/03/18 10:46:42 [INFO] Pinning versions
2024/03/18 10:46:42 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/caddyserver/caddy/v2@master
go: downloading github.com/caddyserver/caddy/v2 v2.7.6-0.20240318040725-a9768d2fdefe
go: added github.com/beorn7/perks v1.0.1
go: added github.com/caddyserver/caddy/v2 v2.7.6-0.20240318040725-a9768d2fdefe
go: added github.com/caddyserver/certmagic v0.20.0
go: added github.com/cespare/xxhash/v2 v2.2.0
go: added github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572
go: added github.com/google/pprof v0.0.0-20231212022811-ec68065c825e
go: added github.com/google/uuid v1.3.1
go: added github.com/klauspost/cpuid/v2 v2.2.5
go: added github.com/libdns/libdns v0.2.1
go: added github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0
go: added github.com/mholt/acmez v1.2.0
go: added github.com/miekg/dns v1.1.55
go: added github.com/onsi/ginkgo/v2 v2.13.2
go: added github.com/prometheus/client_golang v1.18.0
go: added github.com/prometheus/client_model v0.5.0
go: added github.com/prometheus/common v0.45.0
go: added github.com/prometheus/procfs v0.12.0
go: added github.com/quic-go/qpack v0.4.0
go: added github.com/quic-go/quic-go v0.41.0
go: added github.com/zeebo/blake3 v0.2.3
go: added go.uber.org/mock v0.3.0
go: added go.uber.org/multierr v1.11.0
go: added go.uber.org/zap v1.26.0
go: added go.uber.org/zap/exp v0.2.0
go: added golang.org/x/crypto v0.20.0
go: added golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611
go: added golang.org/x/mod v0.14.0
go: added golang.org/x/net v0.21.0
go: added golang.org/x/sys v0.17.0
go: added golang.org/x/term v0.17.0
go: added golang.org/x/text v0.14.0
go: added golang.org/x/tools v0.16.1
go: added google.golang.org/protobuf v1.33.0
2024/03/18 10:46:56 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v
2024/03/18 10:46:58 [INFO] Build environment ready
2024/03/18 10:46:58 [INFO] Building Caddy
2024/03/18 10:46:58 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy -e
2024/03/18 10:46:58 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o caddy -ldflags -w -s -trimpath
2024/03/18 10:47:34 [INFO] Build complete: ./caddy
2024/03/18 10:47:34 [INFO] Cleaning up temporary folder: /tmp/buildenv_2024-03-18-1046.651
root@test:~# go version
go version go1.22.1 linux/amd64
root@test:~# xcaddy version
v0.3.5 h1:XyC3clncb2Q3gTQC6hOJerRt3FS9+vAljW1f8jlryZA=
root@test:~# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GOAMD64=v2 xcaddy build a9768d2fdefeae8050f1d328e7133e312acd253f --output /var/local/filebrowser/upx/caddy_upx/caddy-linux-amd64--a9768d2 --with github.com/mholt/caddy-webdav --with github.com/mholt/caddy-events-exec --with github.com/caddyserver/forwardproxy@caddy2=github.com/klzgrad/forwardproxy@naive --with github.com/WeidiDeng/caddy-cloudflare-ip --with github.com/imgk/caddy-trojan --with github.com/mholt/caddy-dynamicdns --with github.com/caddy-dns/cloudflare
2024/03/19 23:47:08 [INFO] Temporary folder: /tmp/buildenv_2024-03-19-2347.1459381360
2024/03/19 23:47:08 [INFO] Writing main module: /tmp/buildenv_2024-03-19-2347.1459381360/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/mholt/caddy-webdav"
_ "github.com/mholt/caddy-events-exec"
_ "github.com/caddyserver/forwardproxy"
_ "github.com/WeidiDeng/caddy-cloudflare-ip"
_ "github.com/imgk/caddy-trojan"
_ "github.com/mholt/caddy-dynamicdns"
_ "github.com/caddy-dns/cloudflare"
)
func main() {
caddycmd.Main()
}
2024/03/19 23:47:08 [INFO] Initializing Go module
2024/03/19 23:47:08 [INFO] exec (timeout=0s): /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
2024/03/19 23:47:08 [INFO] Replace github.com/caddyserver/forwardproxy => github.com/klzgrad/forwardproxy@naive
2024/03/19 23:47:08 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod edit -replace github.com/caddyserver/forwardproxy=github.com/klzgrad/forwardproxy@naive
2024/03/19 23:47:08 [INFO] Pinning versions
2024/03/19 23:47:08 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/caddyserver/caddy/v2@a9768d2fdefeae8050f1d328e7133e312acd253f
go: added github.com/beorn7/perks v1.0.1
go: added github.com/caddyserver/caddy/v2 v2.7.6-0.20240318040725-a9768d2fdefe
go: added github.com/caddyserver/certmagic v0.20.0
go: added github.com/cespare/xxhash/v2 v2.2.0
go: added github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572
go: added github.com/google/pprof v0.0.0-20231212022811-ec68065c825e
go: added github.com/google/uuid v1.3.1
go: added github.com/klauspost/cpuid/v2 v2.2.5
go: added github.com/libdns/libdns v0.2.1
go: added github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0
go: added github.com/mholt/acmez v1.2.0
go: added github.com/miekg/dns v1.1.55
go: added github.com/onsi/ginkgo/v2 v2.13.2
go: added github.com/prometheus/client_golang v1.18.0
go: added github.com/prometheus/client_model v0.5.0
go: added github.com/prometheus/common v0.45.0
go: added github.com/prometheus/procfs v0.12.0
go: added github.com/quic-go/qpack v0.4.0
go: added github.com/quic-go/quic-go v0.41.0
go: added github.com/zeebo/blake3 v0.2.3
go: added go.uber.org/mock v0.3.0
go: added go.uber.org/multierr v1.11.0
go: added go.uber.org/zap v1.26.0
go: added go.uber.org/zap/exp v0.2.0
go: added golang.org/x/crypto v0.20.0
go: added golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611
go: added golang.org/x/mod v0.14.0
go: added golang.org/x/net v0.21.0
go: added golang.org/x/sys v0.17.0
go: added golang.org/x/term v0.17.0
go: added golang.org/x/text v0.14.0
go: added golang.org/x/tools v0.16.1
go: added google.golang.org/protobuf v1.33.0
2024/03/19 23:47:10 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/mholt/caddy-webdav github.com/caddyserver/caddy/v2@a9768d2fdefeae8050f1d328e7133e312acd253f
go: added github.com/mholt/caddy-webdav v0.0.0-20231121214849-5e0e1179b5b2
2024/03/19 23:47:17 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/mholt/caddy-events-exec github.com/caddyserver/caddy/v2@a9768d2fdefeae8050f1d328e7133e312acd253f
go: added github.com/mholt/caddy-events-exec v0.0.0-20231121214933-055bfd2e8b82
2024/03/19 23:47:18 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/WeidiDeng/caddy-cloudflare-ip github.com/caddyserver/caddy/v2@a9768d2fdefeae8050f1d328e7133e312acd253f
go: added github.com/WeidiDeng/caddy-cloudflare-ip v0.0.0-20231130002422-f53b62aa13cb
2024/03/19 23:47:28 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/imgk/caddy-trojan github.com/caddyserver/caddy/v2@a9768d2fdefeae8050f1d328e7133e312acd253f
go: upgraded github.com/gorilla/websocket v1.4.2 => v1.5.0
go: added github.com/imgk/caddy-trojan v0.0.0-20230816233042-b1603cd5c50f
go: added github.com/imgk/memory-go v0.0.0-20220328012817-37cdd311f1a3
2024/03/19 23:47:32 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/mholt/caddy-dynamicdns github.com/caddyserver/caddy/v2@a9768d2fdefeae8050f1d328e7133e312acd253f
go: added github.com/mholt/caddy-dynamicdns v0.0.0-20240314152952-f68ffe15a1f9
go: added gitlab.com/NebulousLabs/fastrand v0.0.0-20181126182046-603482d69e40
go: added gitlab.com/NebulousLabs/go-upnp v0.0.0-20211002182029-11da932010b6
2024/03/19 23:47:36 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/caddy-dns/cloudflare github.com/caddyserver/caddy/v2@a9768d2fdefeae8050f1d328e7133e312acd253f
go: added github.com/caddy-dns/cloudflare v0.0.0-20240206200437-2fa0c8ac916a
go: added github.com/libdns/cloudflare v0.1.0
2024/03/19 23:47:39 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v
go: trying upgrade to github.com/caddyserver/forwardproxy@v0.0.0-20240314124830-ec0619230bc0
go: accepting indirect upgrade from github.com/caddyserver/caddy/v2@v2.7.6-0.20240318040725-a9768d2fdefe to v2.7.6
go: accepting indirect upgrade from github.com/miekg/dns@v1.1.55 to v1.1.56
go: upgraded github.com/caddyserver/caddy/v2 v2.7.6-0.20240318040725-a9768d2fdefe => v2.7.6
go: added github.com/caddyserver/forwardproxy v0.0.0-20240314124830-ec0619230bc0
go: added github.com/mastercactapus/proxyprotocol v0.0.4
go: upgraded github.com/miekg/dns v1.1.55 => v1.1.56
2024/03/19 23:47:47 [INFO] Build environment ready
2024/03/19 23:47:47 [INFO] Building Caddy
2024/03/19 23:47:47 [INFO] exec (timeout=0s): /usr/local/go/bin/go mod tidy -e
2024/03/19 23:47:49 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /var/local/filebrowser/upx/caddy_upx/caddy-linux-amd64--a9768d2 -ldflags -w -s -trimpath
# github.com/caddyserver/caddy/v2/modules/caddyhttp
/root/gopath/pkg/mod/github.com/caddyserver/caddy/v2@v2.7.6/modules/caddyhttp/celmatcher.go:462:9: cannot use func(eh parser.ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) {…} (value of type func(eh parser.ExprHelper, target *expr.Expr, args []*expr.Expr) (*expr.Expr, *common.Error)) as parser.MacroExpander value in return statement
/root/gopath/pkg/mod/github.com/caddyserver/caddy/v2@v2.7.6/modules/caddyhttp/celmatcher.go:479:13: eh.GlobalCall undefined (type parser.ExprHelper has no field or method GlobalCall)
/root/gopath/pkg/mod/github.com/caddyserver/caddy/v2@v2.7.6/modules/caddyhttp/celmatcher.go:479:37: eh.Ident undefined (type parser.ExprHelper has no field or method Ident)
/root/gopath/pkg/mod/github.com/caddyserver/caddy/v2@v2.7.6/modules/caddyhttp/celmatcher.go:479:66: cannot use matchArgs (variable of type []*expr.Expr) as []ast.Expr value in argument to eh.NewList
/root/gopath/pkg/mod/github.com/caddyserver/caddy/v2@v2.7.6/modules/caddyhttp/celmatcher.go:488:9: cannot use func(eh parser.ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) {…} (value of type func(eh parser.ExprHelper, target *expr.Expr, args []*expr.Expr) (*expr.Expr, *common.Error)) as parser.MacroExpander value in return statement
/root/gopath/pkg/mod/github.com/caddyserver/caddy/v2@v2.7.6/modules/caddyhttp/celmatcher.go:495:14: eh.GlobalCall undefined (type parser.ExprHelper has no field or method GlobalCall)
/root/gopath/pkg/mod/github.com/caddyserver/caddy/v2@v2.7.6/modules/caddyhttp/celmatcher.go:495:38: eh.Ident undefined (type parser.ExprHelper has no field or method Ident)
/root/gopath/pkg/mod/github.com/caddyserver/caddy/v2@v2.7.6/modules/caddyhttp/celmatcher.go:509:9: cannot use func(eh parser.ExprHelper, target *exprpb.Expr, args []*exprpb.Expr) (*exprpb.Expr, *common.Error) {…} (value of type func(eh parser.ExprHelper, target *expr.Expr, args []*expr.Expr) (*expr.Expr, *common.Error)) as parser.MacroExpander value in return statement
/root/gopath/pkg/mod/github.com/caddyserver/caddy/v2@v2.7.6/modules/caddyhttp/celmatcher.go:545:14: eh.GlobalCall undefined (type parser.ExprHelper has no field or method GlobalCall)
/root/gopath/pkg/mod/github.com/caddyserver/caddy/v2@v2.7.6/modules/caddyhttp/celmatcher.go:545:38: eh.Ident undefined (type parser.ExprHelper has no field or method Ident)
/root/gopath/pkg/mod/github.com/caddyserver/caddy/v2@v2.7.6/modules/caddyhttp/celmatcher.go:545:38: too many errors
2024/03/19 23:47:55 [INFO] Cleaning up temporary folder: /tmp/buildenv_2024-03-19-2347.1459381360
2024/03/19 23:47:55 [FATAL] exit status 1
Please help me take a look, I don't know why it can't compile successfully
@francislavoie There is a more detailed log, please help to see.
Start with no plugins, then add one at a time until it stops working. Then you'll know which plugin is the problem. That plugin will need an update to be compatible with the new version of Caddy.
Error message:
The failure to compile started from this commit https://github.com/caddyserver/caddy/commit/52822a41cb94fcc9669cd7ba8ac1a0513e4d55f9