caddy: Building caddy (using xcaddy) with main branch throws an error
Commit that seems to cause this is 798c4a3ba48b55e85867780ed399dc084c15b322 as that’s when google/pprof was added
panic: internal error: can't find reason for requirement on github.com/google/pprof@v0.0.0-20210407192527-94a9f03dee38
Go version: go version go1.19.4 linux/amd64 (Fedora 37) and go version go1.19.5 linux/amd64 (Arch Linux)
Error happens on both distros
2023/01/12 22:07:54 [INFO] Temporary folder: /tmp/buildenv_2023-01-12-2207.4152728799
2023/01/12 22:07:54 [INFO] Writing main module: /tmp/buildenv_2023-01-12-2207.4152728799/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/Odyssey346/ListenCaddy"
)
func main() {
caddycmd.Main()
}
2023/01/12 22:07:54 [INFO] Initializing Go module
2023/01/12 22:07:54 [INFO] exec (timeout=10s): /usr/bin/go mod init caddy
go: creating new go.mod: module caddy
go: to add module requirements and sums:
go mod tidy
2023/01/12 22:07:54 [INFO] Pinning versions
2023/01/12 22:07:54 [INFO] exec (timeout=0s): /usr/bin/go get -d -v -ldflags -w -s -race -strictdups 2 -linkshared -aslr -buildmode=pie -linkmode=external -trimpath github.com/caddyserver/caddy/v2@master
go: downloading github.com/caddyserver/caddy/v2 v2.6.3-0.20230110050823-223cbe3d0b50
go: downloading github.com/caddyserver/caddy v1.0.6-0.20200303163406-891446d06340
go: downloading github.com/lucas-clemente/quic-go v0.31.0
go: downloading golang.org/x/sys v0.1.1-0.20221102194838-fc697a31fa06
go: downloading golang.org/x/term v0.1.0
go: downloading github.com/klauspost/cpuid/v2 v2.1.2
go: downloading golang.org/x/crypto v0.0.0-20221005025214-4161e89ecf1b
go: downloading golang.org/x/net v0.1.0
go: downloading github.com/onsi/ginkgo/v2 v2.2.0
go: downloading github.com/marten-seemann/qpack v0.3.0
go: downloading github.com/prometheus/common v0.33.0
go: downloading google.golang.org/protobuf v1.28.1
go: downloading golang.org/x/tools v0.1.12
go: downloading golang.org/x/text v0.4.0
go: downloading golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4
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.3-0.20230110050823-223cbe3d0b50
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.1.2
go: added github.com/libdns/libdns v0.2.1
go: added github.com/lucas-clemente/quic-go v0.31.0
go: added github.com/marten-seemann/qpack v0.3.0
go: added github.com/marten-seemann/qtls-go1-18 v0.1.3
go: added github.com/marten-seemann/qtls-go1-19 v0.1.1
go: added github.com/matttproud/golang_protobuf_extensions v1.0.1
go: added github.com/mholt/acmez v1.0.4
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.12.2
go: added github.com/prometheus/client_model v0.2.0
go: added github.com/prometheus/common v0.33.0
go: added github.com/prometheus/procfs v0.7.3
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.23.0
go: added golang.org/x/crypto v0.0.0-20221005025214-4161e89ecf1b
go: added golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e
go: added golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4
go: added golang.org/x/net v0.1.0
go: added golang.org/x/sys v0.1.1-0.20221102194838-fc697a31fa06
go: added golang.org/x/term v0.1.0
go: added golang.org/x/text v0.4.0
go: added golang.org/x/tools v0.1.12
go: added google.golang.org/protobuf v1.28.1
2023/01/12 22:08:30 [INFO] exec (timeout=0s): /usr/bin/go get -d -v -ldflags -w -s -race -strictdups 2 -linkshared -aslr -buildmode=pie -linkmode=external -trimpath github.com/Odyssey346/ListenCaddy github.com/caddyserver/caddy/v2@master
go: downloading google.golang.org/genproto v0.0.0-20221027153422-115e99e71e1c
go: downloading github.com/smallstep/certificates v0.23.0
go: downloading go.step.sm/crypto v0.23.1
go: downloading github.com/spf13/cobra v1.6.0
go: downloading github.com/smallstep/nosql v0.5.0
go: downloading go.step.sm/cli-utils v0.7.5
go: downloading go.step.sm/linkedca v0.19.0
go: downloading google.golang.org/grpc v1.50.1
go: downloading github.com/slackhq/nebula v1.6.1
go: downloading github.com/inconshreveable/mousetrap v1.0.1
go: downloading github.com/urfave/cli v1.22.10
go: downloading filippo.io/edwards25519 v1.0.0
go: downloading github.com/jackc/pgx/v4 v4.17.2
go: downloading github.com/rs/xid v1.4.0
go: downloading github.com/sirupsen/logrus v1.9.0
go: downloading github.com/go-logfmt/logfmt v0.5.1
go: downloading github.com/dgraph-io/ristretto v0.1.0
go: downloading github.com/jackc/pgconn v1.13.0
go: downloading github.com/jackc/pgproto3/v2 v2.3.1
go: downloading github.com/jackc/pgtype v1.12.0
go: downloading github.com/golang/glog v1.0.0
panic: internal error: can't find reason for requirement on github.com/google/pprof@v0.0.0-20210407192527-94a9f03dee38
goroutine 1 [running]:
cmd/go/internal/modget.(*resolver).updateBuildList.func1({{0xc000260648?, 0xc0004fcf90?}, {0xc0000366f0?, 0xc0002893b8?}})
/usr/lib/go/src/cmd/go/internal/modget/get.go:1760 +0x114
cmd/go/internal/modget.(*resolver).updateBuildList(0xc000150100, {0xb2e7b0, 0xc00002a0a8}, {0x0, 0x0, 0x0})
/usr/lib/go/src/cmd/go/internal/modget/get.go:1765 +0x597
cmd/go/internal/modget.(*resolver).applyUpgrades(0xc000150100, {0xb2e7b0, 0xc00002a0a8}, {0x0?, 0x2?, 0x472485?})
/usr/lib/go/src/cmd/go/internal/modget/get.go:1312 +0x105
cmd/go/internal/modget.runGet({0xb2e7b0, 0xc00002a0a8}, 0xc000028498?, {0xc000024100, 0x2, 0x2})
/usr/lib/go/src/cmd/go/internal/modget/get.go:351 +0x45e
main.invoke(0xe28fe0, {0xc0000240a0, 0x8, 0x8})
/usr/lib/go/src/cmd/go/main.go:225 +0x34e
main.main()
/usr/lib/go/src/cmd/go/main.go:179 +0x7d1
2023/01/12 22:08:43 [FATAL] exit status 2
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 16 (8 by maintainers)
Commits related to this issue
- temporary workaround for v2.6.3 build issues Addressing: - https://github.com/golang/go/issues/56494#issuecomment-1425022660 - https://github.com/caddy-dns/godaddy/issues/4 - https://github.com/caddy... — committed to timelordx/caddy-dns-acmedns by timelordx a year ago
- Fix build problem caused by dependency bug in go Fix from https://github.com/caddyserver/caddy/issues/5301#issuecomment-1425404341 — committed to kdf-leierkasten/caddy_leierkasten_auth by poettig a year ago
- bump caddy version to 2.6.3 because of https://github.com/caddyserver/caddy/issues/5301 — committed to ueffel/caddy-imagefilter by ueffel a year ago
- Update dependencies to current caddy version (2.6.4) Following up with the discussion in the main caddy project, plugins should update their dependencies to avoid build issues. https://github.com/ca... — committed to zefixlluja/caddy-hetzner-dns by zefixlluja a year ago
- fix build issue related https://github.com/caddyserver/caddy/issues/5301 — committed to y0ug/caddy-mods by y0ug a year ago
- refactor: re-order plugins https://github.com/caddyserver/caddy/issues/5301 — committed to dbrennand/ansible-role-caddy-docker by dbrennand a year ago
@mario-moreira This is very convoluted but I was able to get your build to work with:
Do not ask me why. 🤷♂️
@excid3 @onodera-punpun FYI I’ve figured out that the issue can be fixed by the plugins bumping their Caddy dependency in their
go.modto Caddy v2.6.3 (i.e. latest right now) and runninggo mod tidy. That way, the plugins will sync its dependencies with Caddy’s, and it should resolve the build issues. You’ll have to reach out to the relevant plugin authors to get them to do so.This problem really shouldn’t have happened. Go’s module system is still proving to not be quite robust enough. We keep running into little issues like this and it feels like there’s rarely much we can do.
I did some investigating, that I outlined here https://github.com/golang/go/issues/56494#issuecomment-1425022660. I have no solution right now 😬
@excid3 The caddy-dns modules are independently maintained.
It’s not clear to me which plugins need updating yet. For example,
xcaddy build --with github.com/mholt/caddy-ratelimitworks fine, even though that plugin doesn’t target v2.6.3.No worries, I wasn’t aware this is an upstream bug. Hope this gets solved soon. I even tried Fedora Rawhide but still no luck 😦