Merge pull request #18668 from stanley-cheung/php-fix-windows-build

PHP: fix windows build
pull/18676/head
Stanley Cheung 6 years ago committed by GitHub
commit be78a02ef2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/php/bin/run_tests.sh
  2. 8
      src/php/ext/grpc/php_grpc.c

@ -22,16 +22,17 @@ cd src/php/bin
source ./determine_extension_dir.sh
# in some jenkins macos machine, somehow the PHP build script can't find libgrpc.dylib
export DYLD_LIBRARY_PATH=$root/libs/$CONFIG
php $extension_dir -d max_execution_time=300 $(which phpunit) -v --debug \
$(which php) $extension_dir -d max_execution_time=300 $(which phpunit) -v --debug \
--exclude-group persistent_list_bound_tests ../tests/unit_tests
php $extension_dir -d max_execution_time=300 $(which phpunit) -v --debug \
$(which php) $extension_dir -d max_execution_time=300 $(which phpunit) -v --debug \
../tests/unit_tests/PersistentChannelTests
export ZEND_DONT_UNLOAD_MODULES=1
export USE_ZEND_ALLOC=0
# Detect whether valgrind is executable
if [ -x "$(command -v valgrind)" ]; then
valgrind --error-exitcode=10 --leak-check=yes php $extension_dir -d max_execution_time=300 \
$(which valgrind) --error-exitcode=10 --leak-check=yes \
$(which php) $extension_dir -d max_execution_time=300 \
../tests/MemoryLeakTest/MemoryLeakTest.php
fi

@ -205,11 +205,15 @@ void register_fork_handlers() {
void apply_ini_settings() {
if (GRPC_G(enable_fork_support)) {
setenv("GRPC_ENABLE_FORK_SUPPORT", "1", 1 /* overwrite? */);
putenv("GRPC_ENABLE_FORK_SUPPORT=1");
}
if (GRPC_G(poll_strategy)) {
setenv("GRPC_POLL_STRATEGY", GRPC_G(poll_strategy), 1 /* overwrite? */);
char *poll_str = malloc(sizeof("GRPC_POLL_STRATEGY=") +
strlen(GRPC_G(poll_strategy)));
strcpy(poll_str, "GRPC_POLL_STRATEGY=");
strcat(poll_str, GRPC_G(poll_strategy));
putenv(poll_str);
}
}

Loading…
Cancel
Save