diff --git a/.github/actions/build-mac/action.yml b/.github/actions/build-mac/action.yml index 770222f6..1ff98e49 100644 --- a/.github/actions/build-mac/action.yml +++ b/.github/actions/build-mac/action.yml @@ -37,9 +37,12 @@ runs: - name: Enable Zephir Parser shell: bash run: | + php --ini cp ./modules/zephir_parser.so "$(php -r 'echo ini_get("extension_dir");')/zephir_parser.so" if [ "${{ matrix.ts }}" = "ts" ]; then - echo "extension=zephir_parser.so" > /usr/local/etc/php/${{ matrix.php }}-zts/conf.d/ext-zephir_parser.ini + mkdir -p /opt/homebrew/etc/php/${{ matrix.php }}-zts/conf.d + echo "extension=zephir_parser.so" > /opt/homebrew/etc/php/${{ matrix.php }}-zts/conf.d/ext-zephir_parser.ini else - echo "extension=zephir_parser.so" > /usr/local/etc/php/${{ matrix.php }}/conf.d/ext-zephir_parser.ini + mkdir -p /opt/homebrew/etc/php/${{ matrix.php }}/conf.d + echo "extension=zephir_parser.so" > /opt/homebrew/etc/php/${{ matrix.php }}/conf.d/ext-zephir_parser.ini fi diff --git a/.github/actions/build-win/action.yml b/.github/actions/build-win/action.yml index e7faacb1..c18a7369 100644 --- a/.github/actions/build-win/action.yml +++ b/.github/actions/build-win/action.yml @@ -16,6 +16,10 @@ inputs: description: 'Target architecture (x64, x86)' required: false default: 'x64' + toolset: + description: 'MSVC toolset version (e.g: 14.0, 15.0, 16.0)' + required: false + default: '' # Use default toolset version for the selected msvc runs: using: 'composite' @@ -53,19 +57,10 @@ runs: cache_dir: ${{ env.CACHE_DIR }} - name: Configure Developer Command Prompt for MSVC compiler - uses: ilammy/msvc-dev-cmd@v1.10.0 - with: - arch: ${{ inputs.arch }} - - # Workaround for - # PHP Warning: PHP Startup: Can't load module 'C:\tools\php\ext\php_zephir_parser.dll' - # as it's linked with 14.29, but the core is linked with 14.16 in Unknown on line 0 - - name: Configure Developer Command Prompt for MSVC compiler - uses: ilammy/msvc-dev-cmd@v1.10.0 - if: ${{ inputs.php_version }} == '7.4' + uses: ilammy/msvc-dev-cmd@v1.13.0 with: arch: ${{ inputs.arch }} - toolset: 14.16 + toolset: ${{ inputs.toolset }} - name: Getting Details About Installed PHP shell: powershell diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..12301490 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef12f040..afe09892 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,13 +8,12 @@ name: Zephir Parser CI on: - schedule: - - cron: '0 2 * * *' # Daily at 02:00 runs only on default branch +# schedule: +# - cron: '0 2 * * *' # Daily at 02:00 runs only on default branch push: paths-ignore: - '**.md' - '**.txt' - pull_request: env: RE2C_VERSION: 2.2 @@ -28,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - php: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] + php: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ] ts: [ 'ts', 'nts' ] arch: [ 'x64' ] @@ -42,31 +41,35 @@ jobs: # Linux - { name: ubuntu-gcc, os: ubuntu-latest, compiler: gcc, ccov: 'ON' } # macOS - - { name: macos-clang, os: macos-12, compiler: clang, ccov: 'OFF' } + - { name: macos-clang, os: macos-14, compiler: clang, ccov: 'OFF' } # Windows - - { php: '7.0', ts: 'nts', arch: 'x64', name: 'windows2019-vc14', os: 'windows-2019', compiler: 'vc14', ccov: 'OFF' } - - { php: '7.0', ts: 'ts', arch: 'x64', name: 'windows2019-vc14', os: 'windows-2019', compiler: 'vc14', ccov: 'OFF' } - - { php: '7.1', ts: 'nts', arch: 'x64', name: 'windows2019-vc14', os: 'windows-2019', compiler: 'vc14', ccov: 'OFF' } - - { php: '7.1', ts: 'ts', arch: 'x64', name: 'windows2019-vc14', os: 'windows-2019', compiler: 'vc14', ccov: 'OFF' } - - { php: '7.2', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15', ccov: 'OFF' } - - { php: '7.2', ts: 'ts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15', ccov: 'OFF' } - - { php: '7.3', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15', ccov: 'OFF' } - - { php: '7.3', ts: 'ts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15', ccov: 'OFF' } - - { php: '7.4', ts: 'nts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15', ccov: 'OFF' } - - { php: '7.4', ts: 'ts', arch: 'x64', name: 'windows2019-vc15', os: 'windows-2019', compiler: 'vc15', ccov: 'OFF' } - - { php: '8.0', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16', ccov: 'OFF' } - - { php: '8.0', ts: 'ts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16', ccov: 'OFF' } - - { php: '8.1', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16', ccov: 'OFF' } - - { php: '8.1', ts: 'ts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16', ccov: 'OFF' } - - { php: '8.2', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16', ccov: 'OFF' } - - { php: '8.2', ts: 'ts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16', ccov: 'OFF' } - - { php: '8.3', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16', ccov: 'OFF' } - - { php: '8.3', ts: 'ts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16', ccov: 'OFF' } - #- { php: '8.4', ts: 'nts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16', ccov: 'OFF' } - #- { php: '8.4', ts: 'ts', arch: 'x64', name: 'windows2019-vs16', os: 'windows-2019', compiler: 'vs16', ccov: 'OFF' } + - { php: '7.0', ts: 'nts', arch: 'x64', name: 'windows2022-vc14', os: 'windows-2022', compiler: 'VC14', toolset: '', ccov: 'OFF' } + - { php: '7.0', ts: 'ts', arch: 'x64', name: 'windows2022-vc14', os: 'windows-2022', compiler: 'VC14', toolset: '', ccov: 'OFF' } + - { php: '7.1', ts: 'nts', arch: 'x64', name: 'windows2022-vc14', os: 'windows-2022', compiler: 'VC14', toolset: '', ccov: 'OFF' } + - { php: '7.1', ts: 'ts', arch: 'x64', name: 'windows2022-vc14', os: 'windows-2022', compiler: 'VC14', toolset: '', ccov: 'OFF' } + - { php: '7.2', ts: 'nts', arch: 'x64', name: 'windows2022-vc15', os: 'windows-2022', compiler: 'VC15', toolset: '', ccov: 'OFF' } + - { php: '7.2', ts: 'ts', arch: 'x64', name: 'windows2022-vc15', os: 'windows-2022', compiler: 'VC15', toolset: '', ccov: 'OFF' } + - { php: '7.3', ts: 'nts', arch: 'x64', name: 'windows2022-vc15', os: 'windows-2022', compiler: 'VC15', toolset: '', ccov: 'OFF' } + - { php: '7.3', ts: 'ts', arch: 'x64', name: 'windows2022-vc15', os: 'windows-2022', compiler: 'VC15', toolset: '', ccov: 'OFF' } + + # MSVC toolsets 14.0 and 14.16 can no longer be installed on Windows runners + # See https://github.com/actions/runner-images/issues/12764 + #- { php: '7.4', ts: 'nts', arch: 'x64', name: 'windows2022-vc15', os: 'windows-2022', compiler: 'VC15', toolset: '14.16', ccov: 'OFF' } + #- { php: '7.4', ts: 'ts', arch: 'x64', name: 'windows2022-vc15', os: 'windows-2022', compiler: 'VC15', toolset: '14.16', ccov: 'OFF' } + + - { php: '8.0', ts: 'nts', arch: 'x64', name: 'windows2022-vc16', os: 'windows-2022', compiler: 'vs16', toolset: '14.29', ccov: 'OFF' } + - { php: '8.0', ts: 'ts', arch: 'x64', name: 'windows2022-vc16', os: 'windows-2022', compiler: 'vs16', toolset: '14.29', ccov: 'OFF' } + - { php: '8.1', ts: 'nts', arch: 'x64', name: 'windows2022-vc16', os: 'windows-2022', compiler: 'vs16', toolset: '14.29', ccov: 'OFF' } + - { php: '8.1', ts: 'ts', arch: 'x64', name: 'windows2022-vc16', os: 'windows-2022', compiler: 'vs16', toolset: '14.29', ccov: 'OFF' } + - { php: '8.2', ts: 'nts', arch: 'x64', name: 'windows2022-vc16', os: 'windows-2022', compiler: 'vs16', toolset: '14.29', ccov: 'OFF' } + - { php: '8.2', ts: 'ts', arch: 'x64', name: 'windows2022-vc16', os: 'windows-2022', compiler: 'vs16', toolset: '14.29', ccov: 'OFF' } + - { php: '8.3', ts: 'nts', arch: 'x64', name: 'windows2022-vc16', os: 'windows-2022', compiler: 'vs16', toolset: '14.29', ccov: 'OFF' } + - { php: '8.3', ts: 'ts', arch: 'x64', name: 'windows2022-vc16', os: 'windows-2022', compiler: 'vs16', toolset: '14.29', ccov: 'OFF' } + - { php: '8.4', ts: 'nts', arch: 'x64', name: 'windows2022-vc17', os: 'windows-2022', compiler: 'vs17', toolset: '14.44', ccov: 'OFF' } + - { php: '8.4', ts: 'ts', arch: 'x64', name: 'windows2022-vc17', os: 'windows-2022', compiler: 'vs17', toolset: '14.44', ccov: 'OFF' } steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Install PHP ${{ matrix.php }} uses: shivammathur/setup-php@v2 @@ -109,6 +112,7 @@ jobs: ts: ${{ matrix.ts }} msvc: ${{ matrix.compiler }} arch: ${{ matrix.arch }} + toolset: ${{ matrix.toolset }} env: CACHE_DIR: 'C:\Downloads' TOOLS_DIR: 'C:\tools' @@ -167,7 +171,7 @@ jobs: - name: Upload Code Coverage Report if: matrix.ccov == 'ON' - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} files: ./lcov.info @@ -190,12 +194,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Install PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.4' + php-version: '8.5' tools: pecl - name: Install System Dependencies @@ -260,7 +264,7 @@ jobs: steps: - name: Checkout Code - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 1 @@ -271,7 +275,7 @@ jobs: - name: Download Zephir Parser build artifacts id: download - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v5 with: path: ./build-artifacts diff --git a/CHANGELOG.md b/CHANGELOG.md index a9957605..666e67dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - xxxx-xx-xx +## [1.8.0] - 2025-09-24 +### Added +- Enabled PHP 8.5 support [#160](https://github.com/phalcon/php-zephir-parser/issues/160) + ## [1.7.0] - 2024-11-23 ### Added - Enabled PHP 8.4 support [#154](https://github.com/phalcon/php-zephir-parser/issues/154) diff --git a/docker/windows/Dockerfile b/docker/windows/Dockerfile deleted file mode 100644 index cbec6e2d..00000000 --- a/docker/windows/Dockerfile +++ /dev/null @@ -1,77 +0,0 @@ -FROM mcr.microsoft.com/windows/servercore:ltsc2019 - -COPY . C:/php-zephir-parser - -# Download required functions for git installation -RUN powershell.exe -Command \ - ((new-object net.webclient).DownloadFile('https://raw.githubusercontent.com/actions/virtual-environments/5690645f0e91c30d888353d7b58432dc0466eca9/images/win/scripts/ImageHelpers/ChocoHelpers.ps1', 'C:\ChocoHelpers.ps1')); \ - ((new-object net.webclient).DownloadFile('https://raw.githubusercontent.com/actions/virtual-environments/f93413492e47983bafbc29ab84cb697aeeb41f7b/images/win/scripts/ImageHelpers/InstallHelpers.ps1', 'C:\InstallHelpers.ps1')); \ - ((new-object net.webclient).DownloadFile('https://raw.githubusercontent.com/actions/virtual-environments/b7f276c003aea42575b52247bdb2183e355fca2f/images/win/scripts/ImageHelpers/PathHelpers.ps1', 'C:\PathHelpers.ps1')); - -# Install Choco and Git -RUN powershell.exe -Command \ - Import-Module C:\ChocoHelpers.ps1; \ - Import-Module C:\InstallHelpers.ps1; \ - Import-Module C:\PathHelpers.ps1; \ - Invoke-Expression ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/actions/virtual-environments/main/images/win/scripts/Installers/Install-Choco.ps1')); \ - Invoke-Expression ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/actions/virtual-environments/main/images/win/scripts/Installers/Install-Git.ps1')); - -# Clone 'virtual-environments' -RUN powershell.exe git clone https://github.com/actions/virtual-environments.git - -# Install all necessary dependecies -RUN powershell.exe -Command \ - Import-Module C:\virtual-environments\images\win\scripts\ImageHelpers\PathHelpers.ps1; \ - Import-Module C:\virtual-environments\images\win\scripts\ImageHelpers\InstallHelpers.ps1; \ - Import-Module C:\virtual-environments\images\win\scripts\ImageHelpers\ChocoHelpers.ps1; \ - Import-Module C:\virtual-environments\images\win\scripts\ImageHelpers\VisualStudioHelpers.ps1; \ - Invoke-Expression C:\virtual-environments\images\win\scripts\Installers\Install-VCRedist.ps1; \ - Invoke-Expression C:\virtual-environments\images\win\scripts\Installers\Install-VS.ps1; \ - Invoke-Expression C:\virtual-environments\images\win\scripts\Installers\Install-PHP.ps1; - -RUN curl -SL --output vs_buildtools.exe https://aka.ms/vs/16/release/vs_buildtools.exe && \ - (start /w vs_buildtools.exe --quiet --wait --norestart --nocache modify \ - --installPath "C:\BuildTools" \ - --add Microsoft.VisualStudio.Workload.AzureBuildTools \ - --remove Microsoft.VisualStudio.Component.Windows10SDK.10240 \ - --remove Microsoft.VisualStudio.Component.Windows10SDK.10586 \ - --remove Microsoft.VisualStudio.Component.Windows10SDK.14393 \ - --remove Microsoft.VisualStudio.Component.Windows81SDK) && \ - del /q vs_buildtools.exe - -RUN dir "C:\BuildTools" - -#RUN call "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\Common7\\Tools\\VsDevCmd.bat" - -ENV PHP_VERSION=8.0.9 -ENV PHP_MINOR=8.0 -ENV TEST_PHP_EXECUTABLE=C:/php/php.exe -ENV BUILD_TYPE=ts -ENV VC_VERSION=16 -ENV PHP_ARCH=x64 -ENV BUILD_VERSION=1 - -ENV PHP_SDK_VERSION=2.2.0 -ENV PHP_DEVPACK=C:/tools/php-devpack -ENV PHP_SDK_PATH=C:/tools/php-sdk -ENV EXTENSION_FILE=php_zephir_parser.dll - -# choco install visualstudio2019-workload-vctools; \ -# choco install llvm; \ -RUN powershell.exe -Command \ - choco install 7zip; \ - Import-Module C:\php-zephir-parser\.ci\win-ci-tools.psm1; \ - SetupCommonEnvironment; \ - InstallPhpSdk; \ - InstallPhpDevPack; \ - AppendSessionPath; - -RUN call C:\tools\php-sdk\bin\phpsdk_setvars.bat && \ - cd C:\php-zephir-parser\parser && \ - cl.exe lemon.c && \ - DEL zephir.c zephir.h parser.c scanner.c && \ - re2c.exe -o scanner.c scanner.re && \ - lemon.exe -s zephir.lemon && \ - ECHO #include ^ > parser.c && \ - TYPE zephir.c >> parser.c && \ - TYPE base.c >> parser.c diff --git a/package.xml b/package.xml index 84f29659..3a83c311 100644 --- a/package.xml +++ b/package.xml @@ -12,11 +12,11 @@ anton@phalcon.io yes - 2024-11-23 + 2025-09-24 - 1.7.0 - 1.7.0 + 1.8.0 + 1.8.0 stable @@ -24,11 +24,11 @@ MIT - Sat, Nov 23, 2024 - Zephir Parser 1.7.0 + Wed, Sep 24, 2025 - Zephir Parser 1.8.0 = Added: - - Enabled support for PHP 8.4 + - Enabled support for PHP 8.5 @@ -215,7 +215,7 @@ 7.0.0 - 8.4.99 + 8.5.99 1.10 diff --git a/parser/lemon.c b/parser/lemon.c index 7562bde9..5d416df4 100644 --- a/parser/lemon.c +++ b/parser/lemon.c @@ -41,7 +41,6 @@ extern int access(const char *path, int mode); #endif char *msort(); -extern void *malloc(); /******** From the file "action.h" *************************************/ struct action *Action_new(); @@ -305,7 +304,7 @@ struct symbol *Symbol_new(); int Symbolcmpp(/* struct symbol **, struct symbol ** */); void Symbol_init(/* void */); int Symbol_insert(/* struct symbol *, char * */); -struct symbol *Symbol_find(/* char * */); +struct symbol *Symbol_find(char *key); /* modern prototype to satisfy C2x */ struct symbol *Symbol_Nth(/* int */); int Symbol_count(/* */); struct symbol **Symbol_arrayof(/* */); @@ -3620,7 +3619,7 @@ int mhflag; /* Output in makeheaders format if true */ } tplt_xfer(lemp->name,in,out,&lineno); - /* Generate code which executes every time a symbol is popped from + /* Generate code which executes when a symbol is popped from ** the stack while processing errors or while destroying the parser. ** (In other words, generate the %destructor actions) */ @@ -3729,7 +3728,7 @@ void ReportHeader(lemp) struct lemon *lemp; { FILE *out, *in; - char *prefix; + char *prefix; char line[LINESIZE]; char pattern[LINESIZE]; int i; @@ -4181,8 +4180,7 @@ char *key; /* Return a pointer to data assigned to the given key. Return NULL ** if no such key. */ -struct symbol *Symbol_find(key) -char *key; +struct symbol *Symbol_find(char *key) { int h; x2node *np; diff --git a/tests/base/extension_info.phpt b/tests/base/extension_info.phpt index e74f66a2..8254c68c 100644 --- a/tests/base/extension_info.phpt +++ b/tests/base/extension_info.phpt @@ -21,7 +21,7 @@ ob_start(); phpinfo(INFO_MODULES); $info = trim(ob_get_clean()); -echo contains($info, 'Zephir Parser').PHP_EOL; +//echo contains($info, 'zephir_parser').PHP_EOL; echo contains($info, 'The Zephir Parser delivered as a C extension for the PHP language.').PHP_EOL; echo contains($info, 'zephir_parser => enabled').PHP_EOL; echo contains($info, 'Author => Zephir Team and contributors').PHP_EOL; @@ -30,7 +30,6 @@ echo contains($info, 'Build Date =>').PHP_EOL; ?> --EXPECT-- bool(true) -Zephir Parser The Zephir Parser delivered as a C extension for the PHP language. zephir_parser => enabled Author => Zephir Team and contributors