kjdev / php-ext-zstd

Zstd Extension for PHP
MIT License
200 stars 27 forks source link

Error compiling PHP8.2 snap #50

Closed wantedxnn closed 1 year ago

wantedxnn commented 1 year ago

Compilinig PHP 8.2 with extension apcu and zstd i get error:

ext\zstd\zstd.c(903): error C2036: 'void *': unknown size

If i remove apcu extension everything is fine.

Also i tried to compile zstd extension static and shared with apcu extension enabled and same error.

kjdev commented 1 year ago

What is your compile environment?

Compile commands, options, etc.

wantedxnn commented 1 year ago

I fixed the problem i changed void *var; from line 883 with unsigned char* var; from zstd.c now everything it compiling w/o problems.

Environnement is windows full build snapshot with all extensions also pgi/pgo.

wantedxnn commented 1 year ago

I think this fix can be committed to the source.

kjdev commented 1 year ago

Not an error in CI environment build.

Build ``` [vcvarsall.bat] Environment initialized for: 'x86' D:\a\php-ext-zstd\php-ext-zstd>call phpize 2>&1 Rebuilding configure.js C:\php\devel module ... Now run 'configure --help' Saving configure options to config.nice.bat Checking for cl.exe ... Detected compiler Visual C++ 2019 Detected 32-bit compiler Checking for link.exe ... Checking for nmake.exe ... Checking for lib.exe ... Checking for bison.exe ... Detected bison version 3.3.2 Checking for sed.exe ... Checking for re2c.exe ... Detected re2c version 1.1.1 Checking for zip.exe ... Checking for lemon.exe ... Checking for 7za.exe ... Checking for mc.exe ... C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86 Checking for mt.exe ... C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x86 Build dir: D:\a\php-ext-zstd\php-ext-zstd\Release_TS PHP Core: php8ts.dll and php8ts.lib Checking for library libzstd.lib;zstd.lib ... \lib\zstd.lib Checking for zstd.h ... \include Enabling extension D:\a\php-ext-zstd\php-ext-zstd [shared] Creating build dirs... Generating files... Generating Makefile Generating main/config.pickle.h Generating pickle deps Done. Enabled extensions: ---------------------- | Extension | Mode | ---------------------- | zstd | shared | ---------------------- --------------------------------------- | | | --------------------------------------- | Build type | Release | | Thread Safety | Yes | | Compiler | Visual C++ 2019 | | Architecture | x86 | | Optimization | PGO disabled | | Native intrinsics | SSE2 | | Static analyzer | disabled | --------------------------------------- Type 'nmake' to build PHP "cl.exe" /I "C:\php\deps\include" /DHAVE_ZSTD_H=1 /D ZEND_COMPILE_DL_EXT=1 /D COMPILE_DL_ZSTD /D ZSTD_EXPORTS=1 /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /nologo /I C:\php\devel/include /I C:\php\devel/include/main /I C:\php\devel/include/Zend /I C:\php\devel/include/TSRM /I C:\php\devel/include/ext /D _WINDOWS /D WINDOWS=1 /D ZEND_WIN32=1 /D PHP_WIN32=1 /D WIN32 /D _MBCS /D _USE_MATH_DEFINES /FD /wd4996 /D_USE_32BIT_TIME_T=1 /Qspectre /guard:cf /Zc:inline /Gw /Zc:__cplusplus /d2FuncCache1 /Zc:wchar_t /MP /Zi /LD /MD /Ox /D NDebug /D NDEBUG /GF /D ZEND_DEBUG=0 /D ZTS=1 /I "C:\php\deps\include" /FoD:\a\php-ext-zstd\php-ext-zstd\Release_TS\\ /FpD:\a\php-ext-zstd\php-ext-zstd\Release_TS\\ /FRD:\a\php-ext-zstd\php-ext-zstd\Release_TS\\ /FdD:\a\php-ext-zstd\php-ext-zstd\Release_TS\\ /c D:\a\php-ext-zstd\php-ext-zstd\zstd.c zstd.c rc /nologo /I C:\php\devel/include /I C:\php\devel/include/main /I C:\php\devel/include/Zend /I C:\php\devel/include/TSRM /I C:\php\devel/include/ext /I C:\php\devel/include /n /fo D:\a\php-ext-zstd\php-ext-zstd\Release_TS\php_zstd.dll.res /d FILE_DESCRIPTION="\"php_zstd.dll\"" /d FILE_NAME="\"php_zstd.dll\"" /d URL="\"http://www.php.net\"" /d INTERNAL_NAME="\"ZSTD extension\"" /d THANKS_GUYS="\"\"" C:\php\devel\build\template.rc "link.exe" @"D:\a\php-ext-zstd\php-ext-zstd\Release_TS\resp\ZSTD_GLOBAL_OBJS.txt" C:\php\devel\lib\php8ts.lib zstd.lib kernel32.lib ole32.lib user32.lib advapi32.lib shell32.lib ws2_32.lib Dnsapi.lib psapi.lib bcrypt.lib D:\a\php-ext-zstd\php-ext-zstd\Release_TS\php_zstd.dll.res /out:D:\a\php-ext-zstd\php-ext-zstd\Release_TS\php_zstd.dll /dll /nologo /GUARD:CF /d2:-AllowCompatibleILVersions /incremental:no /debug /opt:ref,icf /libpath:"\"C:\php\deps\lib\"" /libpath:"C:\php\devel\lib\;C:\php\devel" /libpath:"C:\php\deps\lib" Creating library D:\a\php-ext-zstd\php-ext-zstd\Release_TS\php_zstd.lib and object D:\a\php-ext-zstd\php-ext-zstd\Release_TS\php_zstd.exp EXT zstd build complete ```
Test ``` ===================================================================== PHP : C:\php\bin\php.exe PHP_SAPI : cli PHP_VERSION : 8.1.14 ZEND_VERSION: 4.1.14 PHP_OS : WINNT - Windows NT fv-az211-385 10.0 build 17763 (Windows Server 2019) i586 INI actual : C:\php\bin\php.ini More .INIs : --------------------------------------------------------------------- CWD : D:\a\php-ext-zstd\php-ext-zstd Extra dirs : VALGRIND : Not used ===================================================================== Running selected tests. TEST 1/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\001.phpt] PASS zstd_compress(): basic functionality [D:\a\php-ext-zstd\php-ext-zstd\tests\001.phpt] TEST 2/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\002.phpt] SKIP zstd_compress(): error conditions [D:\a\php-ext-zstd\php-ext-zstd\tests\002.phpt] reason: requires PHP <8.0 TEST 3/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\002_b.phpt] PASS zstd_compress(): error conditions [D:\a\php-ext-zstd\php-ext-zstd\tests\002_b.phpt] TEST 4/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\003.phpt] PASS zstd_compress(): variation [D:\a\php-ext-zstd\php-ext-zstd\tests\003.phpt] TEST 5/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\004.phpt] PASS zstd_uncompress(): basic functionality [D:\a\php-ext-zstd\php-ext-zstd\tests\004.phpt] TEST 6/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\005.phpt] SKIP zstd_uncompress(): error conditions [D:\a\php-ext-zstd\php-ext-zstd\tests\005.phpt] reason: requires PHP < 8.0 TEST 7/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\005_b.phpt] PASS zstd_uncompress(): error conditions [D:\a\php-ext-zstd\php-ext-zstd\tests\005_b.phpt] TEST 8/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\006.phpt] PASS unexpected exiting when uncompress the wrong format data [D:\a\php-ext-zstd\php-ext-zstd\tests\006.phpt] TEST 9/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\007.phpt] PASS namespace: Zstd\compress()/uncompress() [D:\a\php-ext-zstd\php-ext-zstd\tests\007.phpt] TEST 10/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\008.phpt] SKIP zstd_compress(): compress level [D:\a\php-ext-zstd\php-ext-zstd\tests\008.phpt] reason: needs libzstd 1.3.3 or older TEST 11/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\009.phpt] PASS zstd_compress(): compress level [D:\a\php-ext-zstd\php-ext-zstd\tests\009.phpt] TEST 12/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\010.phpt] PASS zstd_uncompress(): streaming archive [D:\a\php-ext-zstd\php-ext-zstd\tests\010.phpt] TEST 13/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\011.phpt] PASS compress level constants [D:\a\php-ext-zstd\php-ext-zstd\tests\011.phpt] TEST 14/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\alias.phpt] PASS alias functionality [D:\a\php-ext-zstd\php-ext-zstd\tests\alias.phpt] TEST 15/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\apcu_serializer.phpt] PASS APCu serializer registration [D:\a\php-ext-zstd\php-ext-zstd\tests\apcu_serializer.phpt] TEST 16/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\dictionary.phpt] PASS zstd_compress_dict(): basic functionality [D:\a\php-ext-zstd\php-ext-zstd\tests\dictionary.phpt] TEST 17/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\dictionary_01.phpt] PASS zstd_compress_dict(): compress level [D:\a\php-ext-zstd\php-ext-zstd\tests\dictionary_01.phpt] TEST 18/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\info.phpt] PASS phpinfo() displays zstd info [D:\a\php-ext-zstd\php-ext-zstd\tests\info.phpt] TEST 19/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\streams_1.phpt] PASS compress.zstd streams basic [D:\a\php-ext-zstd\php-ext-zstd\tests\streams_1.phpt] TEST 20/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\streams_2.phpt] PASS compress.zstd streams and compatibility [D:\a\php-ext-zstd\php-ext-zstd\tests\streams_2.phpt] TEST 21/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\streams_3.phpt] PASS compress.zstd streams and big file [D:\a\php-ext-zstd\php-ext-zstd\tests\streams_3.phpt] TEST 22/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\streams_4.phpt] PASS compress.zstd streams with file functions [D:\a\php-ext-zstd\php-ext-zstd\tests\streams_4.phpt] TEST 23/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\streams_5.phpt] PASS compress.zstd streams with dictionary [D:\a\php-ext-zstd\php-ext-zstd\tests\streams_5.phpt] TEST 24/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\streams_6.phpt] PASS compress.zstd read online stream [D:\a\php-ext-zstd\php-ext-zstd\tests\streams_6.phpt] TEST 25/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\streams_7.phpt] PASS compress.zstd read online stream denied [D:\a\php-ext-zstd\php-ext-zstd\tests\streams_7.phpt] TEST 26/26 [D:\a\php-ext-zstd\php-ext-zstd\tests\streams_8.phpt] PASS compress.zstd use include_path [D:\a\php-ext-zstd\php-ext-zstd\tests\streams_8.phpt] ===================================================================== Number of tests : 26 23 Tests skipped : 3 ( 11.5%) -------- Tests warned : 0 ( 0.0%) ( 0.0%) Tests failed : 0 ( 0.0%) ( 0.0%) Tests passed : 23 ( 88.5%) (100.0%) --------------------------------------------------------------------- Time taken : 4 seconds ===================================================================== ```
wantedxnn commented 1 year ago

I got that error when i tried to compile php_apcu to have zstd as serialization...

kjdev commented 1 year ago

APCU was not enabled when building with CI.

I was able to confirm that there was an error when I enabled it, so I fixed it.

kjdev commented 1 year ago

https://github.com/kjdev/php-ext-zstd/releases/tag/0.12.1