mirror of
https://github.com/awslabs/aws-crt-php.git
synced 2026-08-17 17:47:12 +00:00
Made PHP extension compile with openssl by default (#41)
* Made PHP extension compile with openssl * Use catchsegv to dump a callstack * Updated to use aws_crt_crypto_share() * Much faster builds by making cmake parallel if supported * Make sure all CRT threads shutdown prior to cleanup * USE_OPENSSL should be the path to openssldir * Updated to aws-crt-ffi v0.2.4
This commit is contained in:
@@ -37,14 +37,14 @@ jobs:
|
|||||||
- name: Install depedencies
|
- name: Install depedencies
|
||||||
run: composer update --no-interaction
|
run: composer update --no-interaction
|
||||||
|
|
||||||
- name: Run tests
|
- name: Build for PHP 5.5
|
||||||
env:
|
env:
|
||||||
CC: clang
|
CC: clang
|
||||||
CXX: clang++
|
CXX: clang++
|
||||||
run: |
|
run: |
|
||||||
phpize
|
phpize
|
||||||
./configure
|
./configure
|
||||||
make test
|
make
|
||||||
|
|
||||||
php-linux-x64:
|
php-linux-x64:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -60,12 +60,30 @@ jobs:
|
|||||||
- "7.4"
|
- "7.4"
|
||||||
- "8.0"
|
- "8.0"
|
||||||
steps:
|
steps:
|
||||||
- name: PHP ${{ matrix.version}} Extension
|
- name: Setup PHP with Xdebug
|
||||||
|
uses: shivammathur/setup-php@v2
|
||||||
|
with:
|
||||||
|
coverage: xdebug
|
||||||
|
php-version: ${{matrix.version}}
|
||||||
|
ini-values: xdebug.overload_var_dump=0, memory_limit=4G, phar.readonly=false
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Install depedencies
|
||||||
|
run: composer update --no-interaction
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
env:
|
||||||
|
CC: clang
|
||||||
|
CXX: clang++
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u awslabs --password-stdin
|
phpize
|
||||||
export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/aws-crt-php${{ matrix.version }}-linux-x64:${{ env.BUILDER_VERSION }}
|
./configure
|
||||||
docker pull $DOCKER_IMAGE
|
make
|
||||||
docker run --env GITHUB_REF --env LC_ALL=C.UTF-8 $DOCKER_IMAGE --version=${{env.BUILDER_VERSION}} build -p ${{ env.PACKAGE_NAME }} --spec=downstream --skip-install
|
make test
|
||||||
|
|
||||||
|
|
||||||
# linux-arm:
|
# linux-arm:
|
||||||
|
|||||||
@@ -16,3 +16,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
# List of extensions to check
|
# List of extensions to check
|
||||||
extensions: c
|
extensions: c
|
||||||
|
|
||||||
|
check-submodules:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout Source
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Check Submodules
|
||||||
|
uses: awslabs/aws-crt-builder/.github/actions/check-submodules@main
|
||||||
+17
-2
@@ -7,8 +7,23 @@ ifeq (, $(shell which cmake3))
|
|||||||
CMAKE = cmake
|
CMAKE = cmake
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CMAKE_CONFIGURE = $(CMAKE) -DCMAKE_INSTALL_PREFIX=$(INT_DIR) -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
|
# default to using system OpenSSL, if disabled aws-lc will be used
|
||||||
CMAKE_BUILD = $(CMAKE) --build
|
USE_OPENSSL ?= ON
|
||||||
|
ifneq (OFF,$(USE_OPENSSL))
|
||||||
|
CMAKE_USE_OPENSSL=-DUSE_OPENSSL=ON
|
||||||
|
# if a path was provided, add it to CMAKE_PREFIX_PATH
|
||||||
|
ifneq (ON,$(USE_OPENSSL))
|
||||||
|
CMAKE_PREFIX_PATH=-DCMAKE_PREFIX_PATH=$(USE_OPENSSL)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
CMAKE_CONFIGURE = $(CMAKE) \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=$(INT_DIR) \
|
||||||
|
-DBUILD_TESTING=OFF \
|
||||||
|
-DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) \
|
||||||
|
$(CMAKE_USE_OPENSSL) \
|
||||||
|
$(CMAKE_PREFIX_PATH)
|
||||||
|
CMAKE_BUILD = CMAKE_BUILD_PARALLEL_LEVEL='' $(CMAKE) --build
|
||||||
CMAKE_BUILD_TYPE ?= RelWithDebInfo
|
CMAKE_BUILD_TYPE ?= RelWithDebInfo
|
||||||
CMAKE_TARGET = --config $(CMAKE_BUILD_TYPE) --target install
|
CMAKE_TARGET = --config $(CMAKE_BUILD_TYPE) --target install
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ if test "$PHP_AWSCRT" != "no"; then
|
|||||||
if uname -a | grep -i darwin > /dev/null 2>&1; then
|
if uname -a | grep -i darwin > /dev/null 2>&1; then
|
||||||
platform_tls_libs=""
|
platform_tls_libs=""
|
||||||
else
|
else
|
||||||
platform_tls_libs="-ls2n -l:libcrypto.a"
|
platform_tls_libs="-ls2n -lcrypto"
|
||||||
fi
|
fi
|
||||||
CRT_LIBPATHS="-L${cwd}/build/install/lib -L${cwd}/build/install/lib64"
|
CRT_LIBPATHS="-L${cwd}/build/install/lib -L${cwd}/build/install/lib64"
|
||||||
CRT_LIBS="-laws-crt-ffi -laws-c-auth -laws-c-http -laws-c-io -laws-c-cal -laws-c-compression -laws-checksums -laws-c-common ${platform_tls_libs}"
|
CRT_LIBS="-laws-crt-ffi -laws-c-auth -laws-c-http -laws-c-io -laws-c-cal -laws-c-compression -laws-checksums -laws-c-common ${platform_tls_libs}"
|
||||||
|
|||||||
+1
-1
Submodule crt/aws-crt-ffi updated: 94e82ef7b4...aecdb91b85
@@ -241,6 +241,8 @@ PHP_INI_END()
|
|||||||
static PHP_MINIT_FUNCTION(awscrt) {
|
static PHP_MINIT_FUNCTION(awscrt) {
|
||||||
REGISTER_INI_ENTRIES();
|
REGISTER_INI_ENTRIES();
|
||||||
|
|
||||||
|
/* prevent s2n from initializing/de-initializing OpenSSL/libcrypto */
|
||||||
|
aws_crt_crypto_share();
|
||||||
aws_crt_init();
|
aws_crt_init();
|
||||||
aws_php_thread_queue_init(&s_aws_php_main_thread_queue);
|
aws_php_thread_queue_init(&s_aws_php_main_thread_queue);
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
@@ -249,6 +251,7 @@ static PHP_MINIT_FUNCTION(awscrt) {
|
|||||||
static PHP_MSHUTDOWN_FUNCTION(awscrt) {
|
static PHP_MSHUTDOWN_FUNCTION(awscrt) {
|
||||||
UNREGISTER_INI_ENTRIES();
|
UNREGISTER_INI_ENTRIES();
|
||||||
aws_php_thread_queue_clean_up(&s_aws_php_main_thread_queue);
|
aws_php_thread_queue_clean_up(&s_aws_php_main_thread_queue);
|
||||||
|
aws_crt_thread_join_all(0);
|
||||||
aws_crt_clean_up();
|
aws_crt_clean_up();
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
|
launcher=
|
||||||
|
if command -v catchsegv; then
|
||||||
|
launcher=catchsegv
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z $PHP_BINARY ]; then
|
if [ -z $PHP_BINARY ]; then
|
||||||
PHP_BINARY=$(which php)
|
PHP_BINARY=$(which php)
|
||||||
fi
|
fi
|
||||||
@@ -10,5 +15,4 @@ if [ ! -d vendor ]; then
|
|||||||
composer update
|
composer update
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$PHP_BINARY -c php.ini vendor/bin/phpunit tests --debug
|
$launcher $PHP_BINARY -c php.ini vendor/bin/phpunit tests --debug
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user