From 2aaf2499eb04c804f5ec319bea94796a209be32e Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Sat, 17 Sep 2022 17:25:06 -0400 Subject: [PATCH 1/9] Mention this supports newer php versions in package.xml --- package.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.xml b/package.xml index 86385fb..d666d25 100644 --- a/package.xml +++ b/package.xml @@ -2,8 +2,8 @@ ast pecl.php.net - Extension exposing PHP 7 abstract syntax tree - php-ast exports the AST internally used by PHP 7. + Extension exposing PHP 7+ abstract syntax tree + php-ast exports the AST internally used by PHP 7+. php-ast is significantly faster than PHP-Parser, because the AST construction is implemented in C. However, php-ast may only parse code that is syntactically valid on the version of PHP it runs on. From 89c1ed1f6fcfab2988717684dbcb0d968fa89679 Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Sun, 16 Oct 2022 18:07:53 -0400 Subject: [PATCH 2/9] Add steps for publishing dlls on a release --- .github/workflows/build_dlls.yml | 62 ++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/build_dlls.yml diff --git a/.github/workflows/build_dlls.yml b/.github/workflows/build_dlls.yml new file mode 100644 index 0000000..2817e1c --- /dev/null +++ b/.github/workflows/build_dlls.yml @@ -0,0 +1,62 @@ +name: Build DLLs +# Based on https://github.com/TysonAndre/ast/blob/main/.github/workflows/build_dlls.yml +# which is based on https://github.com/krakjoe/apcu/blob/master/.github/workflows/config.yml +# Builds DLLs for 64-bit php. +# See https://windows.php.net/ - At this time, the windows PHP team no longer has access to the machine used to build dlls. + +on: + # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release + release: + types: [published] + +jobs: + windows: + defaults: + run: + shell: cmd + strategy: + matrix: + version: ["7.2", "7.3", "7.4", "8.0", "8.1", "8.2"] + arch: [x64] + ts: [nts, ts] + runs-on: windows-latest + steps: + - name: Checkout ast + uses: actions/checkout@v2 + - name: Setup PHP + id: setup-php + uses: cmb69/setup-php-sdk@v0.6 + with: + version: ${{matrix.version}} + arch: ${{matrix.arch}} + ts: ${{matrix.ts}} + - name: Enable Developer Command Prompt + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{matrix.arch}} + toolset: ${{steps.setup-php.outputs.toolset}} + - name: phpize + run: phpize + - name: configure + run: configure --enable-ast --enable-debug-pack --with-prefix=${{steps.setup-php.outputs.prefix}} + - name: make + run: nmake + # Run tests, failing if they fail. REPORT_EXIT_STATUS=1 is the default for tests in php 7.2+ + - name: test + run: nmake test TESTS="--show-diff tests" + - name: package + run: | + md .install + copy LICENSE README.md .install + if exist x64 ( + if exist x64\Release (set prefix=x64\Release) else set prefix=x64\Release_TS + ) else ( + if exist Release (set prefix=Release) else set prefix=Release_TS + ) + copy %prefix%\php_ast.dll .install + copy %prefix%\php_ast.pdb .install + - name: Upload artifacts + uses: actions/upload-artifact@v3.1.0 + with: + name: ast-Windows-${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}} + path: .install From 6640877f2c4a74316d59d56abca70ee74aaa744a Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Sun, 16 Oct 2022 18:23:56 -0400 Subject: [PATCH 3/9] 1.1.1: Update the RELEASE_CHECKLIST Start creating releases again, to have something to attach the artifacts for Windows to --- .github/workflows/main.yml | 2 +- RELEASE_CHECKLIST | 3 ++- package.xml | 4 ++-- php_ast.h | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 226abac..a663694 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,7 +32,7 @@ jobs: - PHP_VERSION: '7.4' - PHP_VERSION: '8.0' - PHP_VERSION: '8.1' - - PHP_VERSION: '8.2.0beta2' + - PHP_VERSION: '8.2.0RC4' # Steps represent a sequence of tasks that will be executed as part of the job steps: diff --git a/RELEASE_CHECKLIST b/RELEASE_CHECKLIST index f5d5807..12b7181 100644 --- a/RELEASE_CHECKLIST +++ b/RELEASE_CHECKLIST @@ -4,7 +4,8 @@ * Run `pecl package package.xml`. * Run `pecl install ast-XXX.tgz`. * Commit. -* Create a tag. +* Create a release on github. +* Attach Windows artifacts from GitHub Actions to the release. * Bump version in php_ast.h and add dev suffix. * Copy release in package.xml into changelog. * Clear current changelog, bump versions and add dev suffix. diff --git a/package.xml b/package.xml index d666d25..076a522 100644 --- a/package.xml +++ b/package.xml @@ -18,7 +18,7 @@ tandre@php.net yes - 2022-08-09 + 2022-10-16 1.1.1dev 1.1.1dev @@ -29,7 +29,7 @@ BSD-3-Clause -- TBD +- Set up actions to generate DLLs for Windows in CI on https://github.com/nikic/php-ast diff --git a/php_ast.h b/php_ast.h index 88d91cc..6a03961 100644 --- a/php_ast.h +++ b/php_ast.h @@ -7,7 +7,7 @@ extern zend_module_entry ast_module_entry; #define phpext_ast_ptr &ast_module_entry -#define PHP_AST_VERSION "1.1.1-dev" +#define PHP_AST_VERSION "1.1.1" #ifdef PHP_WIN32 # define PHP_AST_API __declspec(dllexport) From cb063ef59c72bf11779f292cb65f7807814d5fc7 Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Sun, 16 Oct 2022 18:34:32 -0400 Subject: [PATCH 4/9] Start testing php 8.2.0RC4 in appveyor --- .appveyor.yml | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 5243ddb..68e42bb 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -32,42 +32,52 @@ environment: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 ARCH: x86 VC: vs16 - PHP_VER: 8.1.0 + PHP_VER: 8.2.0RC4 TS: 1 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 ARCH: x64 VC: vs16 - PHP_VER: 8.1.0 + PHP_VER: 8.2.0RC4 + TS: 0 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + ARCH: x86 + VC: vs16 + PHP_VER: 8.1.11 + TS: 1 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + ARCH: x64 + VC: vs16 + PHP_VER: 8.1.11 TS: 1 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 ARCH: x86 VC: vs16 - PHP_VER: 8.1.0 + PHP_VER: 8.1.11 TS: 0 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 ARCH: x64 VC: vs16 - PHP_VER: 8.1.0 + PHP_VER: 8.1.11 TS: 0 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 ARCH: x86 VC: vs16 - PHP_VER: 8.0.13 + PHP_VER: 8.0.24 TS: 1 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 ARCH: x64 VC: vs16 - PHP_VER: 8.0.13 + PHP_VER: 8.0.24 TS: 1 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 ARCH: x86 VC: vs16 - PHP_VER: 8.0.13 + PHP_VER: 8.0.24 TS: 0 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 ARCH: x64 VC: vs16 - PHP_VER: 8.0.13 + PHP_VER: 8.0.24 TS: 0 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 ARCH: x64 @@ -112,22 +122,22 @@ environment: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 ARCH: x64 VC: vc15 - PHP_VER: 7.4.26 + PHP_VER: 7.4.32 TS: 0 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 ARCH: x64 VC: vc15 - PHP_VER: 7.4.26 + PHP_VER: 7.4.32 TS: 1 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 ARCH: x86 VC: vc15 - PHP_VER: 7.4.26 + PHP_VER: 7.4.32 TS: 0 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 ARCH: x86 VC: vc15 - PHP_VER: 7.4.26 + PHP_VER: 7.4.32 TS: 1 build_script: From cfecc2745c68335badfa63a0fae223463cbf98dc Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Sun, 16 Oct 2022 18:42:42 -0400 Subject: [PATCH 5/9] [skip ci] Put the ast release version in the file name Avoid ambiguity and put `php-` and `ast-` before the corresponding version (e.g. avoid calling it Windows-8.1 for php 8.1). These will be on a release page with artifacts for other platforms --- .github/workflows/build_dlls.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_dlls.yml b/.github/workflows/build_dlls.yml index 2817e1c..7184a1a 100644 --- a/.github/workflows/build_dlls.yml +++ b/.github/workflows/build_dlls.yml @@ -58,5 +58,5 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v3.1.0 with: - name: ast-Windows-${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}} + name: ast-${{github.ref}}-Windows-php-${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}} path: .install From 78dea634782979da57ea725ee6d157ffca9ece20 Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Sun, 16 Oct 2022 18:46:22 -0400 Subject: [PATCH 6/9] [skip ci] Fix url --- .github/workflows/build_dlls.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_dlls.yml b/.github/workflows/build_dlls.yml index 7184a1a..f8cd924 100644 --- a/.github/workflows/build_dlls.yml +++ b/.github/workflows/build_dlls.yml @@ -1,5 +1,5 @@ name: Build DLLs -# Based on https://github.com/TysonAndre/ast/blob/main/.github/workflows/build_dlls.yml +# Based on https://github.com/TysonAndre/var_representation/blob/main/.github/workflows/build_dlls.yml # which is based on https://github.com/krakjoe/apcu/blob/master/.github/workflows/config.yml # Builds DLLs for 64-bit php. # See https://windows.php.net/ - At this time, the windows PHP team no longer has access to the machine used to build dlls. From f532f350426f1a91a318f26650be4d196cbb7123 Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Sun, 16 Oct 2022 20:37:12 -0400 Subject: [PATCH 7/9] Use ref_name instead --- .github/workflows/build_dlls.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_dlls.yml b/.github/workflows/build_dlls.yml index f8cd924..3e8316d 100644 --- a/.github/workflows/build_dlls.yml +++ b/.github/workflows/build_dlls.yml @@ -58,5 +58,5 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v3.1.0 with: - name: ast-${{github.ref}}-Windows-php-${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}} + name: ast-${{github.ref_name}}-Windows-php-${{matrix.version}}-${{matrix.arch}}-${{matrix.ts}} path: .install From 4f0060415af92dddac9314447b2743b7e8870703 Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Tue, 18 Oct 2022 00:20:52 -0400 Subject: [PATCH 8/9] [skip ci] Add note about the PHP for Windows team --- package.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.xml b/package.xml index 076a522..c2372ba 100644 --- a/package.xml +++ b/package.xml @@ -30,6 +30,8 @@ BSD-3-Clause - Set up actions to generate DLLs for Windows in CI on https://github.com/nikic/php-ast + + NOTE: The PHP for Windows team is working on getting dlls built again for pecl extensions. Those should be used instead on Windows once they are available. See https://windows.php.net/ From 77e958bd4321403b30d5bf0ef7385883e29ad4b4 Mon Sep 17 00:00:00 2001 From: Tyson Andre Date: Tue, 18 Oct 2022 00:21:50 -0400 Subject: [PATCH 9/9] [skip ci] Update package.xml version --- package.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.xml b/package.xml index c2372ba..7e7b7d5 100644 --- a/package.xml +++ b/package.xml @@ -18,10 +18,10 @@ tandre@php.net yes - 2022-10-16 + 2022-10-18 - 1.1.1dev - 1.1.1dev + 1.1.1 + 1.1.1 stable