Repository navigation
Build the IP Intelligence extension on macOS again - #100
Merged
Merged
Conversation
…ce class names clang, which builds the extension on macOS, refuses to convert the untyped pointer ZEND_HASH_FOREACH_STR_KEY_PTR gives to a class entry, where g++ accepts it under -fpermissive.
jwrosewell
marked this pull request as ready for review
November 14, 2026 06:04
This was referenced Nov 14, 2026
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 IP Intelligence extension stopped compiling on macOS with #88. This draft makes it compile again, so that the release build of
rc, which runs on macOS, can pass.Problem
ipi_register_earlier_namesinipi-php.ilines 63 to 74 at rc 70424ea5, from #88, reads each class entry withZEND_HASH_FOREACH_STR_KEY_PTR(CG(class_table), key, ce), whereceis azend_class_entry *. PHP's macro assigns the entry with_ptr = Z_PTR_P(_z);(php-src PHP-8.4Zend/zend_hash.hlines 1279 to 1282), andZ_PTRis the entry'svoid *(Zend/zend_types.hlines 1066 to 1067). C++ turns avoid *into another pointer type only with a cast. Bothconfig.m4files pass-fpermissive, under which g++ gives only a warning, so Linux builds. clang, which builds the extension on macOS, gives an error.#88's full build left macOS out under the 9 November decision, so it did not show there. A Nightly Pipeline dry run of every PHP draft merged together, run 43553806074, failed in its macOS PHP 8.4 job with
and fail-fast stopped the other four macOS jobs. So the release build of
rcwith macOS would fail.What changed
ipi-php.itakes the entry asvoid *entryand casts it withstatic_cast<zend_class_entry *>(entry), with a two line comment saying why. SWIG copies that block into the wrapper unchanged, so the committedsrc/php8/ipi_wrap.cxxhas the same lines changed, and the check "IP Intelligence wrapper matches ipi-php.i", which builds SWIG 4.5.1, generates the wrapper again and compares, passes on the head. Nothing else changes.This is code of
fiftyone.ipintelligence, which has no mirror and is not on Packagist, so no package is released.Runs
The red and green runs use a throwaway workflow that builds both extensions as CI does (
ci/setup-environment.ps1, thenci/build-project.ps1) on macOS with PHP 8.1, 8.4 and 8.5 and on Ubuntu with PHP 8.3, checks the IP Intelligence extension loads, runs its unit tests as CI does, and then runs the two class name tests ofMixedExamplesTests, which load both extensions.tmp/ipi-macos-reda84b139, which isrc70424ea with the workflow. All three macOS jobs failed to build, each withipi_wrap.cxx:1631:9: error: assigning to 'zend_class_entry *' ... from incompatible type 'void *'and "ip-intelligence: make failed". The Ubuntu job built and passed the unit tests, and failed only in the class name step, because that step first ran the PHPUnit 12 the package's own Composer install gives, which reads no@dataProviderdoc comment (#101, item 4). CI runs these tests with PHPUnit 9.6, and so does the green run.tmp/ipi-macos-green854ea8e, which is this head with the workflow. All four jobs passed. In each, the extension loaded, the unit suite gave "OK (36 tests, 101 assertions)" and the class name tests "OK (4 tests, 42 assertions)" with PHPUnit 9.6.34.tmp/pr-matrix-100, started withtools/pr-matrix.pywithout macOS, success. All eight build jobs passed, Ubuntu with PHP 7.4 to 8.5 and Windows with PHP 8.3. Every one of the 9Setting 'PullRequestSha'lines gives 277e459, and Configure printed "Left out 5 macOS entries". Each job builds the head merged intorcasrcis when the job starts. The PHP 8.0 to 8.3 jobs started before Read and choose the client IP as the IP Intelligence specification says, and round coordinates #97 and Every example ends with Find out more, and gives the tagged links it needs #98 merged and gave the IP Intelligence unit suite "OK (36 tests, 101 assertions)". The PHP 8.4 and 8.5 jobs started after, merged the head with them, and gave "OK (52 tests, 278 assertions)". So the change was built and tested on Linux withrcboth before and after those merges.macOS was left out of this draft's full build under the 9 November decision, and the green run above built and tested on macOS. The rc head is built with macOS before it merges into main.
The head
277e459 is one commit on
rc70424ea.rchas since taken #97 and #98 (2104ad7), which change nothing underip-intelligence/on-premise, andgit merge-treeof the head and 2104ad7 is clean. The quick checks are green on the head, the two wrapper checks included.What remains
config.m4files keep-fpermissive, which lets Linux build what macOS refuses. #102 takes it out.tmp/ipi-macos-red,tmp/ipi-macos-greenandtmp/pr-matrix-100are deleted once this description is published.