Prevent using system DLLs when running the tests #17805
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The search order for DLLs on Windows is (simplified):
PATH
(The full details are documented on Microsoft Learn[1].)
As is, we're adding
deps\bin
to thePATH
when running the tests, but any DLLs in the system folder take precedence, so these would be used instead of our intended dependencies. To mitigate that, we copy over all DLLs fromdeps\bin
to our application folder (i.e. where php.exe, php-cgi.exe and phpdbg.exe are placed).Since we're doing this, there is no more need to attempt to remove the OpenSSL DLLs in the system folder (what seems to be a bad idea anyway).
[1] https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order
Again, not sure which branch to target; went with PHP-8.3 as a compromise.
See https://github.com/php/php-src/actions/runs/13263835929/job/37026288607 for the problem this is trying to solve (in a more general way than just to cater to OpenSLL; there might be others in the system folder, too).