Skip to content

Fix the Windows extension test failures on fable-v3-windows#1208

Merged
crazywhalecc merged 9 commits into
crazywhalecc:fable-v3-windowsfrom
m-this:fix/1207-windows-ext-tests
Jul 9, 2026
Merged

Fix the Windows extension test failures on fable-v3-windows#1208
crazywhalecc merged 9 commits into
crazywhalecc:fable-v3-windowsfrom
m-this:fix/1207-windows-ext-tests

Conversation

@m-this

@m-this m-this commented Jul 8, 2026

Copy link
Copy Markdown

Dug into the three Windows failures, turned out to be four separate bugs. All fixed here and verified green on windows-latest with the same build commands the test bot runs: https://github.com/m-this/static-php-cli/actions/runs/28927716538

  • postgresql (breaks pdo_pgsql,pgsql and swow): the meson build expects meson/ninja/win_flex/win_bison on PATH, CI doesn't have them. They're now tool packages via tools@windows, like jom on openssl. Meson gets installed from its wheel into a venv, since postgres needs a real meson.exe (it re-invokes meson through find_program).
  • imagick: php.exe was missing gdi32.lib, and php-cgi/micro then hit LNK2005 on duplicate symbols; they now link with /FORCE:MULTIPLE like php.exe already did.
  • libiconv: the smoke test failed with DLL_NOT_FOUND because the import lib was on the link line next to the static one, so php.exe imported libiconv.dll. Only the static lib is declared now.
  • pgsql: libpq needs secur32 and libcrypto needs crypt32, and nothing links them when the openssl extension isn't in the build. Added them in ext/pgsql/config.w32, same trick as your imagick patch.

@m-this m-this mentioned this pull request Jul 8, 2026
4 tasks
m-this added 4 commits July 8, 2026 11:15
- the meson build assumed meson/ninja/win_flex/win_bison/perl on PATH,
  which only held on machines that had them installed
- add meson, ninja and winflexbison tool packages and declare them via
  tools@windows on postgresql, together with the existing strawberry-perl
- meson no longer ships a Windows MSI, so the wheel is installed offline
  into a venv: postgres re-invokes meson through find_program, which
  needs the real meson.exe launcher pip generates
- php.exe already links with /FORCE:MULTIPLE for extension-bundled
  duplicate symbols, cgi and micro did not
- imagick's MagickCore defines gettimeofday, also defined in php's
  time.obj, and both links failed with LNK2005
- libpq authenticates through SSPI and the static libcrypto behind it
  reads the system cert store; php.exe failed to link with unresolved
  Cert* and SSPI symbols when the openssl extension is not in the build
- static-libs@windows listed both libiconv.lib (the dll import lib) and
  libiconv_a.lib; the import lib came first, so php.exe ended up
  importing libiconv.dll and the cli smoke test died with
  STATUS_DLL_NOT_FOUND on machines without it
@m-this m-this force-pushed the fix/1207-windows-ext-tests branch from d52c61a to 43b2da0 Compare July 8, 2026 09:15
@henderkes

Copy link
Copy Markdown
Collaborator

Another possibility would be structuring to use winget/vcpkg to install these tools, as they don't affect the library or php binary links.

winget install -e --id mesonbuild.meson in doctor.

Comment thread src/Package/Artifact/meson_win.php
Comment thread src/Package/Artifact/meson_win.php Outdated
}
}
if ($python === null) {
throw new EnvironmentException('meson needs Python 3 on PATH. Install it from https://www.python.org or with `winget install Python.Python.3.13`.');

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

I'd prefer bundling the python-win tools with the installation, or embedding the Python installation into the Meson setup process. Otherwise, there would be the issue of requiring manual environment configuration.

Ideally, if the build process is overly complex, I would prefer handling the build in the cloud (similar to icu-static-win) or simply downloading a pre-built package like before. However, if installing a lightweight Python runtime solves the problem and not struggle the procedure, I think that would be acceptable as well.

@m-this m-this Jul 8, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I think that's the cleanest option actually, so I went with it: there's now a python-win tool package that just unzips the official python.org nuget package into the pkgroot. It's a plain zip, nothing to install, and it ships venv so meson can build its env from it (with a fallback to system python just in case). Should also work on your LTSC since there's no winget or msys2 involved.

Checked on windows-latest that the venv really comes from the pkgroot python and not the runner's one: https://github.com/m-this/static-php-cli/actions/runs/28941945448

- add a python-win tool package that unzips the official python.org
  nuget package into the pkgroot (venv and ensurepip included)
- meson uses it to build its venv and only falls back to a system
  python, so no manual environment setup is needed

@henderkes henderkes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think if we have that kind of dependency not handled by doctor, it should be. Winget is available on every Windows 10+ machine now so we really should be using it.

@crazywhalecc

crazywhalecc commented Jul 8, 2026

Copy link
Copy Markdown
Owner

I think if we have that kind of dependency not handled by doctor, it should be. Winget is available on every Windows 10+ machine now so we really should be using it.

I have been using the LTSC version of Windows for testing, and it does not include winget.

I am not entirely sure about the coverage here, but if we intend to use winget, we should first check for its presence and ensure native support within our package system (we could also include msys2 package together).

Native support means we could declare these packages as libs' tool dependencies like we just added tool type.

@henderkes

Copy link
Copy Markdown
Collaborator

The LTSC versions are still missing it? It was a bit of a pain to install manually I remember.

It would definitely simplify the dependency stuff though, both in terms of doctor fixing VS build tools as well as perl, python, meson and cmake. If you think it's acceptable to have users install winget if they don't have it, I think we should do it.

@crazywhalecc

Copy link
Copy Markdown
Owner

Since Python is already installed, I think sticking with the current approach is sufficient for now. Even if we were to switch to winget, that should be handled as an improvement in a future branch.

@crazywhalecc crazywhalecc merged commit 859c06a into crazywhalecc:fable-v3-windows Jul 9, 2026
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.

3 participants