-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix PECL publish #85
Fix PECL publish #85
Changes from all commits
e5e998a
31a5785
82abc2d
1a0efbf
17b6a93
9ff650e
9de07ef
826974a
f6314a2
1f6f814
9de1d33
f183523
093cf4e
b6a3a29
08aa34b
3015509
279f5d2
a7e8407
02a6591
7d56d18
26ab397
8208b31
311edc6
2aae069
8455b69
babc4bf
3ad39d5
72c24d9
7c12d40
a28388f
ce4a00c
8c66121
e361f03
b116a18
c0ab711
c2f584a
ff20f95
b4d352c
a63ac28
a9ab031
6bc427d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
# ignore generated files | ||
ext/api.h | ||
ext/*_arginfo.h | ||
src/api.h |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,12 +30,6 @@ jobs: | |
with: | ||
submodules: recursive | ||
|
||
- 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: Build for PHP 5.5 | ||
env: | ||
CC: clang | ||
|
@@ -45,6 +39,12 @@ jobs: | |
./configure | ||
make | ||
|
||
- name: Install dependencies | ||
# get path to composer.phar so we can run it with custom php.ini | ||
run: | | ||
COMPOSER_PHAR=$(realpath $(which composer)) | ||
php -c php.ini $COMPOSER_PHAR update --no-interaction | ||
|
||
php-linux-x64: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
|
@@ -71,9 +71,6 @@ jobs: | |
with: | ||
submodules: recursive | ||
|
||
- name: Install dependencies | ||
run: composer update --no-interaction | ||
|
||
- name: Run tests | ||
env: | ||
CC: clang | ||
|
@@ -82,37 +79,50 @@ jobs: | |
phpize | ||
./configure | ||
make | ||
make test | ||
|
||
|
||
# linux-arm: | ||
# name: ARM (${{ matrix.arch }}) | ||
# runs-on: ubuntu-latest | ||
# strategy: | ||
# matrix: | ||
# arch: [armv6, armv7, arm64] | ||
# steps: | ||
# - name: Build ${{ env.PACKAGE_NAME }} | ||
# 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 }} --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 | ||
./dev-scripts/run_tests.sh | ||
|
||
# linux-arm: | ||
# name: ARM (${{ matrix.arch }}) | ||
# runs-on: ubuntu-latest | ||
# strategy: | ||
# matrix: | ||
# arch: [armv6, armv7, arm64] | ||
# steps: | ||
# - name: Build ${{ env.PACKAGE_NAME }} | ||
# 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 }} --target=linux-${{ matrix.arch }} --spec=downstream | ||
|
||
windows-vc16: | ||
runs-on: windows-2019 | ||
defaults: | ||
run: | ||
shell: cmd # use CMD instead of powershell to catch error from bat script | ||
strategy: | ||
matrix: | ||
arch: [x64] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confused: Why only x64? Is this a todo for 32bit? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, maybe should leave it as a TODO. Again, just being lazy as no current ask and it's probably work. |
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- id: setup-php-sdk | ||
uses: cmb69/setup-php-sdk@v0.6 | ||
with: | ||
version: '8.0' | ||
arch: ${{ matrix.arch }} | ||
ts: ts | ||
waahm7 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
deps: openssl | ||
- uses: ilammy/msvc-dev-cmd@v1 | ||
with: | ||
arch: ${{ matrix.arch }} | ||
toolset: ${{steps.setup-php-sdk.outputs.toolset}} | ||
# not sure why CMD can't do multiline run statements | ||
- run: phpize | ||
- run: .\configure --with-prefix=${{steps.setup-php-sdk.outputs.prefix}} --enable-awscrt=shared --enable-cli --enable-openssl | ||
- run: nmake | ||
- run: nmake generate-php-ini | ||
- run: .\dev-scripts\run_tests.bat ${{steps.setup-php-sdk.outputs.prefix}}\php | ||
|
||
# windows-vc14: | ||
# runs-on: windows-latest | ||
|
@@ -154,3 +164,25 @@ jobs: | |
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 | ||
|
||
pecl-package-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.0' | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Test PECL package build | ||
run: | | ||
python3 dev-scripts/prepare_pecl_release.py --name aws-crt --user aws-crt --version 1.0.0 | ||
tar -zxf *.tgz | ||
cd awscrt-1.0.0 | ||
phpize | ||
./configure | ||
make |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,8 +27,8 @@ CMAKE_BUILD = CMAKE_BUILD_PARALLEL_LEVEL='' $(CMAKE) --build | |
CMAKE_BUILD_TYPE ?= RelWithDebInfo | ||
CMAKE_TARGET = --config $(CMAKE_BUILD_TYPE) --target install | ||
|
||
all: extension | ||
.PHONY: all extension | ||
all: extension | ||
.PHONY: all extension | ||
|
||
# configure for static aws-crt-ffi.a | ||
build/aws-crt-ffi-static/CMakeCache.txt: | ||
|
@@ -46,19 +46,17 @@ ext/awscrt.lo: ext/awscrt.c | |
|
||
ext/awscrt.c: build/aws-crt-ffi-static/libaws-crt-ffi.a ext/api.h ext/awscrt_arginfo.h | ||
|
||
ext/awscrt_arginfo.h: ext/awscrt.stub.php gen_stub.php | ||
ext/awscrt_arginfo.h: awscrt.stub.php gen_stub.php | ||
ifeq ($(GENERATE_STUBS),1) | ||
# install awscrt.stub.php to ext/ | ||
cp -v awscrt.stub.php ext/awscrt.stub.php | ||
Comment on lines
+51
to
+52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? We moved this to the main folder instead of ext/ and making a copy here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PECL removes .php from subdirectory, but not from the root directory. So, move it outside the ext/ is the easiest way. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need this in ext/? I am just confused about why do we need this file at two places. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This part will generate the awscrt_arginfo.h into the same folder as |
||
# generate awscrt_arginfo.h | ||
php gen_stub.php --minimal-arginfo ext/awscrt.stub.php | ||
endif | ||
|
||
# transform/install api.h from FFI lib | ||
src/api.h: crt/aws-crt-ffi/src/api.h | ||
php gen_api.php crt/aws-crt-ffi/src/api.h > src/api.h | ||
|
||
# install api.h to ext/ as well | ||
ext/api.h : src/api.h | ||
cp -v src/api.h ext/api.h | ||
ext/api.h : crt/aws-crt-ffi/src/api.h | ||
php gen_api.php crt/aws-crt-ffi/src/api.h > ext/api.h | ||
|
||
ext/php_aws_crt.h: ext/awscrt_arginfo.h ext/api.h | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,6 @@ | |
"NO_INTERACTION": "1" | ||
}, | ||
"test_steps": [ | ||
["./run_tests"] | ||
["./dev-scripts/run_tests.sh"] | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import os | ||
import glob | ||
import shutil | ||
|
||
TOOLS_DIR = os.path.dirname(os.path.abspath(__file__)) | ||
WORK_DIR = os.path.join(TOOLS_DIR, '..') | ||
|
||
# Remove specified directories | ||
DIRS_TO_REMOVE = [ | ||
'.deps', | ||
'.libs', | ||
'build', | ||
'include', | ||
'modules', | ||
'vendor', | ||
'autom4te.cache'] | ||
|
||
# Remove specified files | ||
FILES_TO_REMOVE = [ | ||
'Makefile', | ||
'Makefile.fragments', | ||
'Makefile.global', | ||
'Makefile.objects', | ||
'config.guess', | ||
'config.h', | ||
'config.h.in', | ||
'config.log', | ||
'config.nice', | ||
'config.status', | ||
'config.sub', | ||
'configure', | ||
'configure.in', | ||
'configure.ac', | ||
'install-sh', | ||
'libtool', | ||
'ltmain.sh', | ||
'missing', | ||
'mkinstalldirs', | ||
'run-tests.php', | ||
'awscrt.la', | ||
'composer.lock', | ||
'ext/awscrt.stub.php', | ||
'acinclude.m4', | ||
'aclocal.m4', | ||
'**/*.lo', | ||
'**/*.o', | ||
'**/*.la', | ||
'**/*.a', | ||
'*.tgz'] | ||
|
||
os.chdir(WORK_DIR) | ||
|
||
|
||
for directory in DIRS_TO_REMOVE: | ||
shutil.rmtree(directory, ignore_errors=True) | ||
|
||
for pattern in FILES_TO_REMOVE: | ||
for filepath in glob.glob(pattern): | ||
os.remove(filepath) | ||
graebm marked this conversation as resolved.
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debateable: // TODO run tests (if we are officially supporting 5.5 for now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should ask when we can drop support for older versions of PHP. If it's something like 1-2 months away, we can drop support now and sdk-php can pick up new changes later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave the php version related stuff as a follow up item, I have listed some TODOs in the description of the PR.