[protocolbuffers/protobuf]修复 Windows 中的 PHP 扩展构建

2024-05-13 723 views
6

说明:按照https://wiki.php.net/internals/windows/stepbystepbuild中的“构建 PECL 扩展”指南,将所有文件复制到php/ext/google/protobuf/phpdev\vc14\x64\pecl\protobuf并配置configure --disable-all --enable-cli --enable-protobuf=shared --disable-zts

图像

图像 图像

这个PR只是修复了在Windows上的构建,无论如何,当我编译它时有很多警告,如果我调用任何类似的函数\Google\Protobuf\Internal\DescriptorPool::internalAddGeneratedFile,它仍然会使PHP崩溃。

回答

4

感谢您的拉取请求。一旦管理员之一验证此更改适合我们在我们的基础设施上运行,自动化测试就会运行。

6

感谢您的拉取请求。一旦管理员之一验证此更改适合我们在我们的基础设施上运行,自动化测试就会运行。

3

管理员之一可以验证此补丁吗?

0

在深入讨论此 PR 的细节之前,我们可以先在 Windows 上添加一个持续测试吗?

9

我想我需要写作方面的帮助appveyor.bat,我不知道为什么它返回 OK 不符合预期。

3

我猜这是因为你没有提到:转到错误。

0

你可以尝试: make ||转到错误

1

我发现了这一点php_setvars并将phpsdk_buildtree打破该批次。

9

OK,AppVeyor构建成功

7

惊人的。您可以添加一个测试脚本来在 php/test/test.sh 中运行测试吗?

8

好的,已添加。phpunit没有结果的命令意味着 php 崩溃了。

****************************
*    array_test.php
****************************
PHPUnit 5.7.21 by Sebastian Bergmann and contributors.
..FF....****************************
*    encode_decode_test.php
****************************
PHPUnit 5.7.21 by Sebastian Bergmann and contributors.
****************************
*    generated_class_test.php
****************************
PHPUnit 5.7.21 by Sebastian Bergmann and contributors.
****************************
*    generated_phpdoc_test.php
****************************
PHPUnit 5.7.21 by Sebastian Bergmann and contributors.
...............................                                  31 / 31 (100%)
Time: 133 ms, Memory: 10.00MB
OK (31 tests, 156 assertions)
****************************
*    map_field_test.php
****************************
PHPUnit 5.7.21 by Sebastian Bergmann and contributors.
..FF....****************************
*    well_known_test.php
****************************
PHPUnit 5.7.21 by Sebastian Bergmann and contributors.
****************************
*    generated_service_test.php
****************************
PHPUnit 5.7.21 by Sebastian Bergmann and contributors.
.........                                                          9 / 9 (100%)
Time: 137 ms, Memory: 10.00MB
OK (9 tests, 34 assertions)
****************************
*    descriptors_test.php
****************************
PHPUnit 5.7.21 by Sebastian Bergmann and contributors.
7

您需要帮助来修复失败的测试吗?

9

根据警告的数量,我认为即使只有一个测试也不容易修复。

9

它会崩溃在 图像

返回堆栈,发现getsubhandlers返回错误的时候f->_index == 0

图像

感觉像是错误upb_descreader_newhandlers,所以对我来说调试起来太困难了。

5

好的,我看一下。