From c653c76c05e397c1b19b92bb94a119c6bd21ef3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Thu, 26 Feb 2026 15:41:48 +0100 Subject: [PATCH 01/13] docs: contributing on Windows --- .github/workflows/windows.yaml | 4 +-- CONTRIBUTING.md | 61 ++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index bba4a8402..b6bde9313 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -217,7 +217,7 @@ jobs: "opcache.enable=0`r`nopcache.enable_cli=0" | Out-File php.ini $env:PHPRC = Get-Location - go test ./... + go -race test ./... cd caddy - go test ./... + go -race test ./... working-directory: ${{ github.workspace }}\frankenphp diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 73d8b19ab..c67f998bd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -86,6 +86,67 @@ The server is listening on `127.0.0.1:8080`: curl -v http://127.0.0.1:8080/phpinfo.php ``` +## Windows development + +1. Configure Git to always use `lf` line endings + ```powershell + git config --global core.autocrlf false + git config --global core.eol lf + ``` +2. Install Visual Studio, Git and Go: + ```powershell + winget install -e --id Microsoft.VisualStudio.2022.Community --override "--passive --wait --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.Llvm.Clang --includeRecommended" + winget install -e --id GoLang.Go --id Git.Git + ``` + +3. Install vcpkg: + ```powershell + cd c:\ + gh repo clone microsoft/vcpkg + .\vcpkg\bootstrap-vcpkg.bat + ``` + +4. [Download the latest version of the watcher library for Windows](https://github.com/e-dant/watcher/releases) and extract it in a directory named `C:\watcher` +5. [Download the latest **Thread Safe** version of PHP and of the PHP SDK for Windows](https://windows.php.net/download/), extract them in directories named `C:\php` and `C:\php-devel` +6. Clone the FrankenPHP Git repository: + ```powershell + git clone https://github.com/php/frankenphp C:\frankenphp + cd C:\frankenphp + ``` + +7. Install the dependencies: + ```powershell + vcpkg install + ``` + +8. Configure the needed environment variables (PowerShell): + + ```powershell + $env:PATH += ';C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\bin' + $env:GOTOOLCHAIN = 'go1.26rc1' + $env:CC = 'clang' + $env:CXX = 'clang++' + $env:CGO_CFLAGS = "-IC:\frankenphp\vcpkg_installed\x64-windows\include -IC:\watcher-x86_64-pc-windows-msvc -IC:\php-8.5.1-devel-vs17-x64\include -IC:\php-8.5.1-devel-vs17-x64\include\main -IC:\php-8.5.1-devel-vs17-x64\include\TSRM -IC:\php-8.5.1-devel-vs17-x64\include\Zend -IC:\php-8.5.1-devel-vs17-x64\include\ext" + $env:CGO_LDFLAGS = '-LC:\vcpkg\installed\x64-windows\lib -lbrotlienc -LC:\watcher-x86_64-pc-windows-msvc -llibwatcher-c -LC:\php-8.5.1-Win32-vs17-x64 -LC:\php-8.5.1-devel-vs17-x64\lib -lphp8ts -lphp8embed' + ``` + +8. Run the tests: + + ```powershell + go test -ldflags '-extldflags="-fuse-ld=lld"' ./... + cd caddy + go test -ldflags '-extldflags="-fuse-ld=lld"' -tags nobadger,nomysql,nopgx ./... + cd .. + ``` + +10. Build the binary: + + ```powershell + cd caddy/frankenphp + go build -ldflags '-extldflags="-fuse-ld=lld"' -tags nobadger,nomysql,nopgx + cd ../.. + ``` + ## Building Docker Images Locally Print bake plan: From 3a0697471ac1ca6fd6fc4dd9e572bbe679e5dfa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 2 Mar 2026 18:33:39 +0100 Subject: [PATCH 02/13] fix php and php-dev paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Correct grammar and punctuation throughout the document. Signed-off-by: Kévin Dunglas --- CONTRIBUTING.md | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c67f998bd..2c7c11733 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,7 +17,7 @@ The image contains the usual development tools (Go, GDB, Valgrind, Neovim...) an - additional configuration files: `/etc/frankenphp/php.d/*.ini` - php extensions: `/usr/lib/frankenphp/modules/` -If your Docker version is lower than 23.0, the build will fail due to dockerignore [pattern issue](https://github.com/moby/moby/pull/42676). Add directories to `.dockerignore`. +If your Docker version is lower than 23.0, the build will fail due to dockerignore [pattern issue](https://github.com/moby/moby/pull/42676). Add directories to `.dockerignore`: ```patch !testdata/*.php @@ -93,7 +93,7 @@ curl -v http://127.0.0.1:8080/phpinfo.php git config --global core.autocrlf false git config --global core.eol lf ``` -2. Install Visual Studio, Git and Go: +2. Install Visual Studio, Git, and Go: ```powershell winget install -e --id Microsoft.VisualStudio.2022.Community --override "--passive --wait --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.Llvm.Clang --includeRecommended" winget install -e --id GoLang.Go --id Git.Git @@ -106,7 +106,7 @@ curl -v http://127.0.0.1:8080/phpinfo.php .\vcpkg\bootstrap-vcpkg.bat ``` -4. [Download the latest version of the watcher library for Windows](https://github.com/e-dant/watcher/releases) and extract it in a directory named `C:\watcher` +4. [Download the latest version of the watcher library for Windows](https://github.com/e-dant/watcher/releases) and extract it to a directory named `C:\watcher` 5. [Download the latest **Thread Safe** version of PHP and of the PHP SDK for Windows](https://windows.php.net/download/), extract them in directories named `C:\php` and `C:\php-devel` 6. Clone the FrankenPHP Git repository: ```powershell @@ -123,19 +123,18 @@ curl -v http://127.0.0.1:8080/phpinfo.php ```powershell $env:PATH += ';C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\bin' - $env:GOTOOLCHAIN = 'go1.26rc1' $env:CC = 'clang' $env:CXX = 'clang++' - $env:CGO_CFLAGS = "-IC:\frankenphp\vcpkg_installed\x64-windows\include -IC:\watcher-x86_64-pc-windows-msvc -IC:\php-8.5.1-devel-vs17-x64\include -IC:\php-8.5.1-devel-vs17-x64\include\main -IC:\php-8.5.1-devel-vs17-x64\include\TSRM -IC:\php-8.5.1-devel-vs17-x64\include\Zend -IC:\php-8.5.1-devel-vs17-x64\include\ext" - $env:CGO_LDFLAGS = '-LC:\vcpkg\installed\x64-windows\lib -lbrotlienc -LC:\watcher-x86_64-pc-windows-msvc -llibwatcher-c -LC:\php-8.5.1-Win32-vs17-x64 -LC:\php-8.5.1-devel-vs17-x64\lib -lphp8ts -lphp8embed' + $env:CGO_CFLAGS = "-IC:\frankenphp\vcpkg_installed\x64-windows\include -IC:\watcher-x86_64-pc-windows-msvc -IC:\php-devel\include -IC:\php-devel\include\main -IC:\php-devel-vs17-x64\include\TSRM -IC:\php-devel\include\Zend -IC:\php-devel\include\ext" + $env:CGO_LDFLAGS = '-LC:\vcpkg\installed\x64-windows\lib -lbrotlienc -LC:\watcher-x86_64-pc-windows-msvc -llibwatcher-c -LC:\php -LC:\php-devel\lib -lphp8ts -lphp8embed' ``` 8. Run the tests: ```powershell - go test -ldflags '-extldflags="-fuse-ld=lld"' ./... + go test -race -ldflags '-extldflags="-fuse-ld=lld"' ./... cd caddy - go test -ldflags '-extldflags="-fuse-ld=lld"' -tags nobadger,nomysql,nopgx ./... + go test -race -ldflags '-extldflags="-fuse-ld=lld"' -tags nobadger,nomysql,nopgx ./... cd .. ``` @@ -149,7 +148,7 @@ curl -v http://127.0.0.1:8080/phpinfo.php ## Building Docker Images Locally -Print bake plan: +Print Bake plan: ```console docker buildx bake -f docker-bake.hcl --print @@ -186,7 +185,7 @@ docker buildx bake -f docker-bake.hcl --pull --no-cache --push docker cp $(docker create --name static-builder-musl dunglas/frankenphp:static-builder-musl):/go/src/app/dist/frankenphp-linux-$(uname -m) frankenphp ``` -2. Replace your current version of `frankenphp` by the debug FrankenPHP executable +2. Replace your current version of `frankenphp` with the debug FrankenPHP executable 3. Start FrankenPHP as usual (alternatively, you can directly start FrankenPHP with GDB: `gdb --args frankenphp run`) 4. Attach to the process with GDB: @@ -268,7 +267,7 @@ strace -e 'trace=!futex,epoll_ctl,epoll_pwait,tgkill,rt_sigreturn' -p 1 ## Translating the Documentation -To translate the documentation and the site in a new language, +To translate the documentation and the site into a new language, follow these steps: 1. Create a new directory named with the language's 2-character ISO code in this repository's `docs/` directory @@ -276,6 +275,6 @@ follow these steps: 3. Copy the `README.md` and `CONTRIBUTING.md` files from the root directory to the new directory 4. Translate the content of the files, but don't change the filenames, also don't translate strings starting with `> [!` (it's special markup for GitHub) 5. Create a Pull Request with the translations -6. In the [site repository](https://github.com/dunglas/frankenphp-website/tree/main), copy and translate the translation files in the `content/`, `data/` and `i18n/` directories +6. In the [site repository](https://github.com/dunglas/frankenphp-website/tree/main), copy and translate the translation files in the `content/`, `data/`, and `i18n/` directories 7. Translate the values in the created YAML file 8. Open a Pull Request on the site repository From ede6a09e794bfa79ea6a9921658f13ed85579196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 2 Mar 2026 18:35:14 +0100 Subject: [PATCH 03/13] Fix formatting and clarify Docker instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated formatting and instructions for Docker and Windows development. Signed-off-by: Kévin Dunglas --- CONTRIBUTING.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2c7c11733..34df4102f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -57,7 +57,7 @@ cd testdata/ The server is listening on `127.0.0.1:80`: > [!NOTE] -> if you are using Docker, you will have to either bind container port 80 or execute from inside the container +> If you are using Docker, you will have to either bind container port 80 or execute from inside the container ```console curl -vk http://127.0.0.1/phpinfo.php @@ -89,11 +89,13 @@ curl -v http://127.0.0.1:8080/phpinfo.php ## Windows development 1. Configure Git to always use `lf` line endings + ```powershell git config --global core.autocrlf false git config --global core.eol lf ``` 2. Install Visual Studio, Git, and Go: + ```powershell winget install -e --id Microsoft.VisualStudio.2022.Community --override "--passive --wait --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.Llvm.Clang --includeRecommended" winget install -e --id GoLang.Go --id Git.Git @@ -109,12 +111,14 @@ curl -v http://127.0.0.1:8080/phpinfo.php 4. [Download the latest version of the watcher library for Windows](https://github.com/e-dant/watcher/releases) and extract it to a directory named `C:\watcher` 5. [Download the latest **Thread Safe** version of PHP and of the PHP SDK for Windows](https://windows.php.net/download/), extract them in directories named `C:\php` and `C:\php-devel` 6. Clone the FrankenPHP Git repository: + ```powershell git clone https://github.com/php/frankenphp C:\frankenphp cd C:\frankenphp ``` 7. Install the dependencies: + ```powershell vcpkg install ``` From 58c3d026e1956e15ff3e5d2f87e8dd62719355a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 2 Mar 2026 18:35:58 +0100 Subject: [PATCH 04/13] Update CONTRIBUTING.md with installation instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added instructions for installing Visual Studio, Git, Go, and vcpkg. Signed-off-by: Kévin Dunglas --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 34df4102f..859c92356 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -94,6 +94,7 @@ curl -v http://127.0.0.1:8080/phpinfo.php git config --global core.autocrlf false git config --global core.eol lf ``` + 2. Install Visual Studio, Git, and Go: ```powershell @@ -102,6 +103,7 @@ curl -v http://127.0.0.1:8080/phpinfo.php ``` 3. Install vcpkg: + ```powershell cd c:\ gh repo clone microsoft/vcpkg From 3f3c689cd62b88f741d5739db5a62b4e99c45e8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 2 Mar 2026 18:36:57 +0100 Subject: [PATCH 05/13] Refactor section titles in CONTRIBUTING.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated section titles for consistency and capitalization. Signed-off-by: Kévin Dunglas --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 859c92356..d0ab5dd71 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,14 +30,14 @@ If your Docker version is lower than 23.0, the build will fail due to dockerigno [Follow the instructions to compile from sources](https://frankenphp.dev/docs/compile/) and pass the `--debug` configuration flag. -## Running the test suite +## Running the Test Suite ```console export CGO_CFLAGS=$(php-config --includes) CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" go test -race -v ./... ``` -## Caddy module +## Caddy Module Build Caddy with the FrankenPHP Caddy module: @@ -63,7 +63,7 @@ The server is listening on `127.0.0.1:80`: curl -vk http://127.0.0.1/phpinfo.php ``` -## Minimal test server +## Minimal Test Server Build the minimal test server: @@ -86,7 +86,7 @@ The server is listening on `127.0.0.1:8080`: curl -v http://127.0.0.1:8080/phpinfo.php ``` -## Windows development +## Windows Development 1. Configure Git to always use `lf` line endings From d9ab4558c2b938ff5cc5562201ee440435704ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 2 Mar 2026 18:43:44 +0100 Subject: [PATCH 06/13] Update CONTRIBUTING.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Kévin Dunglas --- CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d0ab5dd71..00dad8161 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -99,7 +99,8 @@ curl -v http://127.0.0.1:8080/phpinfo.php ```powershell winget install -e --id Microsoft.VisualStudio.2022.Community --override "--passive --wait --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.Llvm.Clang --includeRecommended" - winget install -e --id GoLang.Go --id Git.Git + winget install -e --id GoLang.Go + winget install -e --id Git.Git ``` 3. Install vcpkg: From bd179a7578353f52bbe2b0ba95be8f36642922ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 2 Mar 2026 18:44:11 +0100 Subject: [PATCH 07/13] Update CONTRIBUTING.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Kévin Dunglas --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 00dad8161..c6f9cdf50 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -106,8 +106,8 @@ curl -v http://127.0.0.1:8080/phpinfo.php 3. Install vcpkg: ```powershell - cd c:\ - gh repo clone microsoft/vcpkg + cd C:\ + git clone https://github.com/microsoft/vcpkg .\vcpkg\bootstrap-vcpkg.bat ``` From f5cbc8cec373bd43ee6a785211849328b6a8b21c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 2 Mar 2026 18:44:33 +0100 Subject: [PATCH 08/13] Update CONTRIBUTING.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Kévin Dunglas --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c6f9cdf50..18aded219 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -123,7 +123,7 @@ curl -v http://127.0.0.1:8080/phpinfo.php 7. Install the dependencies: ```powershell - vcpkg install + C:\vcpkg\vcpkg.exe install ``` 8. Configure the needed environment variables (PowerShell): From 5c6ced386b928e5b3dceef57ae8c9d2a950c57f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 2 Mar 2026 18:45:19 +0100 Subject: [PATCH 09/13] Update CONTRIBUTING.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Kévin Dunglas --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 18aded219..bd90f057e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -133,7 +133,7 @@ curl -v http://127.0.0.1:8080/phpinfo.php $env:CC = 'clang' $env:CXX = 'clang++' $env:CGO_CFLAGS = "-IC:\frankenphp\vcpkg_installed\x64-windows\include -IC:\watcher-x86_64-pc-windows-msvc -IC:\php-devel\include -IC:\php-devel\include\main -IC:\php-devel-vs17-x64\include\TSRM -IC:\php-devel\include\Zend -IC:\php-devel\include\ext" - $env:CGO_LDFLAGS = '-LC:\vcpkg\installed\x64-windows\lib -lbrotlienc -LC:\watcher-x86_64-pc-windows-msvc -llibwatcher-c -LC:\php -LC:\php-devel\lib -lphp8ts -lphp8embed' + $env:CGO_LDFLAGS = '-LC:\frankenphp\vcpkg_installed\x64-windows\lib -lbrotlienc -LC:\watcher-x86_64-pc-windows-msvc -llibwatcher-c -LC:\php -LC:\php-devel\lib -lphp8ts -lphp8embed' ``` 8. Run the tests: From 8a09901ed1868b5f03985f97dc5f8ab2e798abcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 2 Mar 2026 18:45:38 +0100 Subject: [PATCH 10/13] Update CONTRIBUTING.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Kévin Dunglas --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bd90f057e..2ec67dd8e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -132,7 +132,7 @@ curl -v http://127.0.0.1:8080/phpinfo.php $env:PATH += ';C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\bin' $env:CC = 'clang' $env:CXX = 'clang++' - $env:CGO_CFLAGS = "-IC:\frankenphp\vcpkg_installed\x64-windows\include -IC:\watcher-x86_64-pc-windows-msvc -IC:\php-devel\include -IC:\php-devel\include\main -IC:\php-devel-vs17-x64\include\TSRM -IC:\php-devel\include\Zend -IC:\php-devel\include\ext" + $env:CGO_CFLAGS = "-IC:\frankenphp\vcpkg_installed\x64-windows\include -IC:\watcher-x86_64-pc-windows-msvc -IC:\php-devel\include -IC:\php-devel\include\main -IC:\php-devel\include\TSRM -IC:\php-devel\include\Zend -IC:\php-devel\include\ext" $env:CGO_LDFLAGS = '-LC:\frankenphp\vcpkg_installed\x64-windows\lib -lbrotlienc -LC:\watcher-x86_64-pc-windows-msvc -llibwatcher-c -LC:\php -LC:\php-devel\lib -lphp8ts -lphp8embed' ``` From 6d4f347ff982febc154c0724642acdca18e037cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 2 Mar 2026 18:46:42 +0100 Subject: [PATCH 11/13] Fix command for running Go tests in Windows workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kévin Dunglas --- .github/workflows/windows.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index b6bde9313..ecff99064 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -217,7 +217,7 @@ jobs: "opcache.enable=0`r`nopcache.enable_cli=0" | Out-File php.ini $env:PHPRC = Get-Location - go -race test ./... + go test -race ./... cd caddy - go -race test ./... + go test -race ./... working-directory: ${{ github.workspace }}\frankenphp From 17b8c9d5ea32b081f96f1829ab4cf0a2b7099322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 2 Mar 2026 18:49:57 +0100 Subject: [PATCH 12/13] Modify CGO flags in CONTRIBUTING.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated CGO_CFLAGS and CGO_LDFLAGS for improved paths. Signed-off-by: Kévin Dunglas --- CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2ec67dd8e..3aa85e752 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -132,11 +132,11 @@ curl -v http://127.0.0.1:8080/phpinfo.php $env:PATH += ';C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\bin' $env:CC = 'clang' $env:CXX = 'clang++' - $env:CGO_CFLAGS = "-IC:\frankenphp\vcpkg_installed\x64-windows\include -IC:\watcher-x86_64-pc-windows-msvc -IC:\php-devel\include -IC:\php-devel\include\main -IC:\php-devel\include\TSRM -IC:\php-devel\include\Zend -IC:\php-devel\include\ext" - $env:CGO_LDFLAGS = '-LC:\frankenphp\vcpkg_installed\x64-windows\lib -lbrotlienc -LC:\watcher-x86_64-pc-windows-msvc -llibwatcher-c -LC:\php -LC:\php-devel\lib -lphp8ts -lphp8embed' + $env:CGO_CFLAGS = "-IC:\frankenphp\vcpkg_installed\x64-windows\include -IC:\watcher -IC:\php-devel\include -IC:\php-devel\include\main -IC:\php-devel\include\TSRM -IC:\php-devel\include\Zend -IC:\php-devel\include\ext" + $env:CGO_LDFLAGS = '-LC:\frankenphp\vcpkg_installed\x64-windows\lib -lbrotlienc -LC:\watcher -llibwatcher-c -LC:\php -LC:\php-devel\lib -lphp8ts -lphp8embed' ``` -8. Run the tests: +9. Run the tests: ```powershell go test -race -ldflags '-extldflags="-fuse-ld=lld"' ./... From ba384ace89e5d4ac521d88c3063aa856ca56bfbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Tue, 3 Mar 2026 10:06:27 +0100 Subject: [PATCH 13/13] Add debug flags to CGO_CFLAGS in CONTRIBUTING.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated CGO_CFLAGS to include optimization flags. Signed-off-by: Kévin Dunglas --- CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3aa85e752..009c561f1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,7 +33,7 @@ If your Docker version is lower than 23.0, the build will fail due to dockerigno ## Running the Test Suite ```console -export CGO_CFLAGS=$(php-config --includes) CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" +export CGO_CFLAGS=-O0 -g $(php-config --includes) CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" go test -race -v ./... ``` @@ -132,7 +132,7 @@ curl -v http://127.0.0.1:8080/phpinfo.php $env:PATH += ';C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\bin' $env:CC = 'clang' $env:CXX = 'clang++' - $env:CGO_CFLAGS = "-IC:\frankenphp\vcpkg_installed\x64-windows\include -IC:\watcher -IC:\php-devel\include -IC:\php-devel\include\main -IC:\php-devel\include\TSRM -IC:\php-devel\include\Zend -IC:\php-devel\include\ext" + $env:CGO_CFLAGS = "-O0 -g -IC:\frankenphp\vcpkg_installed\x64-windows\include -IC:\watcher -IC:\php-devel\include -IC:\php-devel\include\main -IC:\php-devel\include\TSRM -IC:\php-devel\include\Zend -IC:\php-devel\include\ext" $env:CGO_LDFLAGS = '-LC:\frankenphp\vcpkg_installed\x64-windows\lib -lbrotlienc -LC:\watcher -llibwatcher-c -LC:\php -LC:\php-devel\lib -lphp8ts -lphp8embed' ``` @@ -222,7 +222,7 @@ docker buildx bake -f docker-bake.hcl --pull --no-cache --push ```patch - name: Set CGO flags - run: echo "CGO_CFLAGS=$(php-config --includes)" >> "$GITHUB_ENV" + run: echo "CGO_CFLAGS=-O0 -g $(php-config --includes)" >> "$GITHUB_ENV" + - run: | + sudo apt install gdb + mkdir -p /home/runner/.config/gdb/