Skip to content

Fix nomercure tag usage#2212

Merged
dunglas merged 4 commits intophp:mainfrom
tehmaestro:nomercure-fix
Feb 22, 2026
Merged

Fix nomercure tag usage#2212
dunglas merged 4 commits intophp:mainfrom
tehmaestro:nomercure-fix

Conversation

@tehmaestro
Copy link
Contributor

@tehmaestro tehmaestro commented Feb 21, 2026

  • Fixes nomercure tag build
  • Conditionally addds the mercure route and mercure project import

Fixes #2209

I am by no means a go developer, feel free to use this or not :)

@tehmaestro
Copy link
Contributor Author

tehmaestro commented Feb 21, 2026

I think the tests are failing because of the same reason I was unable to do the build locally.
Seems something changed in caddy v2.11.2 released in the last 24 hours

I had to run my builds with an explicit version v2.10.2

CGO_ENABLED=1 \
XCADDY_GO_BUILD_FLAGS="-ldflags='-w -s' -tags=nobadger,nomysql,nopgx" \
CGO_CFLAGS=$(php-config --includes) \
CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" \
xcaddy build v2.10.2 \
    --output frankenphp \
    --with github.com/dunglas/frankenphp/caddy \
    --with github.com/dunglas/caddy-cbrotli \
    --with github.com/dunglas/frankenphp=$(pwd) \
    --with github.com/dunglas/frankenphp/caddy=$(pwd)/caddy

@@ -0,0 +1,47 @@
//go:build !nomercure
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file name should be mercureroot.go, but I would just go for mercure.go

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for just mercure.go

Copy link
Contributor Author

@tehmaestro tehmaestro Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to do that, but there's already a mercure.go and mercure-skip.go
Wanna put these in the same file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

@@ -0,0 +1,10 @@
//go:build nomercure
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one also just mercure-skip or nomercure.go

@tehmaestro
Copy link
Contributor Author

  • Merge to the same file
  • Rename function to be more relevant?
  • Rebase to pass integration tests

Co-authored-by: Alexander Stecher <[email protected]>
Signed-off-by: tehmaestro <[email protected]>
@dunglas dunglas merged commit c99b6db into php:main Feb 22, 2026
11 checks passed
@dunglas
Copy link
Member

dunglas commented Feb 22, 2026

Thanks!

johanjanssens pushed a commit to johanjanssens/frankenphp that referenced this pull request Feb 26, 2026
- Fixes nomercure tag build
- Conditionally addds the mercure route and mercure project import

Fixes php#2209

I am by no means a go developer, feel free to use this or not :)

---------

Signed-off-by: tehmaestro <[email protected]>
Co-authored-by: Alexander Stecher <[email protected]>
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

Successfully merging this pull request may close these issues.

Snyk high severity issue due to A-GPL license

4 participants