Skip to content

Conversation

@onethumb
Copy link
Contributor

@onethumb onethumb commented Nov 9, 2025

The Problem

Some people run PHP on Windows, but this extension doesn't support it.

The Solution

Add support for building on Windows.

Planned version bump

  • Which: MINOR
  • Why: non-breaking new functionality

Notes

Does not yet auto-build and publish the Windows DLLs, but that's planned.

@onethumb onethumb requested a review from Copilot November 9, 2025 16:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds Windows build support for the crc_fast PHP extension by implementing a config.w32 build configuration file and making necessary C++ compatibility adjustments. The extension can now be built on Windows using the PHP SDK binary tools and Visual Studio toolchain.

Key changes:

  • Created config.w32 for Windows build configuration with library detection and compiler/linker setup
  • Added C++ extern "C" linkage guards to php_crc_fast.h for proper C/C++ interoperability
  • Updated php_crc_fast.cpp to handle Windows platform differences (htonll/ntohll definitions)
  • Added comprehensive build documentation for Windows developers

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
config.w32 Implements Windows build configuration with library path detection, compiler flags, and linker settings
php_crc_fast.h Adds C++ extern "C" linkage guards around PHP includes and module entry declaration
php_crc_fast.cpp Adds Windows platform checks for htonll/ntohll definitions and extern "C" guards for module exports
.kiro/steering/build-commands.md Documents the Windows build environment setup and build commands
.kiro/specs/windows-build-support/*.md Provides requirements, design, and implementation tasks for Windows build support

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

$
```

Build commands *CANNOT* work unless they're within this environment. If you find yourself outside of the environment for some reason, or the remaining build commands don't seem to be working properly, double-check that you're in the `php-sdk-binar-tools` environment, and if not, start it again.
Copy link

Copilot AI Nov 9, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'php-sdk-binar-tools' to 'php-sdk-binary-tools'.

Suggested change
Build commands *CANNOT* work unless they're within this environment. If you find yourself outside of the environment for some reason, or the remaining build commands don't seem to be working properly, double-check that you're in the `php-sdk-binar-tools` environment, and if not, start it again.
Build commands *CANNOT* work unless they're within this environment. If you find yourself outside of the environment for some reason, or the remaining build commands don't seem to be working properly, double-check that you're in the `php-sdk-binary-tools` environment, and if not, start it again.

Copilot uses AI. Check for mistakes.
"C:\\tools\\crc_fast"
];

// Add Scoop path if USERPROFILE is set
Copy link

Copilot AI Nov 9, 2025

Choose a reason for hiding this comment

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

WshShell is referenced but never declared. This variable needs to be instantiated before use with var WshShell = WScript.CreateObject('WScript.Shell'); or similar initialization.

Suggested change
// Add Scoop path if USERPROFILE is set
// Add Scoop path if USERPROFILE is set
var WshShell = WScript.CreateObject('WScript.Shell');

Copilot uses AI. Check for mistakes.
Comment on lines +52 to +53
"C:\\vcpkg\\installed\\x64-windows",
"C:\\vcpkg\\installed\\x86-windows",
Copy link

Copilot AI Nov 9, 2025

Choose a reason for hiding this comment

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

The standard_paths array includes vcpkg paths, but the error message at lines 86-87 only lists x64-windows and x86-windows. Consider also checking for crc-fast and crc_fast subdirectories within these vcpkg paths, similar to how Program Files paths include both variants, since vcpkg typically installs packages in subdirectories.

Copilot uses AI. Check for mistakes.
@onethumb onethumb merged commit c35c2c4 into awesomized:main Nov 9, 2025
7 checks passed
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.

1 participant