Error when trying to build with Mercure
Closed this issue · 5 comments
What happened?
When running the dockerfile instruction below
ENV CGO_ENABLED=1 XCADDY_SETCAP=1 XCADDY_GO_BUILD_FLAGS="-ldflags \"-w -s -extldflags '-Wl,-z,stack-size=0x80000'\""
RUN xcaddy build \
--output /usr/local/bin/frankenphp \
--with github.com/dunglas/frankenphp=./ \
--with github.com/dunglas/frankenphp/caddy=./caddy/ \
--with github.com/dunglas/mercure/caddy \
--with github.com/dunglas/vulcain/caddy
I'm getting the following error:
2024/11/11 13:45:35 [INFO] exec (timeout=0s): /us/local/go/bin/go build -o /us/local/bin/frankenphp -Idflags -w-s -extldflags '-WI,-z,stack-size=0x80000*
# github.com/dgraph-io/badger/v2/table
/root/go/pkg/mod/github.com/dgraph-io/badger/v2@v2.2007.4/table/table.go:79:14: cannot use generic type ristretto.CachelK z.Key, V anyl without instantiation
If I remove the mercure dep, everything is building.
Using buildx to output arm and amd 64 docker image.
Build Type
Docker (Debian Bookworm)
Worker Mode
Yes
Operating System
GNU/Linux
CPU Architecture
x86_64
PHP configuration
None
Relevant log output
No response
Are you using the latest version of Mercure and are you passing the nobadger,nomysql,nopgx
build tags as (recently) explained in the docs?
It's using the latest tag and tried with and without nobadger,nomysql,nopgx
tags as caddy build flags (seen the doc before opening this issue). 😉
Ok I have an idea. Could you try if dunglas/mercure#980 fixes the issue, please?
It's working (and seems the tags nobadger,nomysql,nopgx
are not needed anymore). Thank you, you rock! 👏
Thanks! You should always add the nobadger,nomysql,nopgx
tags as they prevent compiling and shipping useless (in our context) dependencies of a dependency of Caddy (Badger). This reduces the binary size and the attack surface.