Open gonsalvesc opened 2 months ago
What Go version are you using? Make sure you use the latest (not the one shipped by the OS packages).
I am getting the same issue, using go v1.22.2 downloaded from the golang site..
Works:
xcaddy build
Throws error above:
xcaddy build --with github.com/mholt/caddy-dynamicdns
xcaddy build master --with github.com/mholt/caddy-dynamicdns
works. Not sure why at the moment.
I have the same problem when building the latest 2.7.6 with xcaddy inside a Dockerfile:
FROM caddy:2-builder AS builder
RUN xcaddy build \
--with github.com/caddy-dns/linode \
--with github.com/caddy-dns/porkbun \
--with github.com/mholt/caddy-dynamicdns
Running podman build . -t my-caddy:2
fails with:
<...>
2024/04/12 21:24:57 [INFO] Skipping cleanup as requested; leaving folder intact: /tmp/buildenv_2024-04-12-2124.1954777655
2024/04/12 21:24:57 [FATAL] exit status 1
Error: building at STEP "RUN xcaddy build --with github.com/caddy-dns/linode --with github.com/caddy-dns/porkbun --with github.com/mholt/caddy-dynamicdns": while running runtime: exit status 1
I guess that master
and 2.7.6 diverge?
Not really; master is a continuation of 2.7.6, but we tried a new way of tagging 2.7.6 using a minor version branch (2.7) instead of tagging directly from master, which is why I think the Go module tooling is getting confused. (We'll be going back to our regular tagging approach for 2.8.)
My comment above shows a command that works in the meantime.
Understood, I avoided using xcaddy build master
because I thought that the master
branch was unstable.
Thank you for the clarification.
It can be unstable, but typically only for brief periods.
https://github.com/mholt/caddy-dynamicdns/commit/a0a2581345050f0854626c89ab6d4690b6606dd4
My bad the problem is actually that caddy v2.7.6 uses quic 0.40 but caddy master uses quic 0.42. Go when not specifying a version when you go get
, downloads caddy v2.7.6 because that's the latest tag, but it also downloads master caddy-dynamicdns. They are not compatible at the moment because of the quic version conflict.
I did not want to use caddy master so what I did was pin caddy-dynamicdns to before the quic bump.
Dockerfile remedy:
FROM caddy:builder AS builder
WORKDIR /src
COPY main.go main.go
RUN go mod init caddy
RUN go get github.com/mholt/caddy-dynamicdns@f375a7248e67cf3e82b4f61f841424adb4ee958f
RUN go mod tidy
RUN go build -o /usr/bin/caddy .
FROM caddy
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
Recently tried to build Caddy with this module using xcaddy, and it gave a fatal error. I'm using Ubuntu 22.04