Compare commits

..
Author SHA1 Message Date
Shivam Mathur 084302964f Add thin PIE CLI extension installation helpers 2026-11-08 04:13:55 +05:30
35 changed files with 569 additions and 836 deletions
-1
View File
@@ -14,7 +14,6 @@ This security policy only applies to the latest patch releases of the following
| 8.3 | :white_check_mark: | | 8.3 | :white_check_mark: |
| 8.4 | :white_check_mark: | | 8.4 | :white_check_mark: |
| 8.5 | :white_check_mark: | | 8.5 | :white_check_mark: |
| 8.6 | :white_check_mark: |
## Reporting a Vulnerability ## Reporting a Vulnerability
+3 -3
View File
@@ -26,13 +26,13 @@ jobs:
persist-credentials: false persist-credentials: false
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@915412ff23e8b7659517e607487dbeae018f2934 # v4 uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4
with: with:
config-file: ./.github/codeql/codeql-configuration.yml config-file: ./.github/codeql/codeql-configuration.yml
languages: javascript languages: javascript
- name: Autobuild - name: Autobuild
uses: github/codeql-action/autobuild@915412ff23e8b7659517e607487dbeae018f2934 # v4 uses: github/codeql-action/autobuild@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@915412ff23e8b7659517e607487dbeae018f2934 # v4 uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4
+2 -2
View File
@@ -23,7 +23,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
env: env:
default-php-version: '8.6' default-php-version: '8.5'
jobs: jobs:
run: run:
name: Run name: Run
@@ -48,7 +48,7 @@ jobs:
- name: Setup cache environment - name: Setup cache environment
id: cache-env id: cache-env
uses: shivammathur/cache-extensions@0769e8b0c165c62888174c0fe66557ca1616ae45 # v1 uses: shivammathur/cache-extensions@d894929efeece5f8d386bd667369b321947064ad # v1
with: with:
php-version: ${{ matrix.php-versions || env.default-php-version }} php-version: ${{ matrix.php-versions || env.default-php-version }}
extensions: ${{ env.extensions }} extensions: ${{ env.extensions }}
+39 -88
View File
@@ -17,9 +17,6 @@
<a href="https://twitter.com/setup_php" title="setup-php twitter"><img alt="setup-php twitter" src="https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555"></a> <a href="https://twitter.com/setup_php" title="setup-php twitter"><img alt="setup-php twitter" src="https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555"></a>
<a href="https://status.setup-php.com" title="setup-php status"><img alt="setup-php status" src="https://img.shields.io/badge/status-subscribe-28A745?logo=statuspage&logoColor=28A745&labelColor=555555"></a> <a href="https://status.setup-php.com" title="setup-php status"><img alt="setup-php status" src="https://img.shields.io/badge/status-subscribe-28A745?logo=statuspage&logoColor=28A745&labelColor=555555"></a>
</p> </p>
<p align="center">
<a target="_blank" href="https://namespace.so/github-actions/?utm_source=oss&utm_campaign=setup-php"><img src="https://namespace.so/oss/badge.svg" alt="CI powered by Namespace" height="32" align="middle"></a>
</p>
Setup PHP with required extensions, php.ini configuration, code-coverage support, and various tools like composer in [GitHub Actions](https://github.com/features/actions "GitHub Actions"). This action gives you a cross-platform interface to set up the PHP environment you need to test your application. Refer to the [Usage](#memo-usage "How to use this") section and [examples](#examples "Examples of use") to see how to use this. Setup PHP with required extensions, php.ini configuration, code-coverage support, and various tools like composer in [GitHub Actions](https://github.com/features/actions "GitHub Actions"). This action gives you a cross-platform interface to set up the PHP environment you need to test your application. Refer to the [Usage](#memo-usage "How to use this") section and [examples](#examples "Examples of use") to see how to use this.
@@ -44,7 +41,6 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support
- [Nightly Build Setup](#nightly-build-setup) - [Nightly Build Setup](#nightly-build-setup)
- [Debug Build Setup](#debug-build-setup) - [Debug Build Setup](#debug-build-setup)
- [Thread Safe Setup](#thread-safe-setup) - [Thread Safe Setup](#thread-safe-setup)
- [ASAN Build Setup](#asan-build-setup)
- [Force Update Setup](#force-update-setup) - [Force Update Setup](#force-update-setup)
- [Verbose Setup](#verbose-setup) - [Verbose Setup](#verbose-setup)
- [Multi-Arch Setup](#multi-arch-setup) - [Multi-Arch Setup](#multi-arch-setup)
@@ -115,7 +111,8 @@ Both `GitHub-hosted` and `self-hosted` runners are supported by `setup-php` on t
On all supported OS/Platforms, the following PHP versions can be set up as per the runner. On all supported OS/Platforms, the following PHP versions can be set up as per the runner.
- PHP 5.3 to PHP 8.7 on supported GitHub-hosted runners, including macOS ARM64 runners. - PHP 5.3 to PHP 8.7 on GitHub-hosted runners, except for macOS ARM64 runners.
- PHP 5.6 to PHP 8.7 on GitHub-hosted macOS ARM64 runners.
- PHP 5.6 to PHP 8.7 on self-hosted runners. - PHP 5.6 to PHP 8.7 on self-hosted runners.
| PHP Version | Stability | Release Support | Runner Support | | PHP Version | Stability | Release Support | Runner Support |
@@ -135,12 +132,12 @@ On all supported OS/Platforms, the following PHP versions can be set up as per t
| `8.3` | `Stable` | `Security fixes only` | `GitHub-hosted`, `self-hosted` | | `8.3` | `Stable` | `Security fixes only` | `GitHub-hosted`, `self-hosted` |
| `8.4` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` | | `8.4` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
| `8.5` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` | | `8.5` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` |
| `8.6` | `Stable` | `Active` | `GitHub-hosted`, `self-hosted` | | `8.6` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` |
| `8.7` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` | | `8.7` | `Nightly` | `In development` | `GitHub-hosted`, `self-hosted` |
> [!Note] > [!Note]
> - Specifying `8.6` in the `php-version` input selects the PHP 8.6 stable series. Specifying `8.7`, `nightly`, or `master` installs a nightly build of PHP 8.7 from the master branch of PHP. See [nightly build setup](#nightly-build-setup) for more information. > - Specifying `8.7` or `master` in `php-version` input installs a nightly build of `PHP 8.7.0-dev` from the master branch of PHP. Specifying `8.6` or `nightly` installs a nightly build of `PHP 8.6.0-dev` from the PHP-8.6 branch. See [nightly build setup](#nightly-build-setup) for more information.
> - To use JIT on `PHP 8.0` and above, refer to the [JIT configuration](#jit-configuration) section. > - To use JIT on `PHP 8.0` and above, refer to the [JIT configuration](#jit-configuration) section.
## :heavy_plus_sign: PHP Extension Support ## :heavy_plus_sign: PHP Extension Support
@@ -244,7 +241,7 @@ This disables all core and third-party shared extensions and thus, can break som
These tools can be set up globally using the `tools` input. It accepts a string in csv-format. These tools can be set up globally using the `tools` input. It accepts a string in csv-format.
[`backward-compatibility-check`], [`behat`], [`blackfire`], [`blackfire-player`], [`box`], [`castor`], [`churn`], [`codeception`], [`composer`], [`composer-dependency-analyser`], [`composer-normalize`], [`composer-prefetcher`], [`composer-require-checker`], [`composer-unused`], [`cpx`], [`cs2pr`], [`deployer`], [`ecs`], [`flex`], [`grpc_php_plugin`], [`infection`], [`laravel-cloud`] or [`cloud-cli`], [`mago`], [`name-collision-detector`], [`parallel-lint`], [`pecl`], [`phan`], [`phing`], [`phinx`], [`phive`], [`php-config`], [`php-cs-fixer`], [`php-scoper`], [`phpcbf`], [`phpcpd`], [`phpcs`], [`phpdoc`] or [`phpDocumentor`], [`phpize`], [`phplint`], [`phpmd`], [`phpspec`], [`phpstan`], [`phpunit`], [`phpunit-bridge`], [`phpunit-polyfills`], [`pie`], [`pint`], [`prestissimo`], [`protoc`], [`psalm`], [`rector`], [`symfony`] or [`symfony-cli`], [`upsun`] or [`upsun-cli`], [`vapor`] or [`vapor-cli`], [`wp`] or [`wp-cli`] [`backward-compatibility-check`], [`behat`], [`blackfire`], [`blackfire-player`], [`box`], [`castor`], [`churn`], [`codeception`], [`composer`], [`composer-dependency-analyser`], [`composer-normalize`], [`composer-prefetcher`], [`composer-require-checker`], [`composer-unused`], [`cpx`], [`cs2pr`], [`deployer`], [`ecs`], [`flex`], [`grpc_php_plugin`], [`infection`], [`laravel-cloud`] or [`cloud-cli`], [`mago`], [`name-collision-detector`], [`parallel-lint`], [`pecl`], [`phan`], [`phing`], [`phinx`], [`phive`], [`php-config`], [`php-cs-fixer`], [`php-scoper`], [`phpcbf`], [`phpcpd`], [`phpcs`], [`phpdoc`] or [`phpDocumentor`], [`phpize`], [`phplint`], [`phpmd`], [`phpspec`], [`phpstan`], [`phpunit`], [`phpunit-bridge`], [`phpunit-polyfills`], [`pie`], [`pint`], [`prestissimo`], [`protoc`], [`psalm`], [`rector`], [`symfony`] or [`symfony-cli`], [`vapor`] or [`vapor-cli`], [`wp`] or [`wp-cli`]
```yaml ```yaml
- name: Setup PHP with tools - name: Setup PHP with tools
@@ -436,7 +433,7 @@ Disable coverage for these reasons:
- Accepts a `string`. For example `'8.5'`. - Accepts a `string`. For example `'8.5'`.
- Accepts `lowest` to set up the lowest supported PHP version. - Accepts `lowest` to set up the lowest supported PHP version.
- Accepts `highest` or `latest` to set up the latest stable PHP version. - Accepts `highest` or `latest` to set up the latest stable PHP version.
- Accepts `nightly` to set up a nightly build of the next PHP release (`8.7`). - Accepts `nightly` to set up a nightly build of the next PHP release (`8.6`).
- Accepts `master` to set up a nightly build from the master branch of PHP (`8.7`). - Accepts `master` to set up a nightly build from the master branch of PHP (`8.7`).
- Accepts `pre-installed` to set up the highest pre-installed PHP version. You can combine this with `update: true` to update the pre-installed PHP version. - Accepts `pre-installed` to set up the highest pre-installed PHP version. You can combine this with `update: true` to update the pre-installed PHP version.
- Accepts the format `d.x`, where `d` is the major version. For example `5.x`, `7.x` and `8.x`. - Accepts the format `d.x`, where `d` is the major version. For example `5.x`, `7.x` and `8.x`.
@@ -532,13 +529,6 @@ On GitHub Actions you can assign the `setup-php` step an `id`, you can use the s
- By default, it is set to `nts`. - By default, it is set to `nts`.
- See [thread safe setup](#thread-safe-setup) for more info. - See [thread safe setup](#thread-safe-setup) for more info.
#### `asan` (optional)
- Specify to set up PHP with AddressSanitizer (ASAN) for memory error detection.
- Accepts `true` or `false`.
- Only available for PHP 8.0 and above on Linux runners.
- See [ASAN build setup](#asan-build-setup) for more info.
#### `update` (optional) #### `update` (optional)
- Specify to update PHP on the runner to the latest patch version. - Specify to update PHP on the runner to the latest patch version.
@@ -601,10 +591,10 @@ jobs:
### Nightly Build Setup ### Nightly Build Setup
> Set up a nightly build of `PHP 8.7`. > Set up a nightly build of `PHP 8.6` or `PHP 8.7`.
- PHP 8.7 is in active development and might contain bugs and breaking changes. - These PHP versions are currently in active development and might contain bugs and breaking changes.
- Some extensions might not support PHP 8.7 yet. - Some user space extensions might not support these versions currently.
```yaml ```yaml
steps: steps:
@@ -660,54 +650,6 @@ jobs:
phpts: ts # specify ts or nts phpts: ts # specify ts or nts
``` ```
### ASAN Build Setup
> Set up PHP with AddressSanitizer (ASAN) for memory error detection.
- ASAN builds include both `AddressSanitizer` and `UndefinedBehaviorSanitizer (UBSan)`.
- Only available for PHP 8.0 and above on Linux based runners.
- Useful for detecting memory errors such as buffer overflows, use-after-free, and memory leaks.
```yaml
jobs:
run:
runs-on: ubuntu-latest
name: Setup PHP with ASAN
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
env:
asan: true
```
You can combine ASAN with other options:
```yaml
- name: Setup PHP with ASAN and thread safety
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
env:
asan: true
phpts: ts
```
With `asan: true`, subsequent steps in the same job inherit `ASAN_OPTIONS=detect_leaks=0`, `UBSAN_OPTIONS=halt_on_error=1`, `ZEND_DONT_UNLOAD_MODULES=1`, and `USE_ZEND_ALLOC=0` by default.
Set a variable in the setup step's `env` to override its default for the rest of the job. To enable leak checks for a single test step, set `ASAN_OPTIONS` on that step.
```yaml
- name: Run PHPUnit with leak detection
run: vendor/bin/phpunit
env:
ASAN_OPTIONS: detect_leaks=1
```
> [!NOTE]
> - ASAN builds have a performance overhead due to the instrumentation, so they are recommended for testing and debugging only.
### Force Update Setup ### Force Update Setup
> Update to the latest patch of PHP versions. > Update to the latest patch of PHP versions.
@@ -748,7 +690,7 @@ Set a variable in the setup step's `env` to override its default for the rest of
> Set up PHP on multiple architectures on Ubuntu GitHub Runners. > Set up PHP on multiple architectures on Ubuntu GitHub Runners.
- `PHP 5.6` to `PHP 8.6` are supported by `setup-php` on multiple architectures on `Ubuntu` and `Debian`. - `PHP 5.6` to `PHP 8.5` are supported by `setup-php` on multiple architecture on `Ubuntu` and `Debian`.
- For this, you can use `shivammathur/node` images as containers. These have compatible `Nodejs` and `PHP` installed for `setup-php`. - For this, you can use `shivammathur/node` images as containers. These have compatible `Nodejs` and `PHP` installed for `setup-php`.
```yaml ```yaml
@@ -1104,23 +1046,34 @@ Examples of using `setup-php` with various PHP frameworks and packages.
These companies generously provide setup-php their products and services to aid in the development of this project. These companies generously provide setup-php their products and services to aid in the development of this project.
<p align="center"> <p>
<a target="_blank" href="https://www.jetbrains.com/?from=setup-php#gh-light-mode-only"><img src="https://setup-php.com/sponsors/jetbrains.svg" alt="JetBrains" width="140"></a> <a target="_blank" href="https://www.jetbrains.com/?from=setup-php#gh-light-mode-only">
<a target="_blank" href="https://www.jetbrains.com/?from=setup-php#gh-dark-mode-only"><img src="https://setup-php.com/sponsors/jetbrains-white.svg" alt="JetBrains" width="140"></a> <img src="https://setup-php.com/sponsors/jetbrains.svg" alt="JetBrains" width="140" height="100">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </a>
<a target="_blank" href="https://www.cloudflare.com/lp/project-alexandria/#gh-light-mode-only"><img src="https://setup-php.com/sponsors/cloudflare.svg" alt="Cloudflare" width="240"></a> <a target="_blank" href="https://www.jetbrains.com/?from=setup-php#gh-dark-mode-only">
<a target="_blank" href="https://www.cloudflare.com/lp/project-alexandria/#gh-dark-mode-only"><img src="https://setup-php.com/sponsors/cloudflare-white.svg" alt="Cloudflare" width="240"></a> <img src="https://setup-php.com/sponsors/jetbrains-white.svg" alt="JetBrains" width="140" height="100">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </a>
<a target="_blank" href="https://www.macstadium.com/company/opensource#gh-light-mode-only"><img src="https://setup-php.com/sponsors/macstadium.png" alt="Mac Stadium" width="200"></a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a target="_blank" href="https://www.macstadium.com/company/opensource#gh-dark-mode-only"><img src="https://setup-php.com/sponsors/macstadium-white.png" alt="Mac Stadium" width="200"></a> <a target="_blank" href="https://www.cloudflare.com/lp/project-alexandria/#gh-light-mode-only">
</p> <img src="https://setup-php.com/sponsors/cloudflare.svg" alt="Cloudflare" width="240" height="80">
</a>
<p align="center"> <a target="_blank" href="https://www.cloudflare.com/lp/project-alexandria/#gh-dark-mode-only">
<a target="_blank" href="https://namespace.so/github-actions/?utm_source=oss&utm_campaign=setup-php#gh-light-mode-only"><img src="https://setup-php.com/sponsors/namespace.svg?v=2" alt="Namespace" width="180" align="middle"></a> <img src="https://setup-php.com/sponsors/cloudflare-white.svg" alt="Cloudflare" width="240" height="80">
<a target="_blank" href="https://namespace.so/github-actions/?utm_source=oss&utm_campaign=setup-php#gh-dark-mode-only"><img src="https://setup-php.com/sponsors/namespace-white.svg?v=2" alt="Namespace" width="180" align="middle"></a> </a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a target="_blank" href="https://www.blacksmith.sh/#gh-light-mode-only"><img src="https://setup-php.com/sponsors/blacksmith.svg?v=2" alt="Blacksmith" width="180" align="middle"></a> <a target="_blank" href="https://www.macstadium.com/company/opensource#gh-light-mode-only">
<a target="_blank" href="https://www.blacksmith.sh/#gh-dark-mode-only"><img src="https://setup-php.com/sponsors/blacksmith-white.svg?v=2" alt="Blacksmith" width="180" align="middle"></a> <img src="https://setup-php.com/sponsors/macstadium.png" alt="Mac Stadium" width="200" height="80">
</a>
<a target="_blank" href="https://www.macstadium.com/company/opensource#gh-dark-mode-only">
<img src="https://setup-php.com/sponsors/macstadium-white.png" alt="Mac Stadium" width="200" height="80">
</a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a target="_blank" href="https://m.do.co/c/f1a8ee1277b0#gh-light-mode-only">
<img src="https://setup-php.com/sponsors/digitalocean.svg" alt="Digitalocean" width="100" height="100">
</a>
<a target="_blank" href="https://m.do.co/c/f1a8ee1277b0#gh-dark-mode-only">
<img src="https://setup-php.com/sponsors/digitalocean-white.svg" alt="Digitalocean" width="100" height="100">
</a>
</p> </p>
Many users and organizations support setup-php via [GitHub Sponsors](https://github.com/sponsors/shivammathur). Many users and organizations support setup-php via [GitHub Sponsors](https://github.com/sponsors/shivammathur).
@@ -1136,7 +1089,7 @@ Many users and organizations support setup-php via [GitHub Sponsors](https://git
- [Node.js dependencies](https://github.com/shivammathur/setup-php/network/dependencies "Node.js dependencies") - [Node.js dependencies](https://github.com/shivammathur/setup-php/network/dependencies "Node.js dependencies")
- [aaronparker/VcRedist](https://github.com/aaronparker/VcRedist "VcRedist PowerShell package") - [aaronparker/VcRedist](https://github.com/aaronparker/VcRedist "VcRedist PowerShell package")
- [mlocati/powershell-phpmanager](https://github.com/mlocati/powershell-phpmanager "Package to handle PHP on windows") - [mlocati/powershell-phpmanager](https://github.com/mlocati/powershell-phpmanager "Package to handle PHP on windows")
- [Sury PHP packages](https://packages.sury.org/php/) and the [setup-php mirror](https://ppa.setup-php.com/sury/) - [ppa:ondrej/php](https://launchpad.net/~ondrej/+archive/ubuntu/php "Packaging active PHP packages")
- [shivammathur/cache-extensions](https://github.com/shivammathur/cache-extensions "GitHub action to help with caching PHP extensions") - [shivammathur/cache-extensions](https://github.com/shivammathur/cache-extensions "GitHub action to help with caching PHP extensions")
- [shivammathur/composer-cache](https://github.com/shivammathur/composer-cache "Cache composer releases") - [shivammathur/composer-cache](https://github.com/shivammathur/composer-cache "Cache composer releases")
- [shivammathur/homebrew-extensions](https://github.com/shivammathur/homebrew-extensions "Tap for PHP extensions on MacOS") - [shivammathur/homebrew-extensions](https://github.com/shivammathur/homebrew-extensions "Tap for PHP extensions on MacOS")
@@ -1211,8 +1164,6 @@ Many users and organizations support setup-php via [GitHub Sponsors](https://git
[`rector`]: https://getrector.org/ [`rector`]: https://getrector.org/
[`symfony`]: https://symfony.com/download [`symfony`]: https://symfony.com/download
[`symfony-cli`]: https://symfony.com/download [`symfony-cli`]: https://symfony.com/download
[`upsun`]: https://docs.upsun.com/administration/cli.html
[`upsun-cli`]: https://docs.upsun.com/administration/cli.html
[`vapor`]: https://docs.vapor.build/ [`vapor`]: https://docs.vapor.build/
[`vapor-cli`]: https://docs.vapor.build/ [`vapor-cli`]: https://docs.vapor.build/
[`wp`]: https://wp-cli.org/ [`wp`]: https://wp-cli.org/
-2
View File
@@ -72,7 +72,6 @@ describe('Extension tests', () => {
${'phalcon3'} | ${'7.3'} | ${'add_phalcon phalcon3'} ${'phalcon3'} | ${'7.3'} | ${'add_phalcon phalcon3'}
${'relay'} | ${'7.4'} | ${'add_relay relay'} ${'relay'} | ${'7.4'} | ${'add_relay relay'}
${'relay-v1.2.3'} | ${'7.4'} | ${'add_relay relay-v1.2.3'} ${'relay-v1.2.3'} | ${'7.4'} | ${'add_relay relay-v1.2.3'}
${'relay-nightly'} | ${'8.6'} | ${'add_relay relay-nightly'}
${'sqlite'} | ${'7.4'} | ${'add_extension sqlite3'} ${'sqlite'} | ${'7.4'} | ${'add_extension sqlite3'}
${'sqlsrv-1.2.3-beta1'} | ${'7.4'} | ${'add_pecl_extension sqlsrv 1.2.3beta1 extension'} ${'sqlsrv-1.2.3-beta1'} | ${'7.4'} | ${'add_pecl_extension sqlsrv 1.2.3beta1 extension'}
${'Xdebug'} | ${'7.4'} | ${'add_extension xdebug'} ${'Xdebug'} | ${'7.4'} | ${'add_extension xdebug'}
@@ -108,7 +107,6 @@ describe('Extension tests', () => {
${'pdo_oci'} | ${'7.3'} | ${'add_oci pdo_oci'} ${'pdo_oci'} | ${'7.3'} | ${'add_oci pdo_oci'}
${'pecl_http'} | ${'7.3'} | ${'add_http'} ${'pecl_http'} | ${'7.3'} | ${'add_http'}
${'relay-1.2.3'} | ${'7.4'} | ${'add_relay relay-1.2.3'} ${'relay-1.2.3'} | ${'7.4'} | ${'add_relay relay-1.2.3'}
${'relay-nightly'} | ${'8.6'} | ${'add_relay relay-nightly'}
${'sqlite'} | ${'7.2'} | ${'add_extension sqlite3'} ${'sqlite'} | ${'7.2'} | ${'add_extension sqlite3'}
${'xdebug2'} | ${'7.4'} | ${'add_brew_extension xdebug2 zend_extension 2.9.8'} ${'xdebug2'} | ${'7.4'} | ${'add_brew_extension xdebug2 zend_extension 2.9.8'}
${'zephir_parser-v1.2.3'} | ${'7.2'} | ${'add_zephir_parser zephir_parser-v1.2.3'} ${'zephir_parser-v1.2.3'} | ${'7.2'} | ${'add_zephir_parser zephir_parser-v1.2.3'}
-4
View File
@@ -21,10 +21,6 @@ it('checking fetch', async () => {
nock(host_url) nock(host_url)
.get('/manifest') .get('/manifest')
.matchHeader(
'user-agent',
`setup-php (${process.platform}; ${process.arch}; +https://setup-php.com)`
)
.reply(200, {latest: 'latest'}) .reply(200, {latest: 'latest'})
.get('/manifest') .get('/manifest')
.matchHeader('authorization', 'Bearer invalid_token') .matchHeader('authorization', 'Bearer invalid_token')
+3 -6
View File
@@ -669,7 +669,7 @@ describe('Tools tests', () => {
it.each([ it.each([
[ [
'blackfire, blackfire-player, box, churn, cloud-cli, cpx, cs2pr, flex, grpc_php_plugin, mago, name-collision-detector, parallel-lint, php-cs-fixer, php-scoper, phpDocumentor, phplint, phpstan, phpunit, pecl, phing, phinx, phinx:1.2.3, phive, phpunit-bridge, phpunit-polyfills, pint, php-config, phpize, protoc, symfony, upsun, vapor, wp, pie', 'blackfire, blackfire-player, box, churn, cloud-cli, cpx, cs2pr, flex, grpc_php_plugin, mago, name-collision-detector, parallel-lint, php-cs-fixer, php-scoper, phpDocumentor, phplint, phpstan, phpunit, pecl, phing, phinx, phinx:1.2.3, phive, phpunit-bridge, phpunit-polyfills, pint, php-config, phpize, protoc, symfony, vapor, wp, pie',
[ [
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://artifacts.setup-php.com/composer/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer', 'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://artifacts.setup-php.com/composer/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
'add_blackfire', 'add_blackfire',
@@ -702,7 +702,6 @@ describe('Tools tests', () => {
'add_devtools phpize', 'add_devtools phpize',
'add_protoc latest', 'add_protoc latest',
'add_symfony latest', 'add_symfony latest',
'add_upsun latest',
'add_composer_tool vapor-cli vapor-cli laravel/ scoped', 'add_composer_tool vapor-cli vapor-cli laravel/ scoped',
'add_tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"', 'add_tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"',
'add_tool https://github.com/php/pie/releases/latest/download/pie.phar pie "-V"' 'add_tool https://github.com/php/pie/releases/latest/download/pie.phar pie "-V"'
@@ -717,7 +716,7 @@ describe('Tools tests', () => {
it.each([ it.each([
[ [
'backward-compatibility-check, behat, blackfire, blackfire-player, churn, composer-dependency-analyser, composer-normalize, composer-require-checker, composer-unused, cpx:2.0.0, cs2pr:1.2.3, ecs, flex, grpc_php_plugin:1.2.3, infection, laravel-cloud, mago:0.26.1, name-collision-detector, phan, phan:1.2.3, phing:1.2.3, phinx, phive:1.2.3, php-config, phpcbf, phpcpd, phpcs, phpdoc, phpize, phpmd, phpspec, phpunit-bridge:5.6, phpunit-polyfills:1.0.1, protoc:v1.2.3, psalm, rector, symfony-cli, upsun-cli:5.16.0, vapor-cli, wp-cli, pie', 'backward-compatibility-check, behat, blackfire, blackfire-player, churn, composer-dependency-analyser, composer-normalize, composer-require-checker, composer-unused, cpx:2.0.0, cs2pr:1.2.3, ecs, flex, grpc_php_plugin:1.2.3, infection, laravel-cloud, mago:0.26.1, name-collision-detector, phan, phan:1.2.3, phing:1.2.3, phinx, phive:1.2.3, php-config, phpcbf, phpcpd, phpcs, phpdoc, phpize, phpmd, phpspec, phpunit-bridge:5.6, phpunit-polyfills:1.0.1, protoc:v1.2.3, psalm, rector, symfony-cli, vapor-cli, wp-cli, pie',
[ [
'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://artifacts.setup-php.com/composer/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer', 'add_tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://artifacts.setup-php.com/composer/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
'add_composer_tool behat behat behat/ scoped', 'add_composer_tool behat behat behat/ scoped',
@@ -756,7 +755,6 @@ describe('Tools tests', () => {
'add_composer_tool rector rector rector/ scoped', 'add_composer_tool rector rector rector/ scoped',
'add_composer_tool backward-compatibility-check backward-compatibility-check roave/ scoped', 'add_composer_tool backward-compatibility-check backward-compatibility-check roave/ scoped',
'add_symfony latest', 'add_symfony latest',
'add_upsun 5.16.0',
'add_composer_tool vapor-cli vapor-cli laravel/ scoped', 'add_composer_tool vapor-cli vapor-cli laravel/ scoped',
'add_tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"', 'add_tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"',
'add_composer_tool easy-coding-standard easy-coding-standard symplify/ scoped', 'add_composer_tool easy-coding-standard easy-coding-standard symplify/ scoped',
@@ -772,7 +770,7 @@ describe('Tools tests', () => {
it.each([ it.each([
[ [
'blackfire, blackfire-player:1.2.3, cs2pr, churn, deployer, does_not_exist, flex, mago, name-collision-detector, phinx, phive:0.13.2, php-config, phpize, phpmd, simple-phpunit, symfony, upsun-cli, wp, pie', 'blackfire, blackfire-player:1.2.3, cs2pr, churn, deployer, does_not_exist, flex, mago, name-collision-detector, phinx, phive:0.13.2, php-config, phpize, phpmd, simple-phpunit, symfony, wp, pie',
[ [
'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://artifacts.setup-php.com/composer/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer', 'Add-Tool https://github.com/shivammathur/composer-cache/releases/latest/download/composer-7.4-stable.phar,https://artifacts.setup-php.com/composer/composer-7.4-stable.phar,https://dl.cloudsmith.io/public/shivammathur/composer-cache/raw/files/composer-7.4-stable.phar,https://getcomposer.org/composer-stable.phar composer',
'Add-Blackfire', 'Add-Blackfire',
@@ -791,7 +789,6 @@ describe('Tools tests', () => {
'Add-Tool https://github.com/phpmd/phpmd/releases/latest/download/phpmd.phar phpmd "--version"', 'Add-Tool https://github.com/phpmd/phpmd/releases/latest/download/phpmd.phar phpmd "--version"',
'Add-ComposerTool phpunit-bridge phpunit-bridge symfony/ global', 'Add-ComposerTool phpunit-bridge phpunit-bridge symfony/ global',
'Add-Symfony', 'Add-Symfony',
'Add-Upsun latest',
'Add-Tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"', 'Add-Tool https://github.com/wp-cli/builds/blob/gh-pages/phar/wp-cli.phar?raw=true wp-cli "--version"',
'Add-Tool https://github.com/php/pie/releases/latest/download/pie.phar pie "-V"' 'Add-Tool https://github.com/php/pie/releases/latest/download/pie.phar pie "-V"'
] ]
+2 -4
View File
@@ -51,10 +51,8 @@ describe('Utils tests', () => {
'utf8' 'utf8'
) )
}); });
expect(await utils.parseVersion('latest')).toBe('8.6'); expect(await utils.parseVersion('latest')).toBe('8.5');
expect(await utils.parseVersion('highest')).toBe('8.6'); expect(await utils.parseVersion('nightly')).toBe('8.6');
expect(await utils.parseVersion('8.x')).toBe('8.6');
expect(await utils.parseVersion('nightly')).toBe('8.7');
expect(await utils.parseVersion('master')).toBe('8.7'); expect(await utils.parseVersion('master')).toBe('8.7');
expect(await utils.parseVersion('8.7')).toBe('8.7'); expect(await utils.parseVersion('8.7')).toBe('8.7');
expect(await utils.parseVersion('8.7.0')).toBe('8.7'); expect(await utils.parseVersion('8.7.0')).toBe('8.7');
+1 -1
View File
File diff suppressed because one or more lines are too long
+123 -205
View File
@@ -17,21 +17,21 @@
"@eslint/js": "^10.0.1", "@eslint/js": "^10.0.1",
"@types/jest": "^30.0.0", "@types/jest": "^30.0.0",
"@types/node": "^26.6.6", "@types/node": "^26.6.6",
"@typescript-eslint/eslint-plugin": "^8.73.0", "@typescript-eslint/eslint-plugin": "^8.72.1",
"@typescript-eslint/parser": "^8.73.0", "@typescript-eslint/parser": "^8.72.1",
"@typescript/native": "npm:typescript@^7.0.2", "@typescript/native": "npm:typescript@^7.0.2",
"@vercel/ncc": "^0.45.0", "@vercel/ncc": "^0.45.0",
"eslint": "^10.15.0", "eslint": "^10.14.0",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.5", "eslint-import-resolver-typescript": "^4.4.5",
"eslint-plugin-import-x": "^4.18.1", "eslint-plugin-import-x": "^4.17.1",
"eslint-plugin-jest": "^29.17.1", "eslint-plugin-jest": "^29.17.0",
"eslint-plugin-prettier": "^5.5.7", "eslint-plugin-prettier": "^5.5.7",
"globals": "^17.14.0", "globals": "^17.14.0",
"jest": "^30.5.2", "jest": "^30.5.2",
"jest-circus": "^30.5.2", "jest-circus": "^30.5.2",
"nock": "^15.0.6", "nock": "^15.0.5",
"prettier": "^3.10.1", "prettier": "^3.9.10",
"simple-git-hooks": "^2.14.0", "simple-git-hooks": "^2.14.0",
"ts-jest": "^29.4.15", "ts-jest": "^29.4.15",
"typescript": "npm:@typescript/typescript6@^6.0.2" "typescript": "npm:@typescript/typescript6@^6.0.2"
@@ -688,15 +688,15 @@
} }
}, },
"node_modules/@eslint/config-array": { "node_modules/@eslint/config-array": {
"version": "0.23.7", "version": "0.23.5",
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.7.tgz", "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz",
"integrity": "sha512-Ix1tmZjA7/OmE7ROAfORe83hVnqlDzLpZVHFjHQt5mvLm1U03qMexpaxKqFIL362QV32SoPaZqmKQr3tdqFY2w==", "integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==",
"dev": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@eslint/object-schema": "^3.0.5", "@eslint/object-schema": "^3.0.5",
"debug": "^4.3.1", "debug": "^4.3.1",
"minimatch": "^11.0.5" "minimatch": "^10.2.4"
}, },
"engines": { "engines": {
"node": "^20.19.0 || ^22.13.0 || >=24" "node": "^20.19.0 || ^22.13.0 || >=24"
@@ -840,9 +840,9 @@
} }
}, },
"node_modules/@isaacs/nonrecursive-glob-match": { "node_modules/@isaacs/nonrecursive-glob-match": {
"version": "1.1.0", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.1.0.tgz", "resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.0.3.tgz",
"integrity": "sha512-GPm/Dbvk5RLmhRnxXIa7nTpK0xtl4E0wj0MslsuNiJ1FIROU+2+9lgUC/dgF7Ey4QCWhfEsgxilMRMCdHPfDfw==", "integrity": "sha512-SI7kyKHq4XXDRozw+r9GlRZkia1ZkFrpLW98r2IC2Bpr8YkFGE3fvjzmxCG0x78A++69HmDNrDvSMYBZmHGpKA==",
"dev": true, "dev": true,
"license": "BlueOak-1.0.0" "license": "BlueOak-1.0.0"
}, },
@@ -1386,9 +1386,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@mswjs/interceptors": { "node_modules/@mswjs/interceptors": {
"version": "0.45.14", "version": "0.44.0",
"resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.45.14.tgz", "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.44.0.tgz",
"integrity": "sha512-2y8lEnhEKzgxSoALB7ibIPpUJ68YqWmvGjYO2D6Z4dAmMAr7kG9Poh6HiW1poT+okHGSr6LgsbqO8rDDH7MsSg==", "integrity": "sha512-IYHevRStF4ijM20GI9c9Ndhw483NSAjCydQhUr4/zIB0BNLsTVw3vFAxTo6TlvX4QnV60wEHttUa9539TTAq+A==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -1397,7 +1397,7 @@
"debug": "^4.4.3", "debug": "^4.4.3",
"is-node-process": "^1.2.0", "is-node-process": "^1.2.0",
"outvariant": "^1.4.3", "outvariant": "^1.4.3",
"rettime": "^0.11.12" "rettime": "^0.11.11"
}, },
"engines": { "engines": {
"node": ">=22" "node": ">=22"
@@ -1947,17 +1947,17 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/@typescript-eslint/eslint-plugin": { "node_modules/@typescript-eslint/eslint-plugin": {
"version": "8.74.0", "version": "8.72.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.74.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.72.1.tgz",
"integrity": "sha512-z3KXk1+Vm+d82ZRplOoC89ho4Rf1da5ju6sx8//92GnN532U62DGPjECXkkVqtYzIv0zoJlpO39SX2Z9tk6LVw==", "integrity": "sha512-5CokTWXpmbylfFabsbvHC0CAw3XLaGnoa+nFJX5FR592h/LoZsENUE6p/rg5xvkKrFEXz6pYmgI29AgXc2N3BQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@eslint-community/regexpp": "^4.12.2", "@eslint-community/regexpp": "^4.12.2",
"@typescript-eslint/scope-manager": "8.74.0", "@typescript-eslint/scope-manager": "8.72.1",
"@typescript-eslint/type-utils": "8.74.0", "@typescript-eslint/type-utils": "8.72.1",
"@typescript-eslint/utils": "8.74.0", "@typescript-eslint/utils": "8.72.1",
"@typescript-eslint/visitor-keys": "8.74.0", "@typescript-eslint/visitor-keys": "8.72.1",
"ignore": "^7.0.5", "ignore": "^7.0.5",
"natural-compare": "^1.4.0", "natural-compare": "^1.4.0",
"ts-api-utils": "^2.5.0" "ts-api-utils": "^2.5.0"
@@ -1970,22 +1970,22 @@
"url": "https://opencollective.com/typescript-eslint" "url": "https://opencollective.com/typescript-eslint"
}, },
"peerDependencies": { "peerDependencies": {
"@typescript-eslint/parser": "^8.74.0", "@typescript-eslint/parser": "^8.72.1",
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
"typescript": ">=4.8.4 <6.1.0" "typescript": ">=4.8.4 <6.1.0"
} }
}, },
"node_modules/@typescript-eslint/parser": { "node_modules/@typescript-eslint/parser": {
"version": "8.74.0", "version": "8.72.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.74.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.72.1.tgz",
"integrity": "sha512-ecr8AYdig7avVkxaHdQvxHnIJ/mOyliO4Gv/uWF8q69vBew/z3sexqBwHUZX5Vql+Ns0w4sH6gBLkICGbOvJkA==", "integrity": "sha512-ZGwZP4OCfyA0AQTpEAMWz+rtX01DRhQWW5hB0ucKDEIX5U7jdmPSaMx94rQfaPAQzIYz2BimOgKOJtjfpRFQ9g==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/scope-manager": "8.74.0", "@typescript-eslint/scope-manager": "8.72.1",
"@typescript-eslint/types": "8.74.0", "@typescript-eslint/types": "8.72.1",
"@typescript-eslint/typescript-estree": "8.74.0", "@typescript-eslint/typescript-estree": "8.72.1",
"@typescript-eslint/visitor-keys": "8.74.0", "@typescript-eslint/visitor-keys": "8.72.1",
"debug": "^4.4.3" "debug": "^4.4.3"
}, },
"engines": { "engines": {
@@ -2000,49 +2000,15 @@
"typescript": ">=4.8.4 <6.1.0" "typescript": ">=4.8.4 <6.1.0"
} }
}, },
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": {
"version": "8.74.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.74.0.tgz",
"integrity": "sha512-wL348k6l92DNG+kPP5rVpKwNBoz7a3xRZy3TPKc1uymQttd7u7gcMv3eENmcuh4CjC4mO3FTM0DYstFXMyDLuw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/project-service": "8.74.0",
"@typescript-eslint/tsconfig-utils": "8.74.0",
"@typescript-eslint/types": "8.74.0",
"@typescript-eslint/visitor-keys": "8.74.0",
"debug": "^4.4.3",
"minimatch": "^11.0.1",
"semver": "^7.7.3",
"tinyglobby": "^0.2.15",
"ts-api-utils": "^2.5.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"@typescript/native": "npm:typescript@>=7.1.0-dev.20261009.1 || >=7.1.0-beta <7.1.0-dev",
"typescript": ">=4.8.4 <6.1.0"
},
"peerDependenciesMeta": {
"@typescript/native": {
"optional": true
}
}
},
"node_modules/@typescript-eslint/project-service": { "node_modules/@typescript-eslint/project-service": {
"version": "8.74.0", "version": "8.72.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.74.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.72.1.tgz",
"integrity": "sha512-z/mymuE+JlEeSFIv3Mo70EvgG1Zz74Hl0IDfExfXutARAP834bt+MppTD7mVAwmZO0GdxdOAi0jbTam749eH6g==", "integrity": "sha512-fAuVMkwdO/huI8nyo/WKnNKf6Gag93S56Rh3Ts5mGcavwSdaN8tRg1gCeIGX8PF+nzp1BjGfO4gHhGzW1J6jTg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/tsconfig-utils": "^8.74.0", "@typescript-eslint/tsconfig-utils": "^8.72.1",
"@typescript-eslint/types": "^8.74.0", "@typescript-eslint/types": "^8.72.1",
"debug": "^4.4.3" "debug": "^4.4.3"
}, },
"engines": { "engines": {
@@ -2057,14 +2023,14 @@
} }
}, },
"node_modules/@typescript-eslint/scope-manager": { "node_modules/@typescript-eslint/scope-manager": {
"version": "8.74.0", "version": "8.72.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.74.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.72.1.tgz",
"integrity": "sha512-kpOdpu4CpWN5U38ox3f727DwWRBtUAVhyUJtqTBYe5gf2wYoxac7PgKP14txrxN7ICVtcjlLdzjqfRgpSnDKvQ==", "integrity": "sha512-lC/t6eMCZZQAAKZEYGL6RDVSuFehpdmMT6h+nJIjIa6oylN/PwDgDVtEIbB7O9xFfZYtZAYLoLlDNWKJhtF+uQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.74.0", "@typescript-eslint/types": "8.72.1",
"@typescript-eslint/visitor-keys": "8.74.0" "@typescript-eslint/visitor-keys": "8.72.1"
}, },
"engines": { "engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -2075,9 +2041,9 @@
} }
}, },
"node_modules/@typescript-eslint/tsconfig-utils": { "node_modules/@typescript-eslint/tsconfig-utils": {
"version": "8.74.0", "version": "8.72.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.74.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.72.1.tgz",
"integrity": "sha512-p07wAuaS6BjCYgOSXKJi4YhvTnAf7fiG37e9THcpnYaQEt2QiTTYZWKwUFNgeRiywiMudazhzgddAirZ0GgHtQ==", "integrity": "sha512-e4D5R5vpeAEPBxT2BAzsFQL3sbwyeeeo5+aczgNSRK1V734jE7pTqaGFU+fXapWEQwnZbpFaTn32+Z8DwS6OTg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -2092,15 +2058,15 @@
} }
}, },
"node_modules/@typescript-eslint/type-utils": { "node_modules/@typescript-eslint/type-utils": {
"version": "8.74.0", "version": "8.72.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.74.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.72.1.tgz",
"integrity": "sha512-CV3Y3la8l3F9ANfxcfpgSSiQgJTe4IeLEoZV4O/gcW86Ugp8X6SKiQ0vm+QegXaRIbbDMokZZSF3A1CgiU/kPw==", "integrity": "sha512-iY2wlmyrXJmx4yxUGP3aYCFF3cA/6ShddOKmLU2dx7LnEykbAM8WThlxZEfd1NddqceF6eJmZUayxx9oKIYNlg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.74.0", "@typescript-eslint/types": "8.72.1",
"@typescript-eslint/typescript-estree": "8.74.0", "@typescript-eslint/typescript-estree": "8.72.1",
"@typescript-eslint/utils": "8.74.0", "@typescript-eslint/utils": "8.72.1",
"debug": "^4.4.3", "debug": "^4.4.3",
"ts-api-utils": "^2.5.0" "ts-api-utils": "^2.5.0"
}, },
@@ -2116,19 +2082,33 @@
"typescript": ">=4.8.4 <6.1.0" "typescript": ">=4.8.4 <6.1.0"
} }
}, },
"node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { "node_modules/@typescript-eslint/types": {
"version": "8.74.0", "version": "8.72.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.74.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.72.1.tgz",
"integrity": "sha512-wL348k6l92DNG+kPP5rVpKwNBoz7a3xRZy3TPKc1uymQttd7u7gcMv3eENmcuh4CjC4mO3FTM0DYstFXMyDLuw==", "integrity": "sha512-LmE5IhQet1BWOWEXqBrVtBPsMAOQ6Nzk35d+WLh3mk4EUF33sqlfxjio1MdYeSvKSG5skactKKuixBIKXhL4Rw==",
"dev": true,
"license": "MIT",
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
}
},
"node_modules/@typescript-eslint/typescript-estree": {
"version": "8.72.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.72.1.tgz",
"integrity": "sha512-DAlUoUV93hIvrtIQLwCbmZQYVZwOMhiHJrOVUUIWicFZaIYjTRqlY3I/NZevfkLmSqkNHRu2qYDcq9lrn16oOQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/project-service": "8.74.0", "@typescript-eslint/project-service": "8.72.1",
"@typescript-eslint/tsconfig-utils": "8.74.0", "@typescript-eslint/tsconfig-utils": "8.72.1",
"@typescript-eslint/types": "8.74.0", "@typescript-eslint/types": "8.72.1",
"@typescript-eslint/visitor-keys": "8.74.0", "@typescript-eslint/visitor-keys": "8.72.1",
"debug": "^4.4.3", "debug": "^4.4.3",
"minimatch": "^11.0.1", "minimatch": "^10.2.2",
"semver": "^7.7.3", "semver": "^7.7.3",
"tinyglobby": "^0.2.15", "tinyglobby": "^0.2.15",
"ts-api-utils": "^2.5.0" "ts-api-utils": "^2.5.0"
@@ -2141,40 +2121,20 @@
"url": "https://opencollective.com/typescript-eslint" "url": "https://opencollective.com/typescript-eslint"
}, },
"peerDependencies": { "peerDependencies": {
"@typescript/native": "npm:typescript@>=7.1.0-dev.20261009.1 || >=7.1.0-beta <7.1.0-dev",
"typescript": ">=4.8.4 <6.1.0" "typescript": ">=4.8.4 <6.1.0"
},
"peerDependenciesMeta": {
"@typescript/native": {
"optional": true
}
}
},
"node_modules/@typescript-eslint/types": {
"version": "8.74.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.74.0.tgz",
"integrity": "sha512-MpnMrJCVNpP1iVL8NiHkQZgQqIMBH5ewDGUPBh1pqQXwFtMFjsl1M03QcYPXmv6stCKEiF0PN7CGbU1ZbXFzEA==",
"dev": true,
"license": "MIT",
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
} }
}, },
"node_modules/@typescript-eslint/utils": { "node_modules/@typescript-eslint/utils": {
"version": "8.74.0", "version": "8.72.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.74.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.72.1.tgz",
"integrity": "sha512-IpWXPxXXomzxyTcvjhZJexgdvtTR1TooLAPpuxzaGqQ8BHll1lf4Ysp/BTE/l0U5TJ+x1j7B4bEM8pLRrvY+XA==", "integrity": "sha512-5v5liypurJBFHCBNqh/RjsymAD+VWcE0djuGY/BUqp5fC3Qn+luWDEksjuTtWjPn6i5zQlUtkZCRG/CYG0yCkA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.9.1", "@eslint-community/eslint-utils": "^4.9.1",
"@typescript-eslint/scope-manager": "8.74.0", "@typescript-eslint/scope-manager": "8.72.1",
"@typescript-eslint/types": "8.74.0", "@typescript-eslint/types": "8.72.1",
"@typescript-eslint/typescript-estree": "8.74.0" "@typescript-eslint/typescript-estree": "8.72.1"
}, },
"engines": { "engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -2188,48 +2148,14 @@
"typescript": ">=4.8.4 <6.1.0" "typescript": ">=4.8.4 <6.1.0"
} }
}, },
"node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": {
"version": "8.74.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.74.0.tgz",
"integrity": "sha512-wL348k6l92DNG+kPP5rVpKwNBoz7a3xRZy3TPKc1uymQttd7u7gcMv3eENmcuh4CjC4mO3FTM0DYstFXMyDLuw==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/project-service": "8.74.0",
"@typescript-eslint/tsconfig-utils": "8.74.0",
"@typescript-eslint/types": "8.74.0",
"@typescript-eslint/visitor-keys": "8.74.0",
"debug": "^4.4.3",
"minimatch": "^11.0.1",
"semver": "^7.7.3",
"tinyglobby": "^0.2.15",
"ts-api-utils": "^2.5.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"@typescript/native": "npm:typescript@>=7.1.0-dev.20261009.1 || >=7.1.0-beta <7.1.0-dev",
"typescript": ">=4.8.4 <6.1.0"
},
"peerDependenciesMeta": {
"@typescript/native": {
"optional": true
}
}
},
"node_modules/@typescript-eslint/visitor-keys": { "node_modules/@typescript-eslint/visitor-keys": {
"version": "8.74.0", "version": "8.72.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.74.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.72.1.tgz",
"integrity": "sha512-XSZmOtMUbWCBIM+2BK134FyMFxmll1mW2mPLk/PSwYQYzGIPMgJAqL929U4qXVizLv7Xq5b7r41/o7Ombuwk0g==", "integrity": "sha512-SB8xqipSzZHUePCCLNeYxqnxq83X61/qzNhjQGbTfjxGZIeOEP7tBgWYX05Tcd6CgE02WdTJnh5b8kMZJ/+bnQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.74.0", "@typescript-eslint/types": "8.72.1",
"eslint-visitor-keys": "^5.0.0" "eslint-visitor-keys": "^5.0.0"
}, },
"engines": { "engines": {
@@ -3487,9 +3413,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/cross-spawn": { "node_modules/cross-spawn": {
"version": "7.1.2", "version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.1.2.tgz", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
"integrity": "sha512-8BPK2r+sKWC8sDinRwLwrFMq2lXTBBwzYYEB9LiCznfMurOi4FOvQflq3XOLGG+HPdMSVpe+k/s96+AtDEOgPg==", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -3542,9 +3468,10 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/deepmerge": { "node_modules/deepmerge": {
"version": "4.3.1", "name": "@shivammathur/deepmerge",
"resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", "version": "4.3.2",
"integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "resolved": "https://registry.npmjs.org/@shivammathur/deepmerge/-/deepmerge-4.3.2.tgz",
"integrity": "sha512-OBZnBsXwbBITC90wXf9Ph8W7OAUkhFdM+BGRYeIQwt5nILxy5wkk2plUoabi9Yp6xm0c/Yv9PuLiGBXnfizAMA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -3639,9 +3566,9 @@
} }
}, },
"node_modules/eslint": { "node_modules/eslint": {
"version": "10.16.0", "version": "10.14.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.16.0.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.14.0.tgz",
"integrity": "sha512-Xu3PRLG/wCaZWZ20gkExUcNqL2mWWsXTR+Lln3Sof4Y9WuA678fH9hrlQ8B6UNwbTnsKdDdBYOd2jxtycXVTGQ==", "integrity": "sha512-T0pNsxkb9IKmtQjhpK3d7nWOpFv+YHuMbTJnSVMoQblF0onvXfErrtp4V1jHtsQPan7dKaGVD0q1WCXnzMF31A==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"workspaces": [ "workspaces": [
@@ -3650,7 +3577,7 @@
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/eslint-utils": "^4.8.0",
"@eslint-community/regexpp": "^4.12.2", "@eslint-community/regexpp": "^4.12.2",
"@eslint/config-array": "^0.23.7", "@eslint/config-array": "^0.23.5",
"@eslint/config-helpers": "^0.7.0", "@eslint/config-helpers": "^0.7.0",
"@eslint/core": "^1.2.1", "@eslint/core": "^1.2.1",
"@eslint/plugin-kit": "^0.7.3", "@eslint/plugin-kit": "^0.7.3",
@@ -3675,7 +3602,7 @@
"imurmurhash": "^0.1.4", "imurmurhash": "^0.1.4",
"is-glob": "^4.0.0", "is-glob": "^4.0.0",
"json-stable-stringify-without-jsonify": "^1.0.1", "json-stable-stringify-without-jsonify": "^1.0.1",
"minimatch": "^11.0.5", "minimatch": "^10.2.6",
"natural-compare": "^1.4.0", "natural-compare": "^1.4.0",
"optionator": "^0.9.3" "optionator": "^0.9.3"
}, },
@@ -3774,20 +3701,18 @@
} }
}, },
"node_modules/eslint-plugin-import-x": { "node_modules/eslint-plugin-import-x": {
"version": "4.18.1", "version": "4.17.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.18.1.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.17.1.tgz",
"integrity": "sha512-D1h++38NS2Z40zf8jbd2OHqDrnIFRKpdp8sL0jP4xSDGZj6MNwEQua8F+r3tOWjcHrsWuhHOJ7wASWioJ31tfg==", "integrity": "sha512-4cdstYkKCyjumM2Q9NSI03K8D2a9F4Ssz33K2lv2hQa4KmR9jPLwk3uWGtNvclfqBrPGfGuMBwsGMbe6dMRbfg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "^8.56.0", "@typescript-eslint/types": "^8.56.0",
"cjs-module-lexer": "^2.2.1",
"comment-parser": "^1.4.1", "comment-parser": "^1.4.1",
"debug": "^4.4.1", "debug": "^4.4.1",
"es-module-lexer": "^3.0.3",
"eslint-import-context": "^0.1.9", "eslint-import-context": "^0.1.9",
"is-glob": "^4.0.3", "is-glob": "^4.0.3",
"minimatch": "^9.0.3 || ^10.1.2 || ^11.0.1", "minimatch": "^9.0.3 || ^10.1.2",
"semver": "^7.7.2", "semver": "^7.7.2",
"stable-hash-x": "^0.2.0", "stable-hash-x": "^0.2.0",
"unrs-resolver": "^1.9.2" "unrs-resolver": "^1.9.2"
@@ -3812,17 +3737,10 @@
} }
} }
}, },
"node_modules/eslint-plugin-import-x/node_modules/es-module-lexer": {
"version": "3.0.5",
"resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-3.0.5.tgz",
"integrity": "sha512-RNq2lKJw53c7z9QRHeiKeA6Ez0oikOqiBGdmxQhKDxEiOX1g5QJR4IoFVwicn8uCZcRWNrXC3NZaJihgK7aEbg==",
"dev": true,
"license": "MIT"
},
"node_modules/eslint-plugin-jest": { "node_modules/eslint-plugin-jest": {
"version": "29.17.2", "version": "29.17.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.17.2.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.17.0.tgz",
"integrity": "sha512-PkDicB9njFXWby0rfpHSMGLkNf37c6EavIDUPNXVv1BGRLyr1nnea4jRc1EFOlUTZCW5iGzVGGHXb/siEf+QmQ==", "integrity": "sha512-6jtpU6MhYKbagkES02TupWAUUooJpZtKg94Ax0b8HhUorv3InSTBU8RRtlSBe0LocOcShXOpyec3PHzPDkJCSg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -4254,13 +4172,13 @@
} }
}, },
"node_modules/glob": { "node_modules/glob": {
"version": "14.0.7", "version": "14.0.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-14.0.7.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-14.0.3.tgz",
"integrity": "sha512-ob8P0VbyEjcLG2ycNYmzYhZj65kkcN5b7tt5moGhTq3rkXtuU8MB+i0GIzPtLnSHVF2DkK4M+nQRojDvsOGVJw==", "integrity": "sha512-A1vjIwC3qpdCso45Iw127gnp7sPhqgY8lUQhDrArIs+GbmfaaVPFuoyy7WyLT9EPZCRZ7j7aLdwUhQmHWesEow==",
"dev": true, "dev": true,
"license": "BlueOak-1.0.0", "license": "BlueOak-1.0.0",
"dependencies": { "dependencies": {
"minimatch": "^11.0.5", "minimatch": "^11.0.2",
"minipass": "^7.1.3", "minipass": "^7.1.3",
"path-scurry": "^3.0.0" "path-scurry": "^3.0.0"
}, },
@@ -5302,17 +5220,17 @@
} }
}, },
"node_modules/minimatch": { "node_modules/minimatch": {
"version": "11.0.10", "version": "11.0.3",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.10.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.3.tgz",
"integrity": "sha512-L3/cjhQ5E6lft0VCp/2mO3Ic74RnutKy3rz7iGwp/6w1hKcO262g2rbfacFyw6eBig5OdI0nu5PpuA0/WQs9Tw==", "integrity": "sha512-iny/40PEGkNJQ5/Pv6z3nm6FbRAby32GeZRjCUJk2WnNDbgPSTcdI+DDvLqsgBdD4cD5sMtMheqPPnehCCa8Nw==",
"dev": true, "dev": true,
"license": "BlueOak-1.0.0", "license": "BlueOak-1.0.0",
"dependencies": { "dependencies": {
"@isaacs/nonrecursive-glob-match": "^1.1.0", "@isaacs/nonrecursive-glob-match": "^1.0.3",
"brace-expansion": "^5.0.12" "brace-expansion": "^5.0.12"
}, },
"engines": { "engines": {
"node": "20 || >=22" "node": "18 || 20 || >=22"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/isaacs" "url": "https://github.com/sponsors/isaacs"
@@ -5376,13 +5294,13 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/nock": { "node_modules/nock": {
"version": "15.0.7", "version": "15.0.5",
"resolved": "https://registry.npmjs.org/nock/-/nock-15.0.7.tgz", "resolved": "https://registry.npmjs.org/nock/-/nock-15.0.5.tgz",
"integrity": "sha512-BH7UHCRo/zHX0PT0oyz6RH0KZwkYo6TiSF5eJ3gg8lrvtSW6aKiNAXTmWUbHxmjMfvvrTT0ygl7/WM15XoAthg==", "integrity": "sha512-nVeuZGS2we1PyvqbW082Qj0EB4bd//6pZk/zOPDlaTPU72qcWrqfHg3kx9JcBcH1fJxwJHjmsfuQ4mss42su4w==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@mswjs/interceptors": "^0.45.14" "@mswjs/interceptors": "^0.44.0"
}, },
"engines": { "engines": {
"node": ">=22.20.0" "node": ">=22.20.0"
@@ -5694,9 +5612,9 @@
} }
}, },
"node_modules/prettier": { "node_modules/prettier": {
"version": "3.10.1", "version": "3.9.10",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.10.1.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.10.tgz",
"integrity": "sha512-70vp3ZUYoPlFbF9uiTdXHUUCGEIp7d4+6p+8DYbkm2jP7x/3i/paXVF6dopSI3zd/CEitrZN1rc4i85xWmmXlg==", "integrity": "sha512-skGHTH1Yb9QvaTC4hWnRTzEYtCpApF0UMBPz+t/0ZPzP8ihefo/btKd+QA7pUE0fEwA1SbS/NmhyEcstdXOIdA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"bin": { "bin": {
@@ -5842,9 +5760,9 @@
} }
}, },
"node_modules/rettime": { "node_modules/rettime": {
"version": "0.11.13", "version": "0.11.12",
"resolved": "https://registry.npmjs.org/rettime/-/rettime-0.11.13.tgz", "resolved": "https://registry.npmjs.org/rettime/-/rettime-0.11.12.tgz",
"integrity": "sha512-kzDWDmrxn6KPqqyFaBcXtV+GzaUzgYulSrWBetyxsPZjlXabWoeg3uZJU+zK/TnFUtkWC2Yw7J/VAWYnzy0tRA==", "integrity": "sha512-5ExtR1ppiDBQkVoPw5NAqdbfH4Iq2VOmQKHMtUoaFxA9bo2krzFYBtyq6K40xxbYp+2w/YOr6D+1ToF6tTN53A==",
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
+9 -8
View File
@@ -44,28 +44,29 @@
"@eslint/js": "^10.0.1", "@eslint/js": "^10.0.1",
"@types/jest": "^30.0.0", "@types/jest": "^30.0.0",
"@types/node": "^26.6.6", "@types/node": "^26.6.6",
"@typescript-eslint/eslint-plugin": "^8.73.0", "@typescript-eslint/eslint-plugin": "^8.72.1",
"@typescript-eslint/parser": "^8.73.0", "@typescript-eslint/parser": "^8.72.1",
"@typescript/native": "npm:typescript@^7.0.2", "@typescript/native": "npm:typescript@^7.0.2",
"@vercel/ncc": "^0.45.0", "@vercel/ncc": "^0.45.0",
"eslint": "^10.15.0", "eslint": "^10.14.0",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.5", "eslint-import-resolver-typescript": "^4.4.5",
"eslint-plugin-import-x": "^4.18.1", "eslint-plugin-import-x": "^4.17.1",
"eslint-plugin-jest": "^29.17.1", "eslint-plugin-jest": "^29.17.0",
"eslint-plugin-prettier": "^5.5.7", "eslint-plugin-prettier": "^5.5.7",
"globals": "^17.14.0", "globals": "^17.14.0",
"jest": "^30.5.2", "jest": "^30.5.2",
"jest-circus": "^30.5.2", "jest-circus": "^30.5.2",
"nock": "^15.0.6", "nock": "^15.0.5",
"prettier": "^3.10.1", "prettier": "^3.9.10",
"simple-git-hooks": "^2.14.0", "simple-git-hooks": "^2.14.0",
"ts-jest": "^29.4.15", "ts-jest": "^29.4.15",
"typescript": "npm:@typescript/typescript6@^6.0.2" "typescript": "npm:@typescript/typescript6@^6.0.2"
}, },
"overrides": { "overrides": {
"deepmerge": "npm:@shivammathur/deepmerge@4.3.2",
"glob": "^14.0.3", "glob": "^14.0.3",
"minimatch": "^11.0.10" "minimatch": "^11.0.3"
}, },
"bugs": { "bugs": {
"url": "https://github.com/shivammathur/setup-php/issues" "url": "https://github.com/shivammathur/setup-php/issues"
+4 -4
View File
@@ -1,10 +1,10 @@
{ {
"lowest": "8.1", "lowest": "8.1",
"highest": "8.6", "highest": "8.5",
"latest": "8.6", "latest": "8.5",
"nightly": "8.7", "nightly": "8.6",
"master": "8.7", "master": "8.7",
"5.x": "5.6", "5.x": "5.6",
"7.x": "7.4", "7.x": "7.4",
"8.x": "8.6" "8.x": "8.5"
} }
+111
View File
@@ -0,0 +1,111 @@
{
"amqp": "php-amqp/php-amqp",
"apcu": "apcu/apcu",
"apfd": "m6w6/ext-apfd",
"arrow": "flow-php/arrow-ext",
"ast": "nikic/php-ast",
"biscuit_php": "ptondereau/biscuit-php",
"bitset": "pecl/bitset",
"brotli": "kjdev/brotli",
"bsdiff": "bsdiff/bsdiff",
"csv": "girgias/csv",
"dbus": "pecl/dbus",
"decimal": "php-decimal/ext-decimal",
"deepclone": "symfony/deepclone",
"dio": "pecl/dio",
"ds": "php-ds/ext-ds",
"ev": "osmanov/pecl-ev",
"event": "osmanov/pecl-event",
"excel": "iliaal/php-excel",
"excimer": "wikimedia/excimer",
"fast_uuid": "iliaal/fast_uuid",
"fastchart": "iliaal/fastchart",
"fastjson": "iliaal/fastjson",
"geospatial": "php-geospatial/geospatial",
"glfw": "mario-deluna/php-glfw",
"grpc": "grpc/grpc-php-ext",
"hdr_histogram": "beberlei/hdrhistogram",
"hdrhistogram": "beberlei/hdrhistogram",
"highlighter": "yiipress/highlighter",
"http": "m6w6/ext-http",
"igbinary": "igbinary/igbinary",
"imagick": "imagick/imagick",
"inotify": "arnaud-lb/inotify",
"ip2location": "ip2location/ip2location-pie",
"ip2proxy": "ip2location/ip2proxy-pie",
"json_post": "m6w6/ext-json_post",
"jsonpath": "supermetrics/jsonpath",
"judy": "orieg/judy",
"krb5": "pecl/krb5",
"lchash": "iliaal/lchash",
"luasandbox": "wikimedia/luasandbox",
"lz4": "kjdev/lz4",
"lzf": "pecl/lzf",
"mailparse": "pecl/mailparse",
"maxminddb": "maxmind-db/reader-ext",
"mcrypt": "pecl/mcrypt",
"mdparser": "iliaal/mdparser",
"memcached": "php-memcached/php-memcached",
"memprof": "arnaud-lb/memprof",
"mjml": "kcs/mjml",
"mongodb": "mongodb/mongodb-extension",
"msgpack": "msgpack/msgpack-php",
"mustache": "jbboehr/php-mustache",
"oci8": "oci8/oci8",
"openswoole": "openswoole/ext-openswoole",
"opentelemetry": "open-telemetry/ext-opentelemetry",
"operator": "jblo/operator",
"parallel": "pecl/parallel",
"pcov": "pecl/pcov",
"pdo_duckdb": "thomas-0816/pdo-duckdb-php",
"pdo_oci": "pecl/pdo_oci",
"pdo_sqlsrv": "microsoft/pdo_sqlsrv",
"pecl_http": "m6w6/ext-http",
"phalcon": "phalcon/cphalcon",
"phonetic": "iliaal/phonetic",
"phpser": "iliaal/phpser",
"phpstan_turbo": "phpstan/turbo",
"pkcs11": "gamringer/pkcs11",
"pq": "m6w6/ext-pq",
"quickhash": "derickr/quickhash",
"raphf": "m6w6/ext-raphf",
"rar": "cataphract/rar",
"rdkafka": "rdkafka/rdkafka",
"redis": "phpredis/phpredis",
"relay": "cachewerk/ext-relay",
"rpminfo": "remi/rpminfo",
"scrypt": "woohoolabs/php-scrypt",
"selinux": "pecl/selinux",
"snappy": "kjdev/snappy",
"solr": "pecl/solr",
"spx": "noisebynorthwest/php-spx",
"sqlsrv": "microsoft/sqlsrv",
"statgrab": "iliaal/statgrab",
"swoole": "swoole/swoole",
"swow": "swow/swow-extension",
"taint": "laruence/taint",
"tensor": "rubix/tensor_ext",
"timezonedb": "pecl/timezonedb",
"translit": "derickr/translit",
"uopz": "krakjoe/uopz",
"uuid": "pecl/uuid",
"uv": "amphp/uv",
"valkey_glide": "valkey-io/valkey-glide-php",
"vld": "derickr/vld",
"wikidiff2": "wikimedia/wikidiff2",
"win32service": "win32service/win32service",
"xattr": "pecl/xattr",
"xdebug": "xdebug/xdebug",
"xdiff": "pecl/xdiff",
"xlswriter": "viest/xlswriter",
"xmldiff": "pecl/xml-xmldiff",
"xpass": "remi/xpass",
"yac": "laruence/yac",
"yaconf": "laruence/yaconf",
"yaf": "laruence/yaf",
"yaml": "pecl/yaml",
"yar": "laruence/yar",
"yaz": "indexdata/yaz",
"zip": "pecl/zip",
"zstd": "kjdev/zstd"
}
-8
View File
@@ -288,14 +288,6 @@
"version_prefix": "v", "version_prefix": "v",
"version_parameter": "-V" "version_parameter": "-V"
}, },
"upsun-cli": {
"alias": "upsun",
"type": "custom-package",
"repository": "upsun/cli",
"domain": "https://github.com",
"version_prefix": "v",
"version_parameter": "--version"
},
"blackfire-player": { "blackfire-player": {
"type": "custom-function", "type": "custom-function",
"domain": "https://get.blackfire.io", "domain": "https://get.blackfire.io",
+4 -4
View File
@@ -31,14 +31,14 @@ export async function addExtensionDarwin(
case /.+-.+\/.+@.+/.test(extension): case /.+-.+\/.+@.+/.test(extension):
add_script += await utils.parseExtensionSource(extension, ext_prefix); add_script += await utils.parseExtensionSource(extension, ext_prefix);
return; return;
// match 7.4relay...8.6relay // match 7.4relay...8.5relay
// match 5.3blackfire...8.5blackfire // match 5.3blackfire...8.5blackfire
// match 5.3blackfire-(semver)...8.5blackfire-(semver) // match 5.3blackfire-(semver)...8.5blackfire-(semver)
// match couchbase, event, geos, ibm_db2, pdo_ibm, pdo_oci, oci8, http, pecl_http // match couchbase, event, geos, ibm_db2, pdo_ibm, pdo_oci, oci8, http, pecl_http
// match 5.3ioncube...8.5ioncube // match 5.3ioncube...8.5ioncube
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.4phalcon5 // match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, and 7.4phalcon5...8.4phalcon5
// match 7.0zephir_parser...8.5zephir_parser // match 7.0zephir_parser...8.5zephir_parser
case /^(7\.4|8\.[0-6])relay(-v?\d+\.\d+\.\d+|-nightly)?$/.test( case /^(7\.4|8\.[0-5])relay(-v?\d+\.\d+\.\d+|-nightly)?$/.test(
version_extension version_extension
): ):
case /^(5\.[3-6]|7\.[0-4]|8\.[0-5])blackfire(-\d+\.\d+\.\d+)?$/.test( case /^(5\.[3-6]|7\.[0-4]|8\.[0-5])blackfire(-\d+\.\d+\.\d+)?$/.test(
@@ -277,7 +277,7 @@ export async function addExtensionLinux(
case /.+-.+\/.+@.+/.test(extension): case /.+-.+\/.+@.+/.test(extension):
add_script += await utils.parseExtensionSource(extension, ext_prefix); add_script += await utils.parseExtensionSource(extension, ext_prefix);
return; return;
// match 7.4relay...8.6relay // match 7.4relay...8.5relay
// match 5.3blackfire...8.5blackfire // match 5.3blackfire...8.5blackfire
// match 5.3blackfire-(semver)...8.5blackfire-(semver) // match 5.3blackfire-(semver)...8.5blackfire-(semver)
// match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid // match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid
@@ -285,7 +285,7 @@ export async function addExtensionLinux(
// match 5.3ioncube...8.5ioncube // match 5.3ioncube...8.5ioncube
// match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, 7.4phalcon5...8.4phalcon5 // match 7.0phalcon3...7.3phalcon3, 7.2phalcon4...7.4phalcon4, 7.4phalcon5...8.4phalcon5
// match 7.0zephir_parser...8.5zephir_parser // match 7.0zephir_parser...8.5zephir_parser
case /^(7\.4|8\.[0-6])relay(-v?\d+\.\d+\.\d+|-nightly)?$/.test( case /^(7\.4|8\.[0-5])relay(-v?\d+\.\d+\.\d+|-nightly)?$/.test(
version_extension version_extension
): ):
case /^(5\.[3-6]|7\.[0-4]|8\.[0-5])blackfire(-\d+\.\d+\.\d+)?$/.test( case /^(5\.[3-6]|7\.[0-4]|8\.[0-5])blackfire(-\d+\.\d+\.\d+)?$/.test(
+1 -1
View File
@@ -16,7 +16,7 @@ export async function fetch(
redirect_count = 5 redirect_count = 5
): Promise<Record<string, string>> { ): Promise<Record<string, string>> {
const headers: Record<string, string> = { const headers: Record<string, string> = {
'User-Agent': `setup-php (${process.platform}; ${process.arch}; +https://setup-php.com)` 'User-Agent': `Mozilla/5.0 (${process.platform} ${process.arch}) setup-php`
}; };
if (auth_token) { if (auth_token) {
headers['Authorization'] = 'Bearer ' + auth_token; headers['Authorization'] = 'Bearer ' + auth_token;
+1 -1
View File
@@ -333,7 +333,7 @@ setup_php() {
} }
# Variables # Variables
version=${1:-'8.6'} version=${1:-'8.5'}
ini=${2:-'production'} ini=${2:-'production'}
src=${0%/*}/.. src=${0%/*}/..
php_formula=shivammathur/php/php@"$version" php_formula=shivammathur/php/php@"$version"
+61
View File
@@ -85,6 +85,67 @@ Function Add-ExtensionFromGithub {
} }
} }
# Function to install a PIE package or mapped version. Windows uses prebuilt DLLs.
Function Add-PieExtension {
Param (
[Parameter(Position = 0, Mandatory = $true)]
[ValidateNotNull()]
[string]
$extension,
[Parameter(Position = 1, Mandatory = $false)]
[string]
$package = '',
[Parameter(Position = 2, Mandatory = $false)]
[Alias('AllowSourceBuild')]
[bool]
$allow_source = $false
)
$requested = ($package -split ':', 2)[-1]
if ($package -notmatch '/') {
$mapping = Get-Content "$src\configs\pie-extensions.json" -Raw | ConvertFrom-Json
$package = $mapping.$extension
if (-not $package) { throw "No PIE package mapping for $extension" }
if ($requested -in @('', 'latest', 'stable')) { $requested = '' } else { $package += ":$requested" }
} elseif ($package -notmatch ':') {
$requested = ''
}
& "$php_dir\php.exe" -r 'exit(extension_loaded($argv[1]) && ($argv[2] === "" || phpversion($argv[1]) === $argv[2]) ? 0 : 1);' -- $extension "$requested" >$null 2>&1
if ($LASTEXITCODE -eq 0) {
Add-Log $tick $extension 'Enabled'
return
}
$pie_args = @('install', $package, '--no-interaction', '--skip-enable-extension', '--no-build-tools-check', '--no-system-dependencies-check', "--with-php-path=$php_dir\php.exe")
if (-not $allow_source) {
# Skip CPU detection when compilation is disabled.
$pie_args += @('--suppress-download-url-method=composer-default', '--suppress-download-url-method=pre-packaged-source', '--make-parallel-jobs=1')
}
New-Item -ItemType Directory -Path $composer_home -Force >$null
Set-ComposerAuth
$pie_log = Join-Path ([System.IO.Path]::GetTempPath()) "pie-$extension.log"
$pie_path = Join-Path $bin_dir 'pie'
if ([version]$installed.MajorMinorVersion -lt [version]'8.1') {
$pie_path = Join-Path $bin_dir 'pie-cli.exe'
if (-not (Test-Path $pie_path -PathType Leaf)) {
Get-File -Url https://github.com/php/pie/releases/latest/download/pie-Windows-X64.exe -OutFile $pie_path
}
& $pie_path @pie_args >$pie_log 2>&1
} else {
if (-not (Test-Path $pie_path -PathType Leaf)) {
Add-Tool https://github.com/php/pie/releases/latest/download/pie.phar pie '-V' >$null 2>&1
}
& "$php_dir\php.exe" $pie_path @pie_args >$pie_log 2>&1
}
if ($LASTEXITCODE -ne 0) {
Get-Content $pie_log | ForEach-Object { Write-Host $_ }
throw "Could not install $package using PIE (exit code $LASTEXITCODE)"
}
Enable-ExtensionDependencies $extension
Enable-PhpExtension -Extension $extension -Path $php_dir
& "$php_dir\php.exe" -r 'exit(extension_loaded($argv[1]) ? 0 : 1);' -- $extension >$null 2>&1
if ($LASTEXITCODE -ne 0) { throw "Could not load $extension after installing $package using PIE" }
Add-Log $tick $extension 'Installed and enabled'
}
# Function to add PHP extensions. # Function to add PHP extensions.
Function Add-Extension { Function Add-Extension {
Param ( Param (
+48
View File
@@ -188,6 +188,54 @@ get_pecl_version() {
echo "$response" | grep -Eio "$pattern" | head -n 1 | cut -d '>' -f 2 | cut -d '<' -f 1 echo "$response" | grep -Eio "$pattern" | head -n 1 | cut -d '>' -f 2 | cut -d '<' -f 1
} }
# Install a PIE package or mapped version: extension, package, allow_source=false, prefix.
pie_install() {
local extension=$1 package=${2:-} allow_source=${3:-false}
local prefix=${4:-$(get_extension_prefix "$extension")} requested pie_path php_config asset arch
requested=${package##*:}
if [[ "$package" != */* ]]; then
package=$(jq -er --arg extension "$extension" '.[$extension]' "${src:?}/configs/pie-extensions.json") || return 1
case "$requested" in ''|latest|stable) requested= ;; *) package="$package:$requested" ;; esac
elif [[ "$package" != *:* ]]; then
requested=
fi
if php -d display_errors=0 -r 'exit(extension_loaded($argv[1]) && ($argv[2] === "" || phpversion($argv[1]) === $argv[2]) ? 0 : 1);' -- "$extension" "$requested"; then
return 0
fi
local pie_args=(install "$package" --no-interaction --skip-enable-extension --no-build-tools-check --no-system-dependencies-check)
php_config=$(command -v php-config) || return 1
pie_args+=("--with-php-config=$php_config")
if [ "$allow_source" != true ]; then
# Skip CPU detection when compilation is disabled.
pie_args+=(--suppress-download-url-method=composer-default --suppress-download-url-method=pre-packaged-source --make-parallel-jobs=1)
fi
if php -r 'exit(PHP_VERSION_ID >= 80100 ? 0 : 1);'; then
if ! command -v pie >/dev/null 2>&1; then
add_tool https://github.com/php/pie/releases/latest/download/pie.phar pie '-V' >/dev/null 2>&1 || return 1
fi
pie_path=$(command -v pie) || return 1
else
arch=$(uname -m)
case "$arch" in x86_64|amd64) arch=X64 ;; arm64|aarch64) arch=ARM64 ;; *) return 1 ;; esac
asset="pie-$(uname -s)-$arch"
[ "$(uname -s)" != Darwin ] || asset="pie-macOS-$arch"
pie_path="${tool_path_dir:?}/pie-cli"
if [ ! -x "$pie_path" ]; then
[ "$(get -v -e "$pie_path" "https://github.com/php/pie/releases/latest/download/$asset")" = 200 ] || return 1
fi
fi
mkdir -p "${composer_home:?}"
set_composer_auth
sudo -E "$pie_path" "${pie_args[@]}" >"/tmp/pie-$extension.log" 2>&1 || {
local status=$?
cat "/tmp/pie-$extension.log" >&2
return "$status"
}
sudo rm -f /tmp/php"${version:?}"_extensions
enable_extension "$extension" "$prefix" || return 1
check_extension "$extension"
}
# Function to install PECL extensions and accept default options # Function to install PECL extensions and accept default options
pecl_install() { pecl_install() {
local extension=$1 local extension=$1
+1 -1
View File
@@ -31,7 +31,7 @@ add_cubrid_helper() {
set_cubrid_repo set_cubrid_repo
set_cubrid_branch set_cubrid_branch
patch_phpize patch_phpize
read -r "${ext}_CONFIGURE_PREFIX_OPTS" <<< "SED=sed CMAKE_POLICY_VERSION_MINIMUM=3.5 CFLAGS=-std=gnu17" read -r "${ext}_PREFIX_CONFIGURE_OPTS" <<< "CFLAGS=-Wno-implicit-function-declaration"
read -r "${ext}_CONFIGURE_OPTS" <<< "--with-php-config=$(command -v php-config)" read -r "${ext}_CONFIGURE_OPTS" <<< "--with-php-config=$(command -v php-config)"
add_extension_from_source "$ext" https://github.com CUBRID "$cubrid_repo" "$cubrid_branch" extension add_extension_from_source "$ext" https://github.com CUBRID "$cubrid_repo" "$cubrid_branch" extension
restore_phpize restore_phpize
+1 -1
View File
@@ -75,7 +75,7 @@ add_http_latest() {
if [ "$os" = "Linux" ]; then if [ "$os" = "Linux" ]; then
add_http_dependencies add_http_dependencies
package="php$version-http" package="php$version-http"
add_ppa >/dev/null 2>&1 add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
(check_package "$package" && install_packages "$package") || add_http_helper "$(get_http_version)" "$os" (check_package "$package" && install_packages "$package") || add_http_helper "$(get_http_version)" "$os"
else else
if ! [[ "${version:?}" =~ ${old_versions:?} ]]; then if ! [[ "${version:?}" =~ ${old_versions:?} ]]; then
+1 -30
View File
@@ -51,32 +51,6 @@ Function Get-Oci8DLL() {
return $null return $null
} }
# Function to restore OCI DLLs missing from a cached PHP build.
Function Add-BundledOci() {
$bundleVersion = $installed.FullVersion
# PHP 8.2.34 is the last Windows PHP 8.2 release containing the OCI DLLs.
if($version -eq '8.2' -and [version]$installed.Version -gt [version]'8.2.34') {
$bundleVersion = '8.2.34'
}
$threadSafety = if($ts) { '' } else { '-nts' }
$compiler = if($installed.VCVersion -ge 16) { 'vs' } elseif($version -eq '7.4') { 'vc' } else { 'VC' }
$asset = "php-$bundleVersion$threadSafety-Win32-$compiler$($installed.VCVersion)-$arch.zip"
$bundleDir = Join-Path ([IO.Path]::GetTempPath()) ([Guid]::NewGuid().ToString())
New-Item -ItemType Directory -Path $bundleDir > $null
try {
Get-File -Url "$php_windows/releases/$asset" -FallbackUrl "$php_windows/releases/archives/$asset" -OutFile "$bundleDir\php.zip"
Expand-Archive -Path "$bundleDir\php.zip" -DestinationPath $bundleDir -Force
Get-ChildItem "$bundleDir\ext\php_*oci*.dll" | ForEach-Object {
$dll = Get-PhpExtension -Path $_.FullName
if($dll.PhpVersion -eq $version -and $dll.Architecture -eq $arch -and $dll.ThreadSafe -eq $ts) {
Copy-Item $_.FullName $ext_dir -Force
}
}
} finally {
Remove-Item $bundleDir -Recurse -Force
}
}
# Function to install oci8 and pdo_oci. # Function to install oci8 and pdo_oci.
Function Add-Oci() { Function Add-Oci() {
Param ( Param (
@@ -89,10 +63,7 @@ Function Add-Oci() {
try { try {
$status = 'Enabled' $status = 'Enabled'
Add-InstantClient Add-InstantClient
if($version -lt '8.3') { if($version -lt '8.4') {
if(-not(Get-ChildItem "$ext_dir\php_$extension*.dll")) {
Add-BundledOci
}
if($version -lt '5.6' -and $extension -eq 'oci8') { if($version -lt '5.6' -and $extension -eq 'oci8') {
Add-Content -Value "`r`nextension=php_oci8.dll" -Path $php_dir\php.ini Add-Content -Value "`r`nextension=php_oci8.dll" -Path $php_dir\php.ini
} else { } else {
@@ -1,11 +0,0 @@
patch_pdo_cubrid() {
if [[ ${version:?} =~ ^7\.[0-2]$ ]] && [ -f cubrid_driver7.c ]; then
# Match the PHP 7 PDO callbacks and store zvals with the PHP 7 hash API.
sed -i.bak \
-e 's/const char \*sql, long sql_len/const char *sql, size_t sql_len/g' \
-e 's/static long cubrid_handle_doer/static zend_long cubrid_handle_doer/' \
-e 's/zend_hash_index_update_ptr(HASH_OF(arg), index, (void \*)\&tmp_zval)/zend_hash_index_update(HASH_OF(arg), index, \&tmp_zval)/' \
-e 's/(cubrid_retval = zend_hash_update(HASH_OF(arg), key, (void \*) \&tmp_zval)) == FAILURE/zend_hash_str_update(HASH_OF(arg), key, strlen(key), \&tmp_zval) == NULL/' \
cubrid_driver7.c
fi
}
+1 -1
View File
@@ -36,7 +36,7 @@ add_phalcon_helper() {
add_brew_extension "$extension" extension add_brew_extension "$extension" extension
else else
package="php${version:?}-$extension" package="php${version:?}-$extension"
add_ppa >/dev/null 2>&1 add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
[[ "$extension" =~ phalcon[4|5] ]] && (install_packages "php${version:?}-psr" || pecl_install psr || pecl_install psr-1.1.0) [[ "$extension" =~ phalcon[4|5] ]] && (install_packages "php${version:?}-psr" || pecl_install psr || pecl_install psr-1.1.0)
(check_package "$package" && install_packages "$package") || pecl_install phalcon-"$(get_phalcon_version)" || add_phalcon_from_repo (check_package "$package" && install_packages "$package") || pecl_install phalcon-"$(get_phalcon_version)" || add_phalcon_from_repo
fi fi
+2 -8
View File
@@ -35,16 +35,12 @@ get_openssl_suffix() {
# Change library paths in relay binary. # Change library paths in relay binary.
change_library_paths() { change_library_paths() {
if [ "$os" = "Darwin" ]; then if [ "$os" = "Darwin" ]; then
dylibs="$(otool -L "${ext_dir:?}"/relay.so | grep -Eo '.*\.dylib' | cut -f1 -d ' ')" otool -L "${ext_dir:?}"/relay.so | grep -q 'ssl.3.' && openssl_version='3' || openssl_version='1.1'
openssl_version="$(echo "$dylibs" | sed -nE 's|.*libssl\.([0-9.]+)\.dylib$|\1|p' | head -n 1)"
if [ -z "$openssl_version" ]; then
openssl_version="$(echo "$dylibs" | sed -nE 's|.*/openssl@([0-9.]+)/lib/libssl\.dylib$|\1|p' | head -n 1)"
fi
openssl_version="${openssl_version:-1.1}"
[ -e "${brew_prefix:?}"/opt/openssl@"$openssl_version" ] || { [ -e "${brew_prefix:?}"/opt/openssl@"$openssl_version" ] || {
safe_brew install --skip-link openssl@"$openssl_version" && safe_brew install --skip-link openssl@"$openssl_version" &&
brew link --overwrite --force openssl@"$openssl_version" brew link --overwrite --force openssl@"$openssl_version"
} }
dylibs="$(otool -L "${ext_dir:?}"/relay.so | grep -Eo '.*\.dylib' | cut -f1 -d ' ')"
install_name_tool -change "$(echo "${dylibs}" | grep -E "libzstd.*dylib" | xargs)" "$brew_prefix"/opt/zstd/lib/libzstd.dylib "$ext_dir"/relay.so install_name_tool -change "$(echo "${dylibs}" | grep -E "libzstd.*dylib" | xargs)" "$brew_prefix"/opt/zstd/lib/libzstd.dylib "$ext_dir"/relay.so
install_name_tool -change "$(echo "${dylibs}" | grep -E "liblz4.*dylib" | xargs)" "$brew_prefix"/opt/lz4/lib/liblz4.dylib "$ext_dir"/relay.so install_name_tool -change "$(echo "${dylibs}" | grep -E "liblz4.*dylib" | xargs)" "$brew_prefix"/opt/lz4/lib/liblz4.dylib "$ext_dir"/relay.so
install_name_tool -change "$(echo "${dylibs}" | grep -E "libssl.*dylib" | xargs)" "$brew_prefix"/opt/openssl@"$openssl_version"/lib/libssl.dylib "$ext_dir"/relay.so install_name_tool -change "$(echo "${dylibs}" | grep -E "libssl.*dylib" | xargs)" "$brew_prefix"/opt/openssl@"$openssl_version"/lib/libssl.dylib "$ext_dir"/relay.so
@@ -134,10 +130,8 @@ add_relay_helper() {
fi fi
if [ -e /tmp/relay.tar.gz ] && file /tmp/relay.tar.gz | grep -q 'gzip'; then if [ -e /tmp/relay.tar.gz ] && file /tmp/relay.tar.gz | grep -q 'gzip'; then
sudo tar --strip-components=1 -xzf /tmp/relay.tar.gz -C "${ext_dir:?}" sudo tar --strip-components=1 -xzf /tmp/relay.tar.gz -C "${ext_dir:?}"
if [ -e "${ext_dir:?}"/relay-pkg.so ]; then
sudo mv "${ext_dir:?}"/relay-pkg.so "${ext_dir:?}"/relay.so sudo mv "${ext_dir:?}"/relay-pkg.so "${ext_dir:?}"/relay.so
fi fi
fi
} }
# Add relay extension # Add relay extension
+5 -11
View File
@@ -122,10 +122,6 @@ patch_extension() {
fetch_extension() { fetch_extension() {
local extension=$1 local extension=$1
local fetch=$2 local fetch=$2
local curl_opts=("${curl_opts[@]}" --retry 2)
if curl --help all 2>/dev/null | grep -- '--retry-all-errors' >/dev/null; then
curl_opts+=(--retry-all-errors)
fi
if [ "$fetch" = "clone" ]; then if [ "$fetch" = "clone" ]; then
run_group "git clone -nv $url/$org/$repo /tmp/$repo-$release" "git clone" run_group "git clone -nv $url/$org/$repo /tmp/$repo-$release" "git clone"
cd /tmp/"$repo-$release" || exit 1 cd /tmp/"$repo-$release" || exit 1
@@ -136,17 +132,15 @@ fetch_extension() {
run_group "git submodule update --jobs $jobs --init --recursive" "git submodule" run_group "git submodule update --jobs $jobs --init --recursive" "git submodule"
fi fi
elif [ "$fetch" = "get" ]; then elif [ "$fetch" = "get" ]; then
get -q -n /tmp/"$extension".tar.gz "$url/$org/$repo/archive/$release.tar.gz" || return 1 get -q -n /tmp/"$extension".tar.gz "$url/$org/$repo/archive/$release.tar.gz"
tar -tzf /tmp/"$extension".tar.gz >/dev/null 2>&1 || return 1 tar -xzf /tmp/"$extension".tar.gz -C /tmp
tar -xzf /tmp/"$extension".tar.gz -C /tmp || return 1
cd /tmp/"$repo"-"$release"/"$sub_dir" || exit cd /tmp/"$repo"-"$release"/"$sub_dir" || exit
elif [ "$fetch" = "pecl" ]; then elif [ "$fetch" = "pecl" ]; then
source="pecl" source="pecl"
pecl_name=${extension/http/pecl_http} pecl_name=${extension/http/pecl_http}
capital_pecl_name=$(echo "$pecl_name" | tr '[:lower:]' '[:upper:]') capital_pecl_name=$(echo "$pecl_name" | tr '[:lower:]' '[:upper:]')
get -q -n /tmp/"$pecl_name".tgz https://pecl.php.net/get/"$pecl_name"-"$release".tgz https://pecl.php.net/get/"$capital_pecl_name"-"$release".tgz || return 1 get -q -n /tmp/"$pecl_name".tgz https://pecl.php.net/get/"$pecl_name"-"$release".tgz https://pecl.php.net/get/"$capital_pecl_name"-"$release".tgz
tar -tzf /tmp/"$pecl_name".tgz >/dev/null 2>&1 || return 1 tar -xzf /tmp/"$pecl_name".tgz -C /tmp
tar -xzf /tmp/"$pecl_name".tgz -C /tmp || return 1
cd /tmp/"$pecl_name"-"$release" 2>/dev/null || cd /tmp/"$capital_pecl_name"-"$release" 2>/dev/null || exit cd /tmp/"$pecl_name"-"$release" 2>/dev/null || cd /tmp/"$capital_pecl_name"-"$release" 2>/dev/null || exit
fi fi
} }
@@ -171,7 +165,7 @@ add_extension_from_source() {
( (
add_devtools phpize >/dev/null 2>&1 add_devtools phpize >/dev/null 2>&1
disable_extension_helper "$extension" disable_extension_helper "$extension"
fetch_extension "$extension" "$fetch" || exit 1 fetch_extension "$extension" "$fetch"
if ! [ "$(find . -maxdepth 1 -name '*.m4' -exec grep -H 'PHP_NEW_EXTENSION' {} \; | wc -l)" != "0" ]; then if ! [ "$(find . -maxdepth 1 -name '*.m4' -exec grep -H 'PHP_NEW_EXTENSION' {} \; | wc -l)" != "0" ]; then
add_log "${cross:?}" "$source" "$source does not have a PHP extension" add_log "${cross:?}" "$source" "$source does not have a PHP extension"
else else
+22 -18
View File
@@ -6,15 +6,20 @@ add_sudo() {
fi fi
} }
# Function to select the package installer. # Function to link apt-fast to apt-get
set_apt_install() { link_apt_fast() {
local apt=apt-get if ! command -v apt-fast >/dev/null; then
command -v apt-fast >/dev/null && apt=apt-fast sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast
apt_install="sudo $debconf_fix $apt install -y --no-install-recommends -o Dpkg::Options::=--force-confnew" trap "sudo rm -f /usr/bin/apt-fast 2>/dev/null" exit
fi
} }
# Function to setup environment for self-hosted runners. # Function to setup environment for self-hosted runners.
self_hosted_helper() { self_hosted_helper() {
if ! command -v apt-fast >/dev/null; then
sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast
trap "sudo rm -f /usr/bin/apt-fast 2>/dev/null" exit
fi
sudo mkdir -p /opt/hostedtoolcache >/dev/null 2>&1 || true sudo mkdir -p /opt/hostedtoolcache >/dev/null 2>&1 || true
local packages=() local packages=()
mapfile -t packages < <(filter_packages apt-transport-https ca-certificates curl file make jq unzip autoconf automake gcc g++ gnupg) mapfile -t packages < <(filter_packages apt-transport-https ca-certificates curl file make jq unzip autoconf automake gcc g++ gnupg)
@@ -25,12 +30,16 @@ self_hosted_helper() {
# Function to fix broken packages. # Function to fix broken packages.
fix_broken_packages() { fix_broken_packages() {
sudo apt --fix-broken install -o Dpkg::Options::=--force-confnew >/dev/null 2>&1 sudo apt --fix-broken install >/dev/null 2>&1
} }
# Function to install a package # Function to install a package
install_packages() { install_packages() {
packages=("$@") packages=("$@")
if ! [ -e /etc/dpkg/dpkg.cfg.d/force-confnew ]; then
echo "force-confnew" | sudo tee /etc/dpkg/dpkg.cfg.d/force-confnew >/dev/null 2>&1
trap "sudo rm -f /etc/dpkg/dpkg.cfg.d/force-confnew 2>/dev/null" exit
fi
$apt_install "${packages[@]}" >/dev/null 2>&1 || (update_lists && fix_broken_packages && $apt_install "${packages[@]}" >/dev/null 2>&1) $apt_install "${packages[@]}" >/dev/null 2>&1 || (update_lists && fix_broken_packages && $apt_install "${packages[@]}" >/dev/null 2>&1)
} }
@@ -104,7 +113,7 @@ filter_packages() {
add_extension_helper() { add_extension_helper() {
local extension=$1 local extension=$1
packages=(php"$version"-"$extension") packages=(php"$version"-"$extension")
add_ppa >/dev/null 2>&1 add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
[ "${debug:?}" = "debug" ] && check_package php"$version"-"$extension"-dbgsym && packages+=(php"$version"-"$extension"-dbgsym) [ "${debug:?}" = "debug" ] && check_package php"$version"-"$extension"-dbgsym && packages+=(php"$version"-"$extension"-dbgsym)
(check_package "${packages[0]}" && install_packages "${packages[@]}") || pecl_install "$extension" (check_package "${packages[0]}" && install_packages "${packages[@]}") || pecl_install "$extension"
add_extension_log "$extension" "Installed and enabled" add_extension_log "$extension" "Installed and enabled"
@@ -124,11 +133,7 @@ add_devtools() {
# Function to setup PHP from the shivammathur/php-builder builds. # Function to setup PHP from the shivammathur/php-builder builds.
setup_php_builder() { setup_php_builder() {
if [[ -n "${asan:-}" && "$version" =~ ${no_asan_builds:?} ]]; then run_script "php-builder" "${runner:?}" "$version" "${debug:?}" "${ts:?}"
add_log "${cross:?}" "PHP" "ASAN is only supported for PHP 8.0+"
exit 1
fi
run_script "php-builder" "${runner:?}" "$version" "${debug:?}" "${ts:?}" "${asan:-}"
} }
# Function to setup PHP 5.3, PHP 5.4 and PHP 5.5. # Function to setup PHP 5.3, PHP 5.4 and PHP 5.5.
@@ -221,7 +226,7 @@ get_php_packages() {
# Function to install packaged PHP # Function to install packaged PHP
add_packaged_php() { add_packaged_php() {
add_ppa >/dev/null 2>&1 add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
IFS=' ' read -r -a packages <<<"$(get_php_packages)" IFS=' ' read -r -a packages <<<"$(get_php_packages)"
install_packages "${packages[@]}" install_packages "${packages[@]}"
} }
@@ -241,9 +246,7 @@ update_php() {
# Function to install PHP. # Function to install PHP.
add_php() { add_php() {
if [ "${runner:?}" = "self-hosted" ] || [ "${use_builds_cache:-true}" = "false" ]; then if [ "${runner:?}" = "self-hosted" ] || [ "${use_builds_cache:-true}" = "false" ]; then
# Sury's Ubuntu archive does not publish the PHP CLI debug symbols. if [[ "$version" =~ ${php_builder_versions:?} || "$ts" = "zts" ]]; then
if [[ "$version" =~ ${php_builder_versions:?} || "$ts" = "zts" || -n "${asan:-}" ||
( "$debug" = "debug" && "$ID $ID_LIKE" == *ubuntu* ) ]]; then
setup_php_builder setup_php_builder
else else
add_packaged_php add_packaged_php
@@ -350,14 +353,15 @@ setup_php() {
} }
# Variables # Variables
version=${1:-'8.6'} version=${1:-'8.5'}
ini=${2:-'production'} ini=${2:-'production'}
src=${0%/*}/.. src=${0%/*}/..
debconf_fix="DEBIAN_FRONTEND=noninteractive" debconf_fix="DEBIAN_FRONTEND=noninteractive"
apt_install="sudo $debconf_fix apt-fast install -y --no-install-recommends"
scripts="$src"/scripts scripts="$src"/scripts
add_sudo >/dev/null 2>&1 add_sudo >/dev/null 2>&1
set_apt_install >/dev/null 2>&1 link_apt_fast >/dev/null 2>&1
. /etc/os-release . /etc/os-release
# shellcheck source=. # shellcheck source=.
+2 -3
View File
@@ -304,10 +304,9 @@ Function Add-Tool() {
} else { } else {
$backup_path = "$tool_path.bak" $backup_path = "$tool_path.bak"
if (Test-Path $tool_path) { Copy-Item $tool_path -Destination $backup_path -Force } if (Test-Path $tool_path) { Copy-Item $tool_path -Destination $backup_path -Force }
$user_agent = "setup-php ($env:RUNNER_OS; $env:RUNNER_ARCH; +https://setup-php.com)"
foreach ($url in $urls){ foreach ($url in $urls){
try { try {
$status_code = (Invoke-WebRequest -Passthru -Uri $url -UserAgent $user_agent -OutFile $tool_path).StatusCode $status_code = (Invoke-WebRequest -Passthru -Uri $url -OutFile $tool_path).StatusCode
} catch { } catch {
$status_code = 0 $status_code = 0
if($url -match '^https://github\.com/[^/]+/[^/]+/releases/latest/download/[^/?#]+$') { if($url -match '^https://github\.com/[^/]+/[^/]+/releases/latest/download/[^/?#]+$') {
@@ -315,7 +314,7 @@ Function Add-Tool() {
$release_url = Get-LastRelease $url $release_url = Get-LastRelease $url
if ($release_url) { if ($release_url) {
$url = $release_url $url = $release_url
$status_code = (Invoke-WebRequest -Passthru -Uri $url -UserAgent $user_agent -OutFile $tool_path).StatusCode $status_code = (Invoke-WebRequest -Passthru -Uri $url -OutFile $tool_path).StatusCode
} }
} catch { } catch {
$status_code = 0 $status_code = 0
+3 -16
View File
@@ -224,12 +224,6 @@ get_last_release() {
done done
} }
# Download a tool with the setup-php user agent.
download_tool() {
local curl_opts=("${curl_opts[@]}" -A "setup-php ($RUNNER_OS; $RUNNER_ARCH; +https://setup-php.com)")
get -v -e "$@"
}
# Function to setup a remote tool. # Function to setup a remote tool.
add_tool() { add_tool() {
url=$1 url=$1
@@ -269,15 +263,12 @@ add_tool() {
fi fi
else else
[ -f "$tool_path" ] && sudo cp -a "$tool_path" "$tool_path.bak" [ -f "$tool_path" ] && sudo cp -a "$tool_path" "$tool_path.bak"
# Tools are single files, so let servers gzip them in transit when curl can decode it. status_code=$(get -v -e "$tool_path" "${url[@]}")
local curl_opts=("${curl_opts[@]}")
curl -V | grep -qw libz && curl_opts+=(--compressed)
status_code=$(download_tool "$tool_path" "${url[@]}")
if [ "$status_code" != "200" ] && [[ "${url[0]}" =~ ^https://github\.com/[^/]+/[^/]+/releases/latest/download/[^/?#]+$ ]]; then if [ "$status_code" != "200" ] && [[ "${url[0]}" =~ ^https://github\.com/[^/]+/[^/]+/releases/latest/download/[^/?#]+$ ]]; then
local release_url local release_url
if release_url=$(get_last_release "${url[0]}"); then if release_url=$(get_last_release "${url[0]}"); then
url[0]="$release_url" url[0]="$release_url"
status_code=$(download_tool "$tool_path" "${url[0]}") status_code=$(get -v -e "$tool_path" "${url[0]}")
fi fi
fi fi
if [ "$status_code" = "200" ]; then if [ "$status_code" = "200" ]; then
@@ -288,12 +279,8 @@ add_tool() {
sudo cp -a "$tool_path" "$cache_path" sudo cp -a "$tool_path" "$cache_path"
fi fi
fi fi
if [ "$status_code" != "200" ]; then if [ "$status_code" != "200" ] && [ -f "$tool_path.bak" ]; then
if [ -f "$tool_path.bak" ]; then
sudo mv "$tool_path.bak" "$tool_path" sudo mv "$tool_path.bak" "$tool_path"
else
sudo rm -f "$tool_path"
fi
fi fi
sudo rm -f "$tool_path.bak" sudo rm -f "$tool_path.bak"
fi fi
+1 -1
View File
@@ -1,7 +1,7 @@
add_bazel() { add_bazel() {
if ! command -v bazel; then if ! command -v bazel; then
if [ "$(uname -s)" = "Linux" ]; then if [ "$(uname -s)" = "Linux" ]; then
add_list bazel/apt https://storage.googleapis.com/bazel-apt https://releases.bazel.build/bazel-release.pub.gpg stable jdk1.8 add_list bazel/apt https://storage.googleapis.com/bazel-apt https://bazel.build/bazel-release.pub.gpg stable jdk1.8
install_packages bazel install_packages bazel
else else
safe_brew install bazel safe_brew install bazel
+101 -274
View File
@@ -37,10 +37,10 @@ set_base_version() {
# Helper function to update package lists. # Helper function to update package lists.
update_lists_helper() { update_lists_helper() {
local list=$1 list=$1
command -v sudo >/dev/null && SUDO=sudo command -v sudo >/dev/null && SUDO=sudo
if [[ -n "$list" ]]; then if [[ -n "$list" ]]; then
${SUDO} apt-get update -o Dir::Etc::sourcelist="$list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" "${@:2}" ${SUDO} apt-get update -o Dir::Etc::sourcelist="$list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
else else
${SUDO} apt-get update ${SUDO} apt-get update
fi fi
@@ -50,25 +50,22 @@ update_lists_helper() {
update_lists() { update_lists() {
local ppa=${1:-} local ppa=${1:-}
local ppa_search=${2:-} local ppa_search=${2:-}
local status_token=${3:-$ppa_search}
local list= local list=
local status_file=/tmp/os_lists local status_file=/tmp/os_lists
local hash_cmd
if [[ -n "$ppa" && -n "$ppa_search" ]]; then if [[ -n "$ppa" && -n "$ppa_search" ]]; then
if [ -f "$ppa_search" ]; then if [ -f "$ppa_search" ]; then
list="$ppa_search" list="$ppa_search"
else else
list="$(grep -Elr "$ppa_search" "$list_dir" 2>/dev/null | head -n 1)" list="$(grep -Elr "$ppa_search" "$list_dir" 2>/dev/null | head -n 1)"
fi fi
[ -n "$list" ] || return 1 hash_cmd="$(command -v sha256sum || command -v shasum)"
status_file="/tmp/os_lists_refresh_${list##*/}" if [ -n "$status_token" ] && [ -n "$hash_cmd" ]; then
[[ "${runner:-}" != self-hosted ]] && cmp -s "$list" "$status_file" && return 0 status_file=/tmp/os_lists_"$(echo -n "$status_token" | $hash_cmd | awk '{print $1}')"
local output rc elif [ -n "$status_token" ]; then
output=$(LC_ALL=C update_lists_helper "$list" -o APT::Update::Error-Mode=any 2>&1) || { status_file=/tmp/os_lists_$(date +%s)
rc=$? fi
[[ "${3:-}" = --on-missing-key && "$output" =~ $missing_key ]] || return "$rc"
"$4" "$ppa" "$list" "${BASH_REMATCH[2]}" || return 1
}
[[ "${runner:-}" = self-hosted ]] || cp "$list" "$status_file"
return
elif [ -e "$list_file" ] && grep -Eq '^deb |^Types: *deb' "$list_file"; then elif [ -e "$list_file" ] && grep -Eq '^deb |^Types: *deb' "$list_file"; then
list="$list_file" list="$list_file"
fi fi
@@ -159,7 +156,7 @@ ubuntu_fingerprint() {
ppa_uri="~${ppa%/*}/+archive/ubuntu/${ppa##*/}" ppa_uri="~${ppa%/*}/+archive/ubuntu/${ppa##*/}"
get -s -n "" "${lp_api[0]}/$ppa_uri" | jq -er '.signing_key_fingerprint' 2>/dev/null \ get -s -n "" "${lp_api[0]}/$ppa_uri" | jq -er '.signing_key_fingerprint' 2>/dev/null \
|| get -s -n "" "${lp_api[1]}/$ppa_uri" | jq -er '.signing_key_fingerprint' 2>/dev/null \ || get -s -n "" "${lp_api[1]}/$ppa_uri" | jq -er '.signing_key_fingerprint' 2>/dev/null \
|| { [ -n "${4:-}" ] && get -s -n "" "${4%.gpg}.fingerprint"; } || get -s -n "" "$ppa_sp/keys/$ppa.fingerprint"
} }
@@ -173,48 +170,25 @@ debian_fingerprint() {
gpg --list-packets "$release_pub" | grep -Eo 'fpr\sv4\s.*[a-zA-Z0-9]+' | head -n 1 | cut -d ' ' -f 3 gpg --list-packets "$release_pub" | grep -Eo 'fpr\sv4\s.*[a-zA-Z0-9]+' | head -n 1 | cut -d ' ' -f 3
} }
# Check for a binary OpenPGP public keyring readable by APT.
is_gpg_keyring() {
local keys
[ -s "$1" ] && LC_ALL=C file -Lb -- "$1" | grep -Eiq '^(OpenPGP public key|PGP(/GPG)? (public key|key public ring))' || return 1
keys=$(gpg --batch --with-colons --show-keys "$1" 2>/dev/null) || return 1
[[ -z "${2:-}" ]] || awk -F: -v signer="$2" '$1 == "fpr" && $10 ~ (signer "$") {found=1} END {exit !found}' <<< "$keys"
}
# Function to add a GPG key. # Function to add a GPG key.
add_key() ( add_key() {
local ppa=$1 ppa_url=$2 package_dist=$3 key_source=$4 key_file=$5 ppa=${1:-ondrej/php}
local mirror=${6:-} signer=${7:-} fingerprint sks_params ppa_url=$2
local key_urls=("$key_source") package_dist=$3
if [[ -z "$key_source" || "$key_source" = "$ppa_url" ]]; then key_source=$4
key_urls=() key_file=$5
if fingerprint="$("${ID}"_fingerprint "$ppa" "$ppa_url" "$package_dist" "$mirror")" && [[ "$fingerprint" =~ ^[[:xdigit:]]+$ ]]; then key_urls=("$key_source")
if [[ "$key_source" =~ launchpadcontent.net|debian.org ]]; then
fingerprint="$("${ID}"_fingerprint "$ppa" "$ppa_url" "$package_dist")"
sks_params="op=get&options=mr&exact=on&search=0x$fingerprint" sks_params="op=get&options=mr&exact=on&search=0x$fingerprint"
key_urls=("${sks[@]/%/\/pks\/lookup\?"$sks_params"}") key_urls=("${sks[@]/%/\/pks\/lookup\?"$sks_params"}")
fi fi
key_urls+=("$ppa_sp/keys/$ppa.gpg")
[ ! -e "$key_source" ] && get -q -n "$key_file" "${key_urls[@]}"
if [[ "$(file "$key_file")" =~ .*('Public-Key (old)'|'Secret-Key') ]]; then
sudo gpg --batch --yes --dearmor "$key_file" >/dev/null 2>&1 && sudo mv "$key_file".gpg "$key_file"
fi fi
[ -z "$mirror" ] || key_urls+=("$mirror") }
local stage url input pending=
stage="$(mktemp -d)" || return 1
trap 'rm -rf "$stage"; if [ -n "$pending" ]; then sudo rm -f -- "$pending"; fi' EXIT
for url in "${key_urls[@]}"; do
input=$url
if [ ! -f "$input" ]; then
input="$stage/download"
: > "$input"
(get -q -n "$input" "$url") || continue
fi
gpg --batch --yes --dearmor --output "$stage/key.gpg" "$input" >/dev/null 2>&1 || continue
is_gpg_keyring "$stage/key.gpg" "$signer" || continue
if [[ "$input" -ef "$key_file" ]] && { [[ "$key_file" = *.asc ]] || cmp -s "$input" "$stage/key.gpg"; }; then
return 0
fi
pending="$(sudo mktemp "$key_file.XXXXXXXX")" || return 1
sudo install -m 644 "$stage/key.gpg" "$pending" && sudo mv -f -- "$pending" "$key_file"
return
done
return 1
)
# Function to handle existing list files. # Function to handle existing list files.
handle_existing_list() { handle_existing_list() {
@@ -243,39 +217,48 @@ write_list() {
local components=$5 local components=$5
local key_file=$6 local key_file=$6
local list_basename="${ppa%%/*}"-"$ID"-"${ppa#*/}"-"$suite" local list_basename="${ppa%%/*}"-"$ID"-"${ppa#*/}"-"$suite"
local arch by_hash= local arch
arch="$(dpkg --print-architecture)" arch="$(dpkg --print-architecture)"
case "${url%/}" in
"$ppa_sp/sury"|"$ppa_sp/apache2") by_hash=' by-hash=force' ;;
esac
sudo rm -f "$list_dir"/"${ppa/\//-}".list "$list_dir"/"${ppa/\//-}".sources "$list_dir"/"$list_basename".list "$list_dir"/"$list_basename".sources || true sudo rm -f "$list_dir"/"${ppa/\//-}".list "$list_dir"/"${ppa/\//-}".sources "$list_dir"/"$list_basename".list "$list_dir"/"$list_basename".sources || true
if [ "$type" = "deb822" ]; then if [ "$type" = "deb822" ]; then
{ cat <<EOF | sudo tee "$list_dir"/"$list_basename".sources >/dev/null
printf '%s\n' "Types: deb" "URIs: $url" "Suites: $suite" "Components: $components" "Architectures: $arch" "Signed-By: $key_file" Types: deb
if [ -n "$by_hash" ]; then printf '%s\n' 'By-Hash: force'; fi URIs: $url
} | sudo tee "$list_dir"/"$list_basename".sources >/dev/null Suites: $suite
Components: $components
Architectures: $arch
Signed-By: $key_file
EOF
else else
echo "deb [arch=$arch signed-by=$key_file$by_hash] $url $suite $components" | sudo tee "$list_dir"/"$list_basename".list >/dev/null 2>&1 echo "deb [arch=$arch signed-by=$key_file] $url $suite $components" | sudo tee "$list_dir"/"$list_basename".list >/dev/null 2>&1
fi fi
} }
# Function to check if a PPA and its lists exist # Function to check if a PPA and its lists exist
check_lists() { check_lists() {
local ppa=$1 local ppa=$1
local pattern=${2:-${3:-}} local primary=${2:-}
local secondary=${3:-}
local status_token=${4:-$primary}
local match_file= local match_file=
check_lists_file= check_lists_file=
if [ -n "$pattern" ]; then if [ -n "$primary" ]; then
match_file=$(grep -Elr "$pattern" "$list_dir" 2>/dev/null | head -n 1) match_file=$(grep -Elr "$primary" "$list_dir" 2>/dev/null | head -n 1)
fi
if [ -z "$match_file" ] && [ -n "$secondary" ]; then
local candidate
candidate=$(grep -Elr "$secondary" "$list_dir" 2>/dev/null | head -n 1)
if [ -n "$candidate" ] && { [ -z "$primary" ] || grep -Eq "$primary" "$candidate"; }; then
match_file="$candidate"
fi
fi fi
if [ -n "$match_file" ]; then if [ -n "$match_file" ]; then
check_lists_file="$match_file"
[[ "${4:-}" != --lookup-only ]] || return 0
local list_count local list_count
list_count="$(sudo find /var/lib/apt/lists -type f -name "*${ppa/\//_}*" | wc -l)" list_count="$(sudo find /var/lib/apt/lists -type f -name "*${ppa/\//_}*" | wc -l)"
if [ "$list_count" = "0" ]; then if [ "$list_count" = "0" ]; then
update_lists "$ppa" "$match_file" update_lists "$ppa" "$match_file" "$status_token"
fi fi
check_lists_file="$match_file"
return 0 return 0
fi fi
return 1 return 1
@@ -283,19 +266,21 @@ check_lists() {
# Function to add a sources list. # Function to add a sources list.
add_list() { add_list() {
local ppa=${1-$default_ppa} ppa=${1-ondrej/php}
ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"} ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
key_source=${3:-} key_source=${3:-"$ppa_url"}
package_dist=${4:-"$VERSION_CODENAME"} package_dist=${4:-"$VERSION_CODENAME"}
branches=${5:-main} branches=${5:-main}
local list_format local list_format
local list_extension local list_extension
local status_token
local resolved_branches local resolved_branches
local list_path= local list_path=
list_format="$(get_sources_format)" list_format="$(get_sources_format)"
list_extension="$(get_sources_extension "$list_format")" list_extension="$(get_sources_extension "$list_format")"
status_token="${ppa_url}|${package_dist}|${branches}"
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")" IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
if check_lists "$ppa" "$primary_pattern" "$secondary_pattern" "${8:-}"; then if check_lists "$ppa" "$primary_pattern" "$secondary_pattern" "$status_token"; then
list_path="$check_lists_file" list_path="$check_lists_file"
if resolved_branches="$(handle_existing_list "$ppa" "$list_format" "$branches")"; then if resolved_branches="$(handle_existing_list "$ppa" "$list_format" "$branches")"; then
branches="$resolved_branches" branches="$resolved_branches"
@@ -303,24 +288,14 @@ add_list() {
[ -n "$resolved_branches" ] && echo "$resolved_branches" && return 1 [ -n "$resolved_branches" ] && echo "$resolved_branches" && return 1
fi fi
check_lists_file= check_lists_file=
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
status_token="${ppa_url}|${package_dist}|${branches}"
fi fi
[ -e "$key_source" ] && key_file=$key_source || key_file="$key_dir"/"${ppa/\//-}"-keyring.gpg [ -e "$key_source" ] && key_file=$key_source || key_file="$key_dir"/"${ppa/\//-}"-keyring.gpg
add_key "$ppa" "$ppa_url" "$package_dist" "$key_source" "$key_file" "${6:-}" || return 1 add_key "$ppa" "$ppa_url" "$package_dist" "$key_source" "$key_file"
write_list "$list_format" "$ppa" "$ppa_url" "$package_dist" "$branches" "$key_file" || return 1 write_list "$list_format" "$ppa" "$ppa_url" "$package_dist" "$branches" "$key_file"
list_path="$list_dir"/"${ppa%%/*}"-"$ID"-"${ppa#*/}"-"$package_dist"."$list_extension" list_path="$list_dir"/"${ppa%%/*}"-"$ID"-"${ppa#*/}"-"$package_dist"."$list_extension"
# A caller requesting an index needs a successful refresh, even if APT has cached lists. update_lists "$ppa" "$list_path" "$status_token"
if [ -n "${7:-}" ]; then
update_lists_helper "$list_path" -o APT::Update::Error-Mode=any || return 1
local index indexes
indexes=$(apt-get -o Dir::Etc::sourcelist="$list_path" -o Dir::Etc::sourceparts=- indextargets --format '$(FILENAME)' 'Identifier: Packages') || return 1
while IFS= read -r index; do
[ -s "$index" ] || continue
printf '%s\n' "$index" > "$7"
return
done <<< "$indexes"
return 1
fi
update_lists "$ppa" "$list_path"
. /etc/os-release . /etc/os-release
return 0; return 0;
} }
@@ -334,165 +309,66 @@ check_ppa() {
local list_format local list_format
list_format="$(get_sources_format)" list_format="$(get_sources_format)"
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")" IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
check_lists "$ppa" "$primary_pattern" "$secondary_pattern" || return 1 local status_token
status_token="${ppa_url}|${package_dist}|${branches}"
if check_lists "$ppa" "$primary_pattern" "$secondary_pattern" "$status_token"; then
return 0;
else
return 1;
fi
} }
# Function to remove a PPA. # Function to remove a PPA.
remove_list() { remove_list() {
local ppa=${1-$default_ppa} list ppa_url uri filter ppa=${1-ondrej/php}
local -a ppa_urls
[ -n "$2" ] && ppa_urls=("$2") || ppa_urls=("$lp_ppa/$ppa/ubuntu" "$lpc_ppa/$ppa/ubuntu") [ -n "$2" ] && ppa_urls=("$2") || ppa_urls=("$lp_ppa/$ppa/ubuntu" "$lpc_ppa/$ppa/ubuntu")
for ppa_url in "${ppa_urls[@]}"; do for ppa_url in "${ppa_urls[@]}"; do
uri=$(escape_regex "${ppa_url%/}") grep -lr "$ppa_url" "$list_dir" | xargs -n1 sudo rm -f
[[ "$ppa_url" != //* ]] || uri="https?:$uri"
while IFS= read -r -d '' list; do
if [[ "$list" = *.sources ]]; then
# Match URIs within one deb822 paragraph, including folded fields.
local gap='([[:blank:]]|\r?\n(#[^\n]*\n)*[[:blank:]])'
filter='/^[[:space:]]*$/b
:stanza
$!{N; /\n[[:blank:]]*\r?$/!b stanza;}
/(^|\n)[Uu][Rr][Ii][Ss]:'"$gap*([^[:space:]]+$gap+)*$uri"'\/*([[:space:]]|$)/d'
else
filter="/^[[:blank:]]*deb(-src)?[[:blank:]]+(\\[[^]]*\\][[:blank:]]+)?$uri\\/*([[:space:]]|$)/d"
fi
sudo sed -Ei "$filter" "$list" || return 1
grep -q '[^[:space:]]' "$list" || sudo rm -f -- "$list" || return 1
sudo rm -f -- "/tmp/os_lists_refresh_${list##*/}" "${RUNNER_TEMP:-/tmp}/os_lists_${list##*/}" || return 1
done < <(grep -FlrZ --include='*.list' --include='*.sources' --exclude="${3:-}" -- "${ppa_url%/}" "$list_dir")
done done
[[ ! -e "$key_dir/${ppa/\//-}-keyring" ]] || sudo rm -f "$key_dir/${ppa/\//-}-keyring" sudo rm -f "$key_dir"/"${ppa/\//-}"-keyring /tmp/os_lists* || true
} }
# Function to check if ubuntu ppa is up # Function to check if ubuntu ppa is up
is_ubuntu_ppa_up() { is_ubuntu_ppa_up() {
ppa=${1:-$default_ppa} ppa=${1:-ondrej/php}
curl -s --connect-timeout 10 --max-time 10 --head --fail "$lpc_ppa/$ppa/ubuntu/dists/$VERSION_CODENAME/Release" > /dev/null curl -s --connect-timeout 10 --max-time 10 --head --fail "$lpc_ppa/$ppa/ubuntu/dists/$VERSION_CODENAME/Release" > /dev/null
} }
# Remove sources from caches that still have the old Launchpad mirrors. # Function to add the PPA mirror.
remove_legacy_mirrors() {
local ppa old_ppa old_sp
for ppa in ondrej/php ondrej/apache2; do
old_ppa="//${ppa_sp#*://}/$ppa/ubuntu"
old_sp="//${sp#*://}/$ppa/ubuntu"
if grep -Fqr -e "$old_ppa" -e "$old_sp" "$list_dir"; then
remove_list "$ppa" "$old_ppa" && remove_list "$ppa" "$old_sp" || return 1
fi
done
}
# Function to add the Sury mirror.
add_ppa_sp_mirror() { add_ppa_sp_mirror() {
local ppa=$1 name=${1##*/} url="$ppa_sp/sury" ppa=$1
[[ "$ppa" =~ $mirrored_ppas ]] || return 1 ppa_name="$(basename "$ppa")"
[ "$name" != apache2 ] || url="$ppa_sp/apache2"
local key_mirror="$ppa_sp/keys/sury/$name.gpg"
remove_list "$ppa" || true remove_list "$ppa" || true
remove_legacy_mirrors || return 1 [ "${debug:?}" = "debug" ] && add_list sp/"$ppa_name" "$ppa_sp/$ppa/ubuntu" "$ppa_sp/$ppa/ubuntu/key.gpg" "$VERSION_CODENAME" "main/debug"
[ "${debug:?}" = "debug" ] && add_list "sp/$name" "$url" "$url/apt.gpg" "$VERSION_CODENAME" "main/debug" "$key_mirror" add_list sp/"$ppa_name" "$ppa_sp/$ppa/ubuntu" "$ppa_sp/$ppa/ubuntu/key.gpg"
add_list "sp/$name" "$url" "$url/apt.gpg" "$VERSION_CODENAME" main "$key_mirror"
} }
# Add a signed archive, using the mirror if APT cannot load a Packages index. add_sury_list() {
# Arguments: [--keyring path primary-key-url mirror-key-url] list ID, primary URL, mirror URL, keyring, suite, components, optional source URLs to replace. ppa=${1:-ondrej/php}
add_list_with_fallback() ( [ "${debug:?}" = "debug" ] && add_list "$ppa" "$sury"/"${ppa##*/}"/ "$sury"/"${ppa##*/}"/apt.gpg "$VERSION_CODENAME" "main/debug"
local managed_key='' key_url='' key_mirror='' add_list "$ppa" "$sury"/"${ppa##*/}"/ "$sury"/"${ppa##*/}"/apt.gpg
if [[ "$1" = --keyring ]]; then }
managed_key=$2 key_url=$3 key_mirror=$4
shift 4
fi
local ppa=$1 primary=$2 mirror=$3 key=$4 suite=${5:-$VERSION_CODENAME} components=${6:-main}
local repo=${ppa_sources[$ID/$ppa]:-$ppa} source stamp request cached_request cached_key index
local stage='' old_url
[[ -s "$key" || -n "$managed_key" ]] || return 1
sources_format="$(get_sources_format)"
source="${repo%%/*}-$ID-${repo#*/}-$suite.$(get_sources_extension "$sources_format")"
stamp="${RUNNER_TEMP:-/tmp}/os_lists_$source"
printf -v request '%q ' "$primary" "$mirror" "$components" "${@:7}"
if [[ -s "$list_dir/$source" && -s "$stamp" && ! "$key" -nt "$stamp" ]] &&
[[ -n "$(find "$stamp" -mtime -1 -print)" ]] &&
{ IFS= read -r cached_request && IFS= read -r index && IFS= read -r cached_key && cmp -s - "$list_dir/$source"; } < "$stamp" &&
[[ "$cached_request" = "$request" && "$cached_key" = "$key" && -s "$index" ]] &&
{ [[ "${require_mirror_by_hash:-}" != true ]] || ! grep -Fq "${mirror%/}" "$list_dir/$source" ||
grep -Eq '^By-Hash: force$| by-hash=force( |])' "$list_dir/$source"; }; then
# A cache can restore another source file after this archive was selected.
(( $# > 6 )) && grep -qrF --exclude="$source" -f <(printf '%s\n' "${@:7}") "$list_dir" || return 0
else
stage=$(mktemp -d /tmp/setup-php-list.XXXXXXXX) || return 1
trap 'rm -rf "$stage"' EXIT
chmod 755 "$stage" || return 1
if [[ -z "$key" ]]; then
key="$stage/initial.gpg"
add_key "$repo" "$primary" "$suite" "$key_url" "$key" "$key_mirror" || return 1
fi
local url attempt_key output signer='' candidate="$stage/rotated.gpg"
for url in "$primary" "$mirror"; do
for attempt_key in "$key" "$candidate"; do
if [[ "$attempt_key" = "$candidate" ]]; then
[[ -n "$key_url" && "$output" =~ $missing_key ]] || break
if [[ "$signer" != "${BASH_REMATCH[2]}" ]]; then
signer=${BASH_REMATCH[2]}
rm -f "$candidate" || return 1
add_key "$repo" "$primary" "$suite" "$key_url" "$candidate" "$key_mirror" "$signer" || break
fi
[ -s "$candidate" ] || break
rm -f "$stage/$source" || return 1
fi
if output=$(list_dir="$stage" add_list "$repo" "$url" "$attempt_key" "$suite" "$components" '' "$stage/index" 2>&1); then
[[ -z "$output" ]] || printf '%s\n' "$output"
key=$attempt_key
break 2
fi
printf '%s\n' "$output" >&2
done
done
[ -s "$stage/index" ] || return 1
fi
for old_url in "${@:7}"; do
remove_list "$ppa" "$old_url" "$source" || return 1
done
[ -n "$stage" ] || return 0
sudo rm -f "/tmp/os_lists_refresh_$source" || return 1
if [[ "$key" = "$stage/"* ]]; then
list_with_key "$stage/$source" "$managed_key" > "$stage/publish" && mv -f "$stage/publish" "$stage/$source" || return 1
add_key "$repo" "$primary" "$suite" "$key" "$managed_key" || return 1
key=$managed_key
fi
sudo install -m 644 "$stage/$source" "$list_dir/$source" || return 1
{ printf '%s\n' "$request" && cat "$stage/index" && printf '%s\n' "$key" && cat "$stage/$source"; } > "$stage/stamp" && mv -fT "$stage/stamp" "$stamp"
)
# Function to add a PPA. # Function to add a PPA.
add_ppa() { add_ppa() {
set_base_version set_base_version
ppa=${1:-$default_ppa} ppa=${1:-ondrej/php}
if [[ "$ID ${ID_LIKE:-}" =~ ubuntu|debian && "$ppa" =~ $mirrored_ppas ]]; then if [[ "$ID" = "ubuntu" || "$ID_LIKE" =~ ubuntu ]] && [[ "$ppa" =~ "ondrej/" ]]; then
remove_legacy_mirrors || return 1 if [ "$VERSION_ID" = "26.04" ]; then
local components=main name=${ppa##*/} primary="$sury/${ppa##*/}/" key_mirror="$ppa_sp/keys/sury/${ppa##*/}.gpg" add_sury_list
if [[ "$name" = php && "$ID ${ID_LIKE:-}" != *ubuntu* ]]; then
[ "${debug:?}" != debug ] || components="main/debug main"
add_list "$ppa" "$primary" "${primary}apt.gpg" "$VERSION_CODENAME" "$components" "$key_mirror" '' --lookup-only ||
{ [ -n "$check_lists_file" ] && update_lists "$ppa" "$check_lists_file" --on-missing-key retry_sury_update; }
else else
local mirror="$ppa_sp/sury/" managed_key="$key_dir/sury-$name-keyring.gpg" key= if is_ubuntu_ppa_up "$ppa" ; then
local -a curl_opts=("${curl_opts[@]}" --connect-timeout 5 --max-time 15) [ "${runner:?}" = "self-hosted" ] && find "$list_dir" -type f -name 'sp*' -exec grep -qF "${sp/https:\/\/}" {} \; -delete
if [ "$name" = apache2 ]; then [ "${debug:?}" = "debug" ] && add_list "$ppa" "$lpc_ppa/$ppa/ubuntu" "$lpc_ppa/$ppa/ubuntu" "$VERSION_CODENAME" "main/debug"
mirror="$ppa_sp/apache2/" add_list "$ppa"
[ "${debug:-}" != debug ] || components="main/debug main" elif [ "$ppa" = "ondrej/php" ]; then
add_ppa_sp_mirror "$ppa"
else
add_log "${cross:?}" "$ppa" "PPA $ppa is not available"
fi fi
local require_mirror_by_hash=true
local -a options=("$VERSION_CODENAME" "$components" "//${lp_ppa#*://}/$ppa/ubuntu" "//${lpc_ppa#*://}/$ppa/ubuntu"
"${primary%/}" "${mirror%/}")
[ "$name" != php ] || options+=(mirror+file:/etc/apt/setup-php-sury-mirrors.txt)
local packaged_key="$key_dir/debsuryorg-archive-keyring.gpg"
if is_gpg_keyring "$managed_key"; then
key="$managed_key"
elif is_gpg_keyring "$packaged_key"; then
key="$packaged_key"
fi
LC_ALL=C add_list_with_fallback --keyring "$managed_key" "${primary}apt.gpg" "$key_mirror" "$ppa" "$primary" "$mirror" "$key" "${options[@]}"
fi fi
elif [[ "$ID" = "debian" || "$ID_LIKE" =~ debian ]] && [[ "$ppa" =~ "ondrej/" ]]; then
add_sury_list
else else
add_list "$ppa" add_list "$ppa"
fi fi
@@ -501,70 +377,25 @@ add_ppa() {
return $exit_code return $exit_code
} }
# Replace a single Signed-By keyring, preserving the rest of a deb or deb822 source.
list_with_key() {
awk -v key="$2" '
/^Signed-By:[[:blank:]]+\/[^[:space:]]+$/ { $0 = "Signed-By: " key; changed = 1 }
/^deb(-src)?[[:blank:]]/ && match($0, /[[:blank:][]signed-by=\/[^],[:space:]]+[][:blank:]]/) {
$0 = substr($0, 1, RSTART) "signed-by=" key substr($0, RSTART + RLENGTH - 1)
changed = 1
}
{ print }
END { exit !changed }
' "$1"
}
# Retry just the selected Sury source after APT reports a missing signer.
retry_sury_update() (
local ppa=$1 list=$2 signer=$3 name=${1##*/} selected stage
[[ "$ppa" =~ $mirrored_ppas ]] || return 1
local primary="$sury/$name/" mirror="$ppa_sp/sury/" key="$key_dir/sury-$name-keyring.gpg"
[ "$name" != apache2 ] || mirror="$ppa_sp/apache2/"
selected=$(apt-get -o Dir::Etc::sourcelist="$list" -o Dir::Etc::sourceparts=- indextargets \
--no-release-info --format '$(REPO_URI)' | sort -u) || return 1
[[ "${selected%/}" = "${primary%/}" || "${selected%/}" = "${mirror%/}" ]] || return 1
local source=${list##*/} request index old_key
local stamp="${RUNNER_TEMP:-/tmp}/os_lists_$source"
local -a curl_opts=("${curl_opts[@]}" --connect-timeout 5 --max-time 15)
stage=$(mktemp -d /tmp/setup-php-key.XXXXXXXX) || return 1
trap 'if (( $? != 0 )); then rm -f -- "$stamp"; fi; rm -rf "$stage"' EXIT
# APT's signature verifier runs as an unprivileged user.
chmod 755 "$stage" || return 1
list_with_key "$list" "$stage/key.gpg" > "$stage/$source" || return 1
add_key "sury/$name" "$primary" "$VERSION_CODENAME" "${primary}apt.gpg" "$stage/key.gpg" "$ppa_sp/keys/sury/$name.gpg" "$signer" || return 1
update_lists_helper "$stage/$source" -o APT::Update::Error-Mode=any || return 1
list_with_key "$list" "$key" > "$stage/$source" || return 1
add_key "sury/$name" "$primary" "$VERSION_CODENAME" "$stage/key.gpg" "$key" || return 1
if [[ -s "$stamp" ]] && { IFS= read -r request && IFS= read -r index && IFS= read -r old_key && [[ -n "$old_key" ]] && cmp -s - "$list"; } < "$stamp"; then
{ printf '%s\n' "$request" "$index" "$key" && cat "$stage/$source"; } > "$stage/stamp" || return 1
fi
sudo install -m 644 "$stage/$source" "$list" || return 1
[[ ! -f "$stage/stamp" ]] || mv -fT "$stage/stamp" "$stamp"
)
# Function to update a PPA. # Function to update a PPA.
update_ppa() { update_ppa() {
set_base_version set_base_version
ppa=${1:-$default_ppa} ppa=${1:-ondrej/php}
ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"} ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
package_dist=${4:-"$VERSION_CODENAME"} package_dist=${4:-"$VERSION_CODENAME"}
branches=${5:-main} branches=${5:-main}
local list_format local list_format
list_format="$(get_sources_format)" list_format="$(get_sources_format)"
local repo=${ppa_sources[$ID/$ppa]:-$ppa}
local list_path
list_path="$list_dir/${repo%%/*}-$ID-${repo#*/}-$package_dist.$(get_sources_extension "$list_format")"
if [[ -n "${2:-}" || ! -s "$list_path" ]]; then
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")" IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
local list_path
list_path="$(grep -Elr "$primary_pattern" "$list_dir" 2>/dev/null | head -n 1)" list_path="$(grep -Elr "$primary_pattern" "$list_dir" 2>/dev/null | head -n 1)"
[ -n "$list_path" ] || return 1 if [ -z "$list_path" ] && [ -n "$secondary_pattern" ]; then
list_path="$(grep -Elr "$secondary_pattern" "$list_dir" 2>/dev/null | head -n 1)"
fi fi
local rc=0 local status_token
update_lists "$ppa" "$list_path" --on-missing-key retry_sury_update || rc=$? status_token="${ppa_url}|${package_dist}|${branches}"
update_lists "$ppa" "${list_path:-$primary_pattern}" "$status_token"
. /etc/os-release . /etc/os-release
return "$rc"
} }
# Variables # Variables
@@ -585,10 +416,6 @@ dist_info_dir='/usr/share/distro-info'
sury='https://packages.sury.org' sury='https://packages.sury.org'
ppa_sp='https://ppa.setup-php.com' ppa_sp='https://ppa.setup-php.com'
sp='https://setup-php.com' sp='https://setup-php.com'
default_ppa='ondrej/php'
missing_key='(NO_PUBKEY|Missing key) ([[:xdigit:]]{16,64})'
mirrored_ppas='^ondrej/(apache2|php)$'
declare -A ppa_sources=([ubuntu/ondrej/php]=setup-php/sury [ubuntu/ondrej/apache2]=setup-php/sury-apache2 [debian/ondrej/apache2]=setup-php/sury-apache2)
sks=( sks=(
'https://keyserver.ubuntu.com' 'https://keyserver.ubuntu.com'
'https://pgp.mit.edu' 'https://pgp.mit.edu'
-30
View File
@@ -1,30 +0,0 @@
Function Add-Upsun() {
param(
[Parameter(Mandatory = $true, Position = 0, HelpMessage = 'Upsun CLI version to be installed')]
[string] $upsun_tag
)
$upsun_tag = $upsun_tag.replace('v', '')
if($upsun_tag -ne 'latest' -and $upsun_tag -notmatch '^\d+(\.\d+)*$') {
Add-Log $cross "upsun-cli" "Invalid upsun-cli version: $upsun_tag"
} elseif(-not([Environment]::Is64BitOperatingSystem)) {
Add-Log $cross "upsun-cli" "upsun-cli is only available for 64-bit Windows"
} else {
$upsun_releases = "https://github.com/upsun/cli/releases"
if ($upsun_tag -eq 'latest') {
$upsun_tag = (Get-File -Url $upsun_releases/latest).BaseResponse.RequestMessage.RequestUri.Segments[-1].replace('v', '')
}
$url = "$upsun_releases/download/v$upsun_tag/upsun_${upsun_tag}_windows_amd64.zip"
Get-File -Url $url -OutFile $bin_dir\upsun.zip > $null 2>&1
Expand-Archive -Path $bin_dir\upsun.zip -DestinationPath $bin_dir\upsun -Force > $null 2>&1
if (Test-Path $bin_dir\upsun\upsun.exe) {
Move-Item -Path $bin_dir\upsun\upsun.exe -Destination $bin_dir\upsun.exe -Force
Copy-Item -Path $bin_dir\upsun.exe -Destination $bin_dir\upsun-cli.exe > $null 2>&1
Add-ToProfile $current_profile 'upsun' "New-Alias upsun $bin_dir\upsun.exe"
Add-ToProfile $current_profile 'upsun_cli' "New-Alias upsun-cli $bin_dir\upsun-cli.exe"
$tool_version = Get-ToolVersion upsun "--version"
Add-Log $tick "upsun-cli" "Added upsun-cli $tool_version"
} else {
Add-Log $cross "upsun-cli" "Could not setup upsun-cli"
}
}
}
-49
View File
@@ -1,49 +0,0 @@
get_upsun_tag() {
local upsun_tag=$1
if [ "$upsun_tag" = "latest" ]; then
get -s -n "" https://github.com/upsun/cli/releases/latest 2<&1 | grep -m 1 -Eo "tag/v[0-9]+(\.[0-9]+)*" | head -n 1 | cut -d '/' -f 2
else
echo "v$upsun_tag"
fi
}
add_upsun_helper() {
local upsun_tag=$1
local install_dir=/usr/local/bin
local os
local arch
os="$(uname -s | tr '[:upper:]' '[:lower:]')"
arch="$(uname -m)"
case "$arch" in
aarch64*|armv8*|arm64) arch="arm64" ;;
x86_64|amd64) arch="amd64" ;;
esac
if [ "$os" = "darwin" ]; then
arch="all"
install_dir=${brew_prefix:?}/bin
fi
get -q -n /tmp/upsun.tar.gz "https://github.com/upsun/cli/releases/download/$upsun_tag/upsun_${upsun_tag#v}_${os}_${arch}.tar.gz"
mkdir -p /tmp/upsun
tar -xzf /tmp/upsun.tar.gz -C /tmp/upsun
sudo mv /tmp/upsun/upsun "$install_dir"/upsun
sudo chmod a+x "$install_dir"/upsun
rm -rf /tmp/upsun /tmp/upsun.tar.gz
}
add_upsun() {
local upsun_tag="${1/v/}"
if ! [[ "$upsun_tag" =~ ^[0-9]+(\.[0-9]+)*$ || "$upsun_tag" == 'latest' ]]; then
add_log "${cross:?}" "upsun-cli" "Version '$upsun_tag' is not valid for upsun-cli"
else
upsun_tag="$(get_upsun_tag "$upsun_tag")"
add_upsun_helper "$upsun_tag" >/dev/null 2>&1
upsun_path="$(command -v upsun)"
if [[ -n "$upsun_path" ]]; then
sudo ln -s "$upsun_path" "${tool_path_dir:?}"/upsun-cli
tool_version=$(get_tool_version "upsun" "--version")
add_log "${tick:?}" "upsun-cli" "Added upsun-cli $tool_version"
else
add_log "${cross:?}" "upsun-cli" "Could not setup upsun-cli"
fi
fi
}
+8 -31
View File
@@ -5,9 +5,8 @@ export curl_opts=(-sL)
export old_versions="5.[3-5]" export old_versions="5.[3-5]"
export jit_versions="8.[0-9]" export jit_versions="8.[0-9]"
export php_builder_versions="8.[3-9]" export php_builder_versions="8.[3-9]"
export nightly_versions="8.[7-9]" export nightly_versions="8.[6-9]"
export xdebug3_versions="7.[2-4]|8.[0-9]" export xdebug3_versions="7.[2-4]|8.[0-9]"
export no_asan_builds="5.[3-6]|7.[0-4]"
export latest="releases/latest/download" export latest="releases/latest/download"
export github="https://github.com/shivammathur" export github="https://github.com/shivammathur"
export jsdeliver="https://cdn.jsdelivr.net/gh/shivammathur" export jsdeliver="https://cdn.jsdelivr.net/gh/shivammathur"
@@ -66,10 +65,10 @@ check_builds_cache_runner() {
local pid=$PPID executable local pid=$PPID executable
while [[ "$pid" =~ ^[0-9]+$ && "$pid" -gt 1 ]]; do while [[ "$pid" =~ ^[0-9]+$ && "$pid" -gt 1 ]]; do
executable="$(readlink -f "/proc/$pid/exe")" || return 1 executable="$(readlink -f "/proc/$pid/exe")" || return 1
if [[ "$executable" = */bin/Runner.Worker || "$executable" = */bin/Runner.Worker.exe ]]; then if [[ "$executable" = */bin/Runner.Worker ]]; then
jq -e --arg name "${RUNNER_NAME:-}" \ jq -e --arg name "${RUNNER_NAME:-}" \
'(.AgentName // .agentName) | . == $name and test("^(blacksmith|depot|nsc-runner)-")' \ '.AgentName == $name and (.AgentName | test("^(blacksmith|depot)-"))' \
"${executable%/bin/*}/.runner" >/dev/null 2>&1 "${executable%/bin/Runner.Worker}/.runner" >/dev/null 2>&1
return $? return $?
fi fi
pid="$(awk '$1 == "PPid:" {print $2}' "/proc/$pid/status")" || return 1 pid="$(awk '$1 == "PPid:" {print $2}' "/proc/$pid/status")" || return 1
@@ -77,27 +76,16 @@ check_builds_cache_runner() {
return 1 return 1
} }
# Function to configure environment for ASAN builds.
configure_asan() {
use_builds_cache=false
update=true
add_env ASAN_OPTIONS "${ASAN_OPTIONS:-detect_leaks=0}"
add_env UBSAN_OPTIONS "${UBSAN_OPTIONS:-halt_on_error=1}"
add_env ZEND_DONT_UNLOAD_MODULES "${ZEND_DONT_UNLOAD_MODULES:-1}"
add_env USE_ZEND_ALLOC "${USE_ZEND_ALLOC:-0}"
}
# Function to read env inputs. # Function to read env inputs.
read_env() { read_env() {
if [[ "${SETUP_PHP_TRACE:-0}" =~ ^[12]$ ]]; then if [[ "${SETUP_PHP_TRACE:-0}" =~ ^[12]$ ]]; then
set -x set -x
fi fi
update="${update:-${UPDATE:-false}}" update="${update:-${UPDATE:-false}}"
use_builds_cache="${use_builds_cache:-${use_package_cache:-}}"
[ "${debug:-${DEBUG:-false}}" = "true" ] && debug=debug && update=true || debug=release [ "${debug:-${DEBUG:-false}}" = "true" ] && debug=debug && update=true || debug=release
[[ "${phpts:-${PHPTS:-nts}}" = "ts" || "${phpts:-${PHPTS:-nts}}" = "zts" ]] && ts=zts && update=true || ts=nts [[ "${phpts:-${PHPTS:-nts}}" = "ts" || "${phpts:-${PHPTS:-nts}}" = "zts" ]] && ts=zts && update=true || ts=nts
[[ "${asan:-${ASAN:-false}}" = "true" ]] && asan=asan && configure_asan || asan=
fail_fast="${fail_fast:-${FAIL_FAST:-false}}" fail_fast="${fail_fast:-${FAIL_FAST:-false}}"
use_builds_cache="${use_builds_cache:-${use_package_cache:-}}"
[[ ( -z "$ImageOS" && -z "$ImageVersion" ) || [[ ( -z "$ImageOS" && -z "$ImageVersion" ) ||
( -n "$RUNNER_ENVIRONMENT" && "$RUNNER_ENVIRONMENT" = "self-hosted" ) || ( -n "$RUNNER_ENVIRONMENT" && "$RUNNER_ENVIRONMENT" = "self-hosted" ) ||
-n "$ACT" || -n "$CONTAINER" ]] && _runner=self-hosted || _runner=github -n "$ACT" || -n "$CONTAINER" ]] && _runner=self-hosted || _runner=github
@@ -105,9 +93,8 @@ read_env() {
if [[ $_runner = "self-hosted" && "${use_builds_cache:-false}" = "true" ]]; then if [[ $_runner = "self-hosted" && "${use_builds_cache:-false}" = "true" ]]; then
runner=github runner=github
if [[ "${ID:-}" = "ubuntu" && -z "$ACT" && -z "$CONTAINER" && if [[ "${ID:-}" = "ubuntu" && -z "$ACT" && -z "$CONTAINER" &&
( -n "${BLACKSMITH_VM_ID:-}" || "${RUNNER_NAME:-}" =~ ^(blacksmith|depot|nsc-runner)- ) ]] && check_builds_cache_runner; then ( -n "${BLACKSMITH_VM_ID:-}" || "${RUNNER_NAME:-}" =~ ^(blacksmith|depot)- ) ]] && check_builds_cache_runner; then
_runner=github _runner=github
# shellcheck disable=SC2034
builds_cache_warning=true builds_cache_warning=true
fi fi
fi fi
@@ -133,7 +120,6 @@ read_env() {
export runner export runner
export update export update
export ts export ts
export asan
export tool_path_dir export tool_path_dir
export tool_cache_path_dir export tool_cache_path_dir
} }
@@ -199,7 +185,6 @@ verify_checksum() {
# mode: -s pipe to stdout, -v save file and return status code # mode: -s pipe to stdout, -v save file and return status code
# execute: -e save file as executable # execute: -e save file as executable
get() { get() {
local download_status=1 status_code=000
mode=$1 mode=$1
execute=$2 execute=$2
file_path=$3 file_path=$3
@@ -219,20 +204,12 @@ get() {
trap 'release_lock "$lock_path"' EXIT SIGINT SIGTERM trap 'release_lock "$lock_path"' EXIT SIGINT SIGTERM
fi fi
for link in "${links[@]}"; do for link in "${links[@]}"; do
if status_code=$(sudo curl -w "%{http_code}" -o "$file_path" "${curl_opts[@]}" "$link"); then status_code=$(sudo curl -w "%{http_code}" -o "$file_path" "${curl_opts[@]}" "$link")
if [ "$status_code" = "200" ]; then [ "$status_code" = "200" ] && break
download_status=0
break
fi
else
status_code=000
fi
done done
[ "$download_status" -ne 0 ] && sudo rm -f "$file_path"
[[ "$execute" = "-e" && -e "$file_path" ]] && sudo chmod a+x "$file_path" [[ "$execute" = "-e" && -e "$file_path" ]] && sudo chmod a+x "$file_path"
[ "$mode" = "-v" ] && echo "$status_code" [ "$mode" = "-v" ] && echo "$status_code"
[ "$runner" = "self-hosted" ] && release_lock "$lock_path" [ "$runner" = "self-hosted" ] && release_lock "$lock_path"
return "$download_status"
fi fi
} }
+3 -3
View File
@@ -3,7 +3,7 @@ param (
[ValidateNotNull()] [ValidateNotNull()]
[ValidateLength(1, [int]::MaxValue)] [ValidateLength(1, [int]::MaxValue)]
[string] [string]
$version = '8.6', $version = '8.4',
[Parameter(Position = 1, Mandatory = $true)] [Parameter(Position = 1, Mandatory = $true)]
[ValidateNotNull()] [ValidateNotNull()]
[ValidateLength(1, [int]::MaxValue)] [ValidateLength(1, [int]::MaxValue)]
@@ -343,7 +343,7 @@ $php_manifest = $null
$current_profile = "$env:TEMP\setup-php.ps1" $current_profile = "$env:TEMP\setup-php.ps1"
$ProgressPreference = 'SilentlyContinue' $ProgressPreference = 'SilentlyContinue'
$jit_versions = '8.[0-9]' $jit_versions = '8.[0-9]'
$nightly_versions = '8.[7-9]' $nightly_versions = '8.[6-9]'
$xdebug3_versions = "7.[2-4]|8.[0-9]" $xdebug3_versions = "7.[2-4]|8.[0-9]"
$enable_extensions = ('openssl', 'curl', 'mbstring') $enable_extensions = ('openssl', 'curl', 'mbstring')
@@ -439,7 +439,7 @@ if($version -eq 'pre') {
} }
if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version -replace '^(\d+(\.\d+)*).*', '$1.'))) -or $ts -ne $installed.ThreadSafe) { if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version -replace '^(\d+(\.\d+)*).*', '$1.'))) -or $ts -ne $installed.ThreadSafe) {
if ($version -lt '7.0' -and ($null -eq (Get-Module -ListAvailable -Name VcRedist))) { if ($version -lt '7.0' -and ($null -eq (Get-Module -ListAvailable -Name VcRedist))) {
Install-PSPackage VcRedist VcRedist-4.1.527\VcRedist\VcRedist "$github/aaronparker/VcRedist/archive/v4.1.527.zip" Get-VcList >$null 2>&1 Install-PSPackage VcRedist VcRedist-main\VcRedist\VcRedist "$github/aaronparker/VcRedist/archive/main.zip" Get-VcList >$null 2>&1
} }
try { try {
if ($version -match $nightly_versions) { if ($version -match $nightly_versions) {