Skip to content

Commit 0ce4f5c

Browse files
committedJan 29, 2025··
Fix build errors.
1 parent 480e115 commit 0ce4f5c

File tree

1 file changed

+29
-19
lines changed

1 file changed

+29
-19
lines changed
 

‎windows-compile-vs.ps1

+29-19
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ function download-php-deps {
306306
function build-snappy {
307307
write-library "snappy" $LIBSNAPPY_VER
308308
write-download
309-
(& cmd.exe /c "git clone -b $LIBSNAPPY_VER https://github.com/google/snappy $pwd 2>&1") >> $log_file
309+
(& cmd.exe /c "git clone -b $LIBSNAPPY_VER https://github.com/google/snappy snappy 2>&1") >> $log_file
310310
Push-Location snappy
311311

312312
(& cmd.exe /c "git submodule update --depth=1 --init 2>&1") >> $log_file
@@ -316,7 +316,7 @@ function build-snappy {
316316
-DCMAKE_PREFIX_PATH=`"$DEPS_DIR`"^`
317317
-DCMAKE_INSTALL_PREFIX=`"$DEPS_DIR`"^`
318318
-DCMAKE_BUILD_TYPE=`"$MSBUILD_CONFIGURATION`"^`
319-
`"$pwd`" || exit 1"
319+
. || exit 1"
320320

321321
write-compile
322322
sdk-command "cmake --build . || exit 1"
@@ -329,7 +329,7 @@ function build-snappy {
329329
function build-grpc {
330330
write-library "grpc" $LIBGRPC_VER
331331
write-download
332-
(& cmd.exe /c "git clone -b v$LIBGRPC_VER --depth=1 https://github.com/grpc/grpc $pwd 2>&1") >> $log_file
332+
(& cmd.exe /c "git clone -b v$LIBGRPC_VER --depth=1 https://github.com/grpc/grpc grpc 2>&1") >> $log_file
333333
Push-Location grpc
334334

335335
(& cmd.exe /c "git submodule update --depth=1 --init 2>&1") >> $log_file
@@ -347,16 +347,16 @@ function build-grpc {
347347
-DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF^`
348348
-DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF^`
349349
-DgRPC_SSL_PROVIDER=`"package`"^`
350-
-DgRPC_ZLIB_PROVIDER=`"package`"
351-
`"$pwd`" || exit 1"
350+
-DgRPC_ZLIB_PROVIDER=`"package`"^`
351+
. || exit 1"
352352

353353
write-compile
354354
sdk-command "cmake --build . || exit 1"
355355
write-install
356356
sdk-command "cmake -P cmake_install.cmake || exit 1"
357357

358-
Move-Item ".\third_party\protobuf\php\ext\google\protobuf" "$SOURCES_PATH\php-src\ext\protobuf" >> $log_file 2>&1
359-
Move-Item ".\third_party\protobuf\third_party" "$SOURCES_PATH\php-src\\ext\protobuf\third_party" >> $log_file 2>&1
358+
Move-Item "third_party\protobuf\php\ext\google\protobuf" "$SOURCES_PATH\php-src\ext\protobuf" >> $log_file 2>&1
359+
Move-Item "third_party\protobuf\third_party" "$SOURCES_PATH\php-src\ext\protobuf\third_party" >> $log_file 2>&1
360360

361361
@"
362362
ARG_ENABLE("protobuf", "Enable Protobuf extension", "yes");
@@ -368,7 +368,7 @@ if (PHP_PROTOBUF != "no") {
368368
369369
AC_DEFINE('HAVE_PROTOBUF', 1, '');
370370
}
371-
"@ | Out-File -Encoding UTF8 -FilePath $SOURCES_PATH\php-src\ext\protobuf\config.w32
371+
"@ | Out-File -Encoding ascii -FilePath $SOURCES_PATH\php-src\ext\protobuf\config.w32
372372

373373
write-done
374374
Pop-Location
@@ -380,15 +380,15 @@ function build-zstd {
380380
$file = download-file "https://github.com/facebook/zstd/archive/v$LIBZSTD_VER.zip" "zstd"
381381
write-extracting
382382
unzip-file $file $pwd
383-
Move-Item "zstd-$LIBYAML_VER" libyaml >> $log_file 2>&1
384-
Push-Location libyaml
383+
Move-Item "zstd-$LIBZSTD_VER" libzstd >> $log_file 2>&1
384+
Push-Location libzstd
385385

386386
write-configure
387387
sdk-command "cmake -G `"$CMAKE_TARGET`" -A `"$ARCH`"^`
388388
-DCMAKE_PREFIX_PATH=`"$DEPS_DIR`"^`
389389
-DCMAKE_INSTALL_PREFIX=`"$DEPS_DIR`"^`
390390
-DBUILD_SHARED_LIBS=ON^`
391-
`"$pwd`" || exit 1"
391+
`"$pwd\build\cmake`" || exit 1"
392392
write-compile
393393
sdk-command "msbuild ALL_BUILD.vcxproj /p:Configuration=$MSBUILD_CONFIGURATION /m || exit 1"
394394
write-install
@@ -411,6 +411,10 @@ function build_rdkafka {
411411
-DCMAKE_PREFIX_PATH=`"$DEPS_DIR`"^`
412412
-DCMAKE_INSTALL_PREFIX=`"$DEPS_DIR`"^`
413413
-DBUILD_SHARED_LIBS=ON^`
414+
-DWITH_ZSTD=ON^`
415+
-DWITH_SSL=ON^`
416+
-DWITH_CURL=OFF^`
417+
-DENABLE_LZ4_EXT=OFF^`
414418
`"$pwd`" || exit 1"
415419

416420
write-compile
@@ -576,6 +580,11 @@ function download-php-extensions {
576580
get-github-extension "zstd" $PHP_ZSTD_VER "kjdev" "php-ext-zstd"
577581
get-github-extension "grpc" $PHP_GRPC_VER "larryTheCoder" "php-grpc"
578582

583+
# Vanilla generator depend on this folder, the compiler will not be able
584+
# to find these dependencies if the folder name were to change
585+
Move-Item "ext-chunkutils2-$PHP_CHUNKUTILS2_VER" "chunkutils2" -Force
586+
Move-Item "ext-morton-$PHP_MORTON_VER" "morton" -Force
587+
579588
write-library "php-ext crypto" $PHP_CRYPTO_VER
580589
write-download
581590
(& cmd.exe /c "git clone https://github.com/bukka/php-crypto.git crypto 2>&1") >> $log_file
@@ -613,6 +622,7 @@ $DEPS_DIR="$SOURCES_PATH\deps"
613622
#custom libs depend on some standard libs, so prepare these first
614623
#a bit annoying because this part of the build is slow and makes it take longer to find problems
615624
download-php-deps
625+
download-php
616626

617627
$LIB_BUILD_DIR="$SOURCES_PATH\deps_build"
618628

@@ -632,7 +642,6 @@ build-libdeflate
632642

633643
cd $SOURCES_PATH >> $log_file 2>&1
634644

635-
download-php
636645
download-php-extensions
637646

638647
cd "$SOURCES_PATH\php-src"
@@ -666,11 +675,11 @@ sdk-command "configure^`
666675
--enable-opcache^`
667676
--enable-opcache-jit=$PHP_JIT_ENABLE_ARG^`
668677
--enable-phar^`
669-
--enable-vanillagenerator=shared^
670-
--enable-zstd^
671-
--enable-snappy^
672-
--enable-grpc=shared^
673-
--enable-protobuf=shared^
678+
--enable-vanillagenerator=shared^`
679+
--enable-zstd^`
680+
--enable-snappy^`
681+
--enable-grpc=shared^`
682+
--enable-protobuf=shared^`
674683
--enable-recursionguard=shared^`
675684
--enable-sockets^`
676685
--enable-tokenizer^`
@@ -721,8 +730,9 @@ Remove-Item "$SOURCES_PATH\php-src\$ARCH\Release_TS\php-$PHP_DISPLAY_VER\glib-*.
721730
Remove-Item "$SOURCES_PATH\php-src\$ARCH\Release_TS\php-$PHP_DISPLAY_VER\gmodule-*.dll" >> $log_file 2>&1
722731
Remove-Item -Recurse "$SOURCES_PATH\php-src\$ARCH\Release_TS\php-$PHP_DISPLAY_VER\lib\enchant\" >> $log_file 2>&1
723732

724-
Move-Item "$DEPS_DIR\grpc\cmake\build\grpc_php_plugin.exe" "$outpath\grpc\grpc_php_plugin.exe" >> $log_file 2>&1
725-
Move-Item "$DEPS_DIR\grpc\cmake\build\third_party\protobuf\protoc.exe" "$outpath\grpc\protoc.exe" >> $log_file 2>&1
733+
mkdir "$outpath\bin\grpc" >> $log_file 2>&1
734+
Move-Item "$LIB_BUILD_DIR\grpc\grpc_php_plugin.exe" "$outpath\bin\grpc\grpc_php_plugin.exe" >> $log_file 2>&1
735+
Move-Item "$LIB_BUILD_DIR\grpc\third_party\protobuf\protoc.exe" "$outpath\bin\grpc\protoc.exe" >> $log_file 2>&1
726736

727737
cd $outpath >> $log_file 2>&1
728738
Move-Item -Force "$SOURCES_PATH\php-src\$ARCH\$($OUT_PATH_REL)_TS\php-debug-pack-*.zip" $outpath

0 commit comments

Comments
 (0)
Please sign in to comment.