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

README example fails to build against matching Caddy version #34

Open
jonahgeorge opened this issue Apr 10, 2024 · 6 comments
Open

README example fails to build against matching Caddy version #34

jonahgeorge opened this issue Apr 10, 2024 · 6 comments

Comments

@jonahgeorge
Copy link

jonahgeorge commented Apr 10, 2024

It appears that trying to compile this module into Caddy using the matching Caddy docker image is not working:

FROM caddy:2.7.6-builder AS builder
ENV XCADDY_SETCAP 0
RUN xcaddy build v2.7.6 --with github.com/tailscale/caddy-tailscale

FROM caddy:2.7.6
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
COPY Caddyfile /etc/caddy/Caddyfile

Results in the following build error:

go: github.com/tailscale/caddy-tailscale@v0.0.0-20240324222951-7b5a952a5b8b requires go >= 1.22.0 (running go 1.21.9; GOTOOLCHAIN=local)

Relates to:


It appears that this commit 0f105e89fbe2222c690b94b5b0b2a8150fa2540f introduces the Go toolchain bump. I was able to get past this by pinning to a specific commit prior to the Go toolchain bump:

FROM caddy:2.7.6-builder AS builder
ENV XCADDY_SETCAP 0
RUN xcaddy build v2.7.6 --with github.com/tailscale/caddy-tailscale@e041e1578ce91ef7d278dcec7e62e5af8362d79e

FROM caddy:2.7.6
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
COPY Caddyfile /etc/caddy/Caddyfile
@willnorris
Copy link
Member

It looks like the toolchain bump got removed in 7b5a952. But caddy-tailscale still requires go1.22, so it won't build on caddy:2.7.6-builder since that only has go1.21. There's not really much we can do about that.

It does look like the caddy 2.8 builder has updated to go1.22, so you could try that now even though 2.8 is still in beta.

@mholt
Copy link
Contributor

mholt commented May 16, 2024

/cc @mohammed90 @francislavoie I thought by downgrading we wouldn't be blocking out plugins but rather allowing the others to build 🤔

@mohammed90
Copy link

mohammed90 commented May 16, 2024

/cc @mohammed90 @francislavoie I thought by downgrading we wouldn't be blocking out plugins but rather allowing the others to build 🤔

Our builder image of 2.7.6 ships with go1.21. The requirement for go1.22 isn't from Caddy; it's caddy-tailscale, so the builder image fails to build it because the plugin requires higher version than installed (in the container).

This isn't on Caddy to act on

@mholt
Copy link
Contributor

mholt commented May 16, 2024

Ah, a Docker thing. Got it.

@francislavoie
Copy link

francislavoie commented May 16, 2024

Well

go 1.22.0
was it necessary to bump to 1.22 in this plugin's go.mod? Does the actual tailscale dependency itself require 1.22?

Anyway yeah, using the 2.8.0-beta.2 builder image is perfectly fine too.

@willnorris
Copy link
Member

Yes, Tailscale pretty much always requires the latest go. We often run betas internally, but don't update our public dependency until stable releases. But we're pretty quick to update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants