Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Win x86 #77

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitallowed
@@ -0,0 +1 @@
crt/*
250 changes: 136 additions & 114 deletions .github/workflows/ci.yml
Expand Up @@ -14,75 +14,75 @@ env:
RUN: ${{ github.run_id }}-${{ github.run_number }}

jobs:
php-5_5-linux-x64:
name: php-linux-x64 (5.5)
runs-on: ubuntu-latest
steps:
- name: Setup PHP with Xdebug
uses: shivammathur/setup-php@v2
with:
coverage: xdebug
php-version: 5.5
ini-values: xdebug.overload_var_dump=0, memory_limit=4G, phar.readonly=false
# php-5_5-linux-x64:
# name: php-linux-x64 (5.5)
# runs-on: ubuntu-latest
# steps:
# - name: Setup PHP with Xdebug
# uses: shivammathur/setup-php@v2
# with:
# coverage: xdebug
# php-version: 5.5
# ini-values: xdebug.overload_var_dump=0, memory_limit=4G, phar.readonly=false

- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
# - name: Checkout
# uses: actions/checkout@v2
# with:
# submodules: recursive

- name: Install ancient PHPUnit
run: composer require --dev --ignore-platform-reqs phpunit/phpunit "4.8.36"
# - name: Install ancient PHPUnit
# run: composer require --dev --ignore-platform-reqs phpunit/phpunit "4.8.36"

- name: Install dependencies
run: composer update --no-interaction
# - name: Install dependencies
# run: composer update --no-interaction

- name: Build for PHP 5.5
env:
CC: clang
CXX: clang++
run: |
phpize
./configure
make
# - name: Build for PHP 5.5
# env:
# CC: clang
# CXX: clang++
# run: |
# phpize
# ./configure
# make

php-linux-x64:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- "5.6"
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
steps:
- 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
# php-linux-x64:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# version:
# - "5.6"
# - "7.0"
# - "7.1"
# - "7.2"
# - "7.3"
# - "7.4"
# - "8.0"
# steps:
# - 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: Checkout
# uses: actions/checkout@v2
# with:
# submodules: recursive

- name: Install dependencies
run: composer update --no-interaction
# - name: Install dependencies
# run: composer update --no-interaction

- name: Run tests
env:
CC: clang
CXX: clang++
run: |
phpize
./configure
make
make test
# - name: Run tests
# env:
# CC: clang
# CXX: clang++
# run: |
# phpize
# ./configure
# make
# make test


# linux-arm:
Expand All @@ -98,59 +98,81 @@ jobs:
# chmod a+x builder
# ./builder build -p ${{ env.PACKAGE_NAME }} --target=linux-${{ matrix.arch }} --spec=downstream

# windows-vc16:
# runs-on: windows-latest
# strategy:
# matrix:
# arch: [x64]
# steps:
# - uses: ilammy/msvc-dev-cmd@v1
# with:
# arch: ${{ matrix.arch }}
# uwp: false
# spectre: true
# - name: Build ${{ env.PACKAGE_NAME }} + consumers
# run: |
# python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
# python builder.pyz build -p ${{ env.PACKAGE_NAME }} --spec=downstream

# windows-vc14:
# runs-on: windows-latest
# strategy:
# matrix:
# arch: [x86, x64]
# steps:
# - uses: ilammy/msvc-dev-cmd@v1
# with:
# toolset: 14.0
# arch: ${{ matrix.arch }}
# uwp: false
# spectre: true
# - name: Build ${{ env.PACKAGE_NAME }} + consumers
# run: |
# python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')"
# python builder.pyz build -p ${{ env.PACKAGE_NAME }} downstream

macos:
runs-on: macos-${{ matrix.version }}
windows:
runs-on: windows-2019
defaults:
run:
shell: cmd # TODO: does this matter?
strategy:
matrix:
arch: [x64] # TODO: add x86
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- id: setup-php-sdk
uses: cmb69/setup-php-sdk@v0.6
with:
version: '8.0'
arch: x64
ts: ts
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
toolset: ${{steps.setup-php-sdk.outputs.toolset}}
- run: phpize
- run: .\configure --with-prefix=${{steps.setup-php-sdk.outputs.prefix}} --enable-awscrt=shared
- run: nmake
- run: nmake test-awscrt

windows2:
runs-on: windows-2019
defaults:
run:
shell: cmd # TODO: does this matter?
strategy:
matrix:
version: [10.15]
arch: [x64] # TODO: add x86
steps:
# Force PHP to 8.0
# Doing this because tests fail in PHP 8.1 (default on macos Github Runner as of Dec 2021)
# due to the old version of PHPUnit we're using.
# We're using an old PHPUnit because it's compatible our min supported PHP 5.5.
# Quick fix is to force PHP version back to 8.0, which can still run our tests without error.
# A real solution is to get our tests working on all PHP versions
# (maybe don't use PHPUnit, maybe raise our min supported PHP version so we can upgrade,
# or maybe use PHPUnit-Polyfills so we can use a modern PHPUnit with old PHP)
- name: Setup PHP 8.0
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
- name: Build PHP 8 extension and test
run: |
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
chmod a+x builder
./builder build -p ${{ env.PACKAGE_NAME }} --spec=downstream
- uses: actions/checkout@v3
with:
submodules: recursive
- id: setup-php-sdk
uses: cmb69/setup-php-sdk@v0.6
with:
version: '8.0'
arch: x64
ts: ts
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
toolset: ${{steps.setup-php-sdk.outputs.toolset}}
- run: php --version
- run: where.exe php.exe
- run: ${{steps.setup-php-sdk.outputs.prefix}}\php.exe --version
- run: where.exe composer
- run: where.exe composer.phar

# macos:
# runs-on: macos-${{ matrix.version }}
# strategy:
# matrix:
# version: [10.15]
# steps:
# # Force PHP to 8.0
# # Doing this because tests fail in PHP 8.1 (default on macos Github Runner as of Dec 2021)
# # due to the old version of PHPUnit we're using.
# # We're using an old PHPUnit because it's compatible our min supported PHP 5.5.
# # Quick fix is to force PHP version back to 8.0, which can still run our tests without error.
# # A real solution is to get our tests working on all PHP versions
# # (maybe don't use PHPUnit, maybe raise our min supported PHP version so we can upgrade,
# # or maybe use PHPUnit-Polyfills so we can use a modern PHPUnit with old PHP)
# - name: Setup PHP 8.0
# uses: shivammathur/setup-php@v2
# with:
# php-version: '8.0'
# - name: Build PHP 8 extension and test
# run: |
# python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')"
# chmod a+x builder
# ./builder build -p ${{ env.PACKAGE_NAME }} --spec=downstream
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -182,6 +182,8 @@ fabric.properties
build/
configure.in
configure.ac
configure.bat
configure.js
mkinstalldirs
run-tests.php
Makefile.global
Expand All @@ -191,12 +193,14 @@ modules/
*.lo
config.h
config.nice
config.nice.bat
*.la
Makefile*
!Makefile.am
!Makefile.frag
!Makefile.frag.w32
/vendor/
/x64/
.idea/
.DS_Store
composer.lock
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -18,7 +18,7 @@
"php": ">=5.5"
},
"require-dev": {
"phpunit/phpunit":"^4.8.35|^5.6.3"
"phpunit/phpunit":"^5.6.3"
},
"autoload": {
"classmap": [
Expand Down
4 changes: 2 additions & 2 deletions config.w32
Expand Up @@ -5,8 +5,8 @@ ARG_ENABLE("awscrt", "Include AWS Common Runtime support", "yes");
if (PHP_AWSCRT != "no") {
ADD_MAKEFILE_FRAGMENT();
DEFINE('CFLAGS_AWSCRT', '/I ' + configure_module_dirname + '\\build\\install\\include');
DEFINE('LIBS_AWSCRT', '/LIBPATH:' + configure_module_dirname + '\\build\\install\\lib ' +
'aws-crt-ffi.lib aws-c-auth.lib aws-c-http.lib aws-c-io.lib aws-c-cal.lib aws-c-compression.lib aws-c-common.lib ' +
DEFINE('LIBS_AWSCRT', '/LIBPATH:' + configure_module_dirname + '\\build\\install\\lib ' +
'aws-crt-ffi.lib aws-c-auth.lib aws-c-http.lib aws-c-io.lib aws-c-cal.lib aws-c-compression.lib aws-checksums.lib aws-c-common.lib ' +
'ncrypt.lib Secur32.lib Crypt32.lib Shlwapi.lib');
DEFINE('AWSCRT_DIR', configure_module_dirname);
EXTENSION("awscrt", "ext\\awscrt.c", PHP_AWSCRT_SHARED);
Expand Down
2 changes: 2 additions & 0 deletions php-win.ini
@@ -1,2 +1,4 @@
extension_dir="ext"
extension=php_awscrt.dll
extension=php_openssl.dll
extension=php_mbstring.dll