Compare commits

..
Author SHA1 Message Date
Shivam Mathur 8c5b98f2bd Preserve shared APT sources at managed paths and through symlinks 2026-12-05 19:28:06 +05:30
Shivam Mathur fccdc7dba8 Preserve unrelated APT entries when removing a repository 2026-12-05 19:01:59 +05:30
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 090470a493 Bump the github-actions group with 3 updates (#1171)
Bumps the github-actions group with 3 updates: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/autobuild](https://github.com/github/codeql-action) and [github/codeql-action/analyze](https://github.com/github/codeql-action).


Updates `github/codeql-action/init` from 4.39.4 to 4.39.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/1bd86f2fdb4b86187fa4059f16f31a3202acc9ea...915412ff23e8b7659517e607487dbeae018f2934)

Updates `github/codeql-action/autobuild` from 4.39.4 to 4.39.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/1bd86f2fdb4b86187fa4059f16f31a3202acc9ea...915412ff23e8b7659517e607487dbeae018f2934)

Updates `github/codeql-action/analyze` from 4.39.4 to 4.39.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/1bd86f2fdb4b86187fa4059f16f31a3202acc9ea...915412ff23e8b7659517e607487dbeae018f2934)

---
updated-dependencies:
- dependency-name: github/codeql-action/init
  dependency-version: 4.39.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/autobuild
  dependency-version: 4.39.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.39.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-12-05 16:23:53 +05:30
dependabot[bot]dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Shivam Mathur
a282192fbe Bump minimatch from 11.0.3 to 11.0.10 in the npm_and_yarn group across 1 directory (#1170)
* Bump minimatch

Bumps the npm_and_yarn group with 1 update in the / directory: [minimatch](https://github.com/isaacs/minimatch).


Updates `minimatch` from 11.0.3 to 11.0.10
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v11.0.3...v11.0.10)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-version: 11.0.10
  dependency-type: indirect
  dependency-group: npm_and_yarn
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update glob and cross-spawn to clear npm audit

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shivam Mathur <shivam_jpr@hotmail.com>
2026-12-02 20:26:55 +05:30
Shivam Mathur 715399fa52 Use the current signing key URL for the Bazel APT repository 2026-11-30 01:14:08 +05:30
Shivam Mathur 4889735b89 Switch to sury repo 2026-11-30 01:14:07 +05:30
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 13550279c9 Bump the github-actions group with 4 updates (#1169)
Bumps the github-actions group with 4 updates: [github/codeql-action/init](https://github.com/github/codeql-action), [github/codeql-action/autobuild](https://github.com/github/codeql-action), [github/codeql-action/analyze](https://github.com/github/codeql-action) and [shivammathur/cache-extensions](https://github.com/shivammathur/cache-extensions).


Updates `github/codeql-action/init` from 4.39.3 to 4.39.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/33d7b85da1a04171e211befe2c739303b9a4c066...1bd86f2fdb4b86187fa4059f16f31a3202acc9ea)

Updates `github/codeql-action/autobuild` from 4.39.3 to 4.39.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/33d7b85da1a04171e211befe2c739303b9a4c066...1bd86f2fdb4b86187fa4059f16f31a3202acc9ea)

Updates `github/codeql-action/analyze` from 4.39.3 to 4.39.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/33d7b85da1a04171e211befe2c739303b9a4c066...1bd86f2fdb4b86187fa4059f16f31a3202acc9ea)

Updates `shivammathur/cache-extensions` from 1.15.11 to 1.15.12
- [Release notes](https://github.com/shivammathur/cache-extensions/releases)
- [Commits](https://github.com/shivammathur/cache-extensions/compare/695b1b465eba861efe67cbbc31252c27f5ed253d...0769e8b0c165c62888174c0fe66557ca1616ae45)

---
updated-dependencies:
- dependency-name: github/codeql-action/init
  dependency-version: 4.39.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/autobuild
  dependency-version: 4.39.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action/analyze
  dependency-version: 4.39.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: shivammathur/cache-extensions
  dependency-version: 1.15.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-29 09:52:44 +05:30
Shivam Mathur e40a6698f4 Document ASAN runtime defaults and step overrides 2026-11-27 04:24:41 +05:30
Shivam Mathur a414972cd1 Set ASAN runtime defaults for subsequent workflow steps 2026-11-27 04:15:53 +05:30
Shivam Mathur 2f393273c0 Fix env for asan 2026-11-27 03:57:50 +05:30
Florian Engelhardt bed5f1071b Add asan usage (#1052) 2026-11-27 03:52:20 +05:30
Shivam Mathur fad0ff9c5d Set the setup-php user agent for tool downloads and Node fetches 2026-11-27 01:39:28 +05:30
Jordi Boggiano 66f29b02f3 Send a setup-php user agent and request compressed tool downloads (#1168)
Downloads used curl's default user agent and no Accept-Encoding, so
fallbacks to getcomposer.org transferred the full ~3.8MB phar instead of
~0.9MB gzipped, and could not be told apart from other curl traffic.
2026-11-27 00:40:41 +05:30
Till Krüss 940ea09f22 Add support for Relay on PHP 8.6 (#1166) 2026-11-24 13:05:34 +05:30
18 changed files with 636 additions and 254 deletions
+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@33d7b85da1a04171e211befe2c739303b9a4c066 # v4 uses: github/codeql-action/init@915412ff23e8b7659517e607487dbeae018f2934 # 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@33d7b85da1a04171e211befe2c739303b9a4c066 # v4 uses: github/codeql-action/autobuild@915412ff23e8b7659517e607487dbeae018f2934 # v4
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@33d7b85da1a04171e211befe2c739303b9a4c066 # v4 uses: github/codeql-action/analyze@915412ff23e8b7659517e607487dbeae018f2934 # v4
+1 -1
View File
@@ -48,7 +48,7 @@ jobs:
- name: Setup cache environment - name: Setup cache environment
id: cache-env id: cache-env
uses: shivammathur/cache-extensions@695b1b465eba861efe67cbbc31252c27f5ed253d # v1 uses: shivammathur/cache-extensions@0769e8b0c165c62888174c0fe66557ca1616ae45 # 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 }}
+57 -1
View File
@@ -44,6 +44,7 @@ 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)
@@ -531,6 +532,13 @@ 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.
@@ -652,6 +660,54 @@ 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.
@@ -1080,7 +1136,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")
- [ppa:ondrej/php](https://launchpad.net/~ondrej/+archive/ubuntu/php "Packaging active PHP packages") - [Sury PHP packages](https://packages.sury.org/php/) and the [setup-php mirror](https://ppa.setup-php.com/sury/)
- [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")
+2
View File
@@ -72,6 +72,7 @@ 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'}
@@ -107,6 +108,7 @@ 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,6 +21,10 @@ 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')
+1 -1
View File
File diff suppressed because one or more lines are too long
+204 -121
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.72.1", "@typescript-eslint/eslint-plugin": "^8.73.0",
"@typescript-eslint/parser": "^8.72.1", "@typescript-eslint/parser": "^8.73.0",
"@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.14.0", "eslint": "^10.15.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.17.1", "eslint-plugin-import-x": "^4.18.1",
"eslint-plugin-jest": "^29.17.0", "eslint-plugin-jest": "^29.17.1",
"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.5", "nock": "^15.0.6",
"prettier": "^3.9.10", "prettier": "^3.10.1",
"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.5", "version": "0.23.7",
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz", "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.7.tgz",
"integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==", "integrity": "sha512-Ix1tmZjA7/OmE7ROAfORe83hVnqlDzLpZVHFjHQt5mvLm1U03qMexpaxKqFIL362QV32SoPaZqmKQr3tdqFY2w==",
"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": "^10.2.4" "minimatch": "^11.0.5"
}, },
"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.0.3", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.0.3.tgz", "resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.1.0.tgz",
"integrity": "sha512-SI7kyKHq4XXDRozw+r9GlRZkia1ZkFrpLW98r2IC2Bpr8YkFGE3fvjzmxCG0x78A++69HmDNrDvSMYBZmHGpKA==", "integrity": "sha512-GPm/Dbvk5RLmhRnxXIa7nTpK0xtl4E0wj0MslsuNiJ1FIROU+2+9lgUC/dgF7Ey4QCWhfEsgxilMRMCdHPfDfw==",
"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.44.0", "version": "0.45.14",
"resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.44.0.tgz", "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.45.14.tgz",
"integrity": "sha512-IYHevRStF4ijM20GI9c9Ndhw483NSAjCydQhUr4/zIB0BNLsTVw3vFAxTo6TlvX4QnV60wEHttUa9539TTAq+A==", "integrity": "sha512-2y8lEnhEKzgxSoALB7ibIPpUJ68YqWmvGjYO2D6Z4dAmMAr7kG9Poh6HiW1poT+okHGSr6LgsbqO8rDDH7MsSg==",
"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.11" "rettime": "^0.11.12"
}, },
"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.72.1", "version": "8.74.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.72.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.74.0.tgz",
"integrity": "sha512-5CokTWXpmbylfFabsbvHC0CAw3XLaGnoa+nFJX5FR592h/LoZsENUE6p/rg5xvkKrFEXz6pYmgI29AgXc2N3BQ==", "integrity": "sha512-z3KXk1+Vm+d82ZRplOoC89ho4Rf1da5ju6sx8//92GnN532U62DGPjECXkkVqtYzIv0zoJlpO39SX2Z9tk6LVw==",
"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.72.1", "@typescript-eslint/scope-manager": "8.74.0",
"@typescript-eslint/type-utils": "8.72.1", "@typescript-eslint/type-utils": "8.74.0",
"@typescript-eslint/utils": "8.72.1", "@typescript-eslint/utils": "8.74.0",
"@typescript-eslint/visitor-keys": "8.72.1", "@typescript-eslint/visitor-keys": "8.74.0",
"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.72.1", "@typescript-eslint/parser": "^8.74.0",
"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.72.1", "version": "8.74.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.72.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.74.0.tgz",
"integrity": "sha512-ZGwZP4OCfyA0AQTpEAMWz+rtX01DRhQWW5hB0ucKDEIX5U7jdmPSaMx94rQfaPAQzIYz2BimOgKOJtjfpRFQ9g==", "integrity": "sha512-ecr8AYdig7avVkxaHdQvxHnIJ/mOyliO4Gv/uWF8q69vBew/z3sexqBwHUZX5Vql+Ns0w4sH6gBLkICGbOvJkA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/scope-manager": "8.72.1", "@typescript-eslint/scope-manager": "8.74.0",
"@typescript-eslint/types": "8.72.1", "@typescript-eslint/types": "8.74.0",
"@typescript-eslint/typescript-estree": "8.72.1", "@typescript-eslint/typescript-estree": "8.74.0",
"@typescript-eslint/visitor-keys": "8.72.1", "@typescript-eslint/visitor-keys": "8.74.0",
"debug": "^4.4.3" "debug": "^4.4.3"
}, },
"engines": { "engines": {
@@ -2000,15 +2000,49 @@
"typescript": ">=4.8.4 <6.1.0" "typescript": ">=4.8.4 <6.1.0"
} }
}, },
"node_modules/@typescript-eslint/project-service": { "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": {
"version": "8.72.1", "version": "8.74.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.72.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.74.0.tgz",
"integrity": "sha512-fAuVMkwdO/huI8nyo/WKnNKf6Gag93S56Rh3Ts5mGcavwSdaN8tRg1gCeIGX8PF+nzp1BjGfO4gHhGzW1J6jTg==", "integrity": "sha512-wL348k6l92DNG+kPP5rVpKwNBoz7a3xRZy3TPKc1uymQttd7u7gcMv3eENmcuh4CjC4mO3FTM0DYstFXMyDLuw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/tsconfig-utils": "^8.72.1", "@typescript-eslint/project-service": "8.74.0",
"@typescript-eslint/types": "^8.72.1", "@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": {
"version": "8.74.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.74.0.tgz",
"integrity": "sha512-z/mymuE+JlEeSFIv3Mo70EvgG1Zz74Hl0IDfExfXutARAP834bt+MppTD7mVAwmZO0GdxdOAi0jbTam749eH6g==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/tsconfig-utils": "^8.74.0",
"@typescript-eslint/types": "^8.74.0",
"debug": "^4.4.3" "debug": "^4.4.3"
}, },
"engines": { "engines": {
@@ -2023,14 +2057,14 @@
} }
}, },
"node_modules/@typescript-eslint/scope-manager": { "node_modules/@typescript-eslint/scope-manager": {
"version": "8.72.1", "version": "8.74.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.72.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.74.0.tgz",
"integrity": "sha512-lC/t6eMCZZQAAKZEYGL6RDVSuFehpdmMT6h+nJIjIa6oylN/PwDgDVtEIbB7O9xFfZYtZAYLoLlDNWKJhtF+uQ==", "integrity": "sha512-kpOdpu4CpWN5U38ox3f727DwWRBtUAVhyUJtqTBYe5gf2wYoxac7PgKP14txrxN7ICVtcjlLdzjqfRgpSnDKvQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.72.1", "@typescript-eslint/types": "8.74.0",
"@typescript-eslint/visitor-keys": "8.72.1" "@typescript-eslint/visitor-keys": "8.74.0"
}, },
"engines": { "engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -2041,9 +2075,9 @@
} }
}, },
"node_modules/@typescript-eslint/tsconfig-utils": { "node_modules/@typescript-eslint/tsconfig-utils": {
"version": "8.72.1", "version": "8.74.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.72.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.74.0.tgz",
"integrity": "sha512-e4D5R5vpeAEPBxT2BAzsFQL3sbwyeeeo5+aczgNSRK1V734jE7pTqaGFU+fXapWEQwnZbpFaTn32+Z8DwS6OTg==", "integrity": "sha512-p07wAuaS6BjCYgOSXKJi4YhvTnAf7fiG37e9THcpnYaQEt2QiTTYZWKwUFNgeRiywiMudazhzgddAirZ0GgHtQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -2058,15 +2092,15 @@
} }
}, },
"node_modules/@typescript-eslint/type-utils": { "node_modules/@typescript-eslint/type-utils": {
"version": "8.72.1", "version": "8.74.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.72.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.74.0.tgz",
"integrity": "sha512-iY2wlmyrXJmx4yxUGP3aYCFF3cA/6ShddOKmLU2dx7LnEykbAM8WThlxZEfd1NddqceF6eJmZUayxx9oKIYNlg==", "integrity": "sha512-CV3Y3la8l3F9ANfxcfpgSSiQgJTe4IeLEoZV4O/gcW86Ugp8X6SKiQ0vm+QegXaRIbbDMokZZSF3A1CgiU/kPw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.72.1", "@typescript-eslint/types": "8.74.0",
"@typescript-eslint/typescript-estree": "8.72.1", "@typescript-eslint/typescript-estree": "8.74.0",
"@typescript-eslint/utils": "8.72.1", "@typescript-eslint/utils": "8.74.0",
"debug": "^4.4.3", "debug": "^4.4.3",
"ts-api-utils": "^2.5.0" "ts-api-utils": "^2.5.0"
}, },
@@ -2082,33 +2116,19 @@
"typescript": ">=4.8.4 <6.1.0" "typescript": ">=4.8.4 <6.1.0"
} }
}, },
"node_modules/@typescript-eslint/types": { "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": {
"version": "8.72.1", "version": "8.74.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.72.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.74.0.tgz",
"integrity": "sha512-LmE5IhQet1BWOWEXqBrVtBPsMAOQ6Nzk35d+WLh3mk4EUF33sqlfxjio1MdYeSvKSG5skactKKuixBIKXhL4Rw==", "integrity": "sha512-wL348k6l92DNG+kPP5rVpKwNBoz7a3xRZy3TPKc1uymQttd7u7gcMv3eENmcuh4CjC4mO3FTM0DYstFXMyDLuw==",
"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.72.1", "@typescript-eslint/project-service": "8.74.0",
"@typescript-eslint/tsconfig-utils": "8.72.1", "@typescript-eslint/tsconfig-utils": "8.74.0",
"@typescript-eslint/types": "8.72.1", "@typescript-eslint/types": "8.74.0",
"@typescript-eslint/visitor-keys": "8.72.1", "@typescript-eslint/visitor-keys": "8.74.0",
"debug": "^4.4.3", "debug": "^4.4.3",
"minimatch": "^10.2.2", "minimatch": "^11.0.1",
"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"
@@ -2121,20 +2141,40 @@
"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.72.1", "version": "8.74.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.72.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.74.0.tgz",
"integrity": "sha512-5v5liypurJBFHCBNqh/RjsymAD+VWcE0djuGY/BUqp5fC3Qn+luWDEksjuTtWjPn6i5zQlUtkZCRG/CYG0yCkA==", "integrity": "sha512-IpWXPxXXomzxyTcvjhZJexgdvtTR1TooLAPpuxzaGqQ8BHll1lf4Ysp/BTE/l0U5TJ+x1j7B4bEM8pLRrvY+XA==",
"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.72.1", "@typescript-eslint/scope-manager": "8.74.0",
"@typescript-eslint/types": "8.72.1", "@typescript-eslint/types": "8.74.0",
"@typescript-eslint/typescript-estree": "8.72.1" "@typescript-eslint/typescript-estree": "8.74.0"
}, },
"engines": { "engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -2148,14 +2188,48 @@
"typescript": ">=4.8.4 <6.1.0" "typescript": ">=4.8.4 <6.1.0"
} }
}, },
"node_modules/@typescript-eslint/visitor-keys": { "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": {
"version": "8.72.1", "version": "8.74.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.72.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.74.0.tgz",
"integrity": "sha512-SB8xqipSzZHUePCCLNeYxqnxq83X61/qzNhjQGbTfjxGZIeOEP7tBgWYX05Tcd6CgE02WdTJnh5b8kMZJ/+bnQ==", "integrity": "sha512-wL348k6l92DNG+kPP5rVpKwNBoz7a3xRZy3TPKc1uymQttd7u7gcMv3eENmcuh4CjC4mO3FTM0DYstFXMyDLuw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.72.1", "@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": {
"version": "8.74.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.74.0.tgz",
"integrity": "sha512-XSZmOtMUbWCBIM+2BK134FyMFxmll1mW2mPLk/PSwYQYzGIPMgJAqL929U4qXVizLv7Xq5b7r41/o7Ombuwk0g==",
"dev": true,
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.74.0",
"eslint-visitor-keys": "^5.0.0" "eslint-visitor-keys": "^5.0.0"
}, },
"engines": { "engines": {
@@ -3413,9 +3487,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/cross-spawn": { "node_modules/cross-spawn": {
"version": "7.0.6", "version": "7.1.2",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.1.2.tgz",
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "integrity": "sha512-8BPK2r+sKWC8sDinRwLwrFMq2lXTBBwzYYEB9LiCznfMurOi4FOvQflq3XOLGG+HPdMSVpe+k/s96+AtDEOgPg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -3565,9 +3639,9 @@
} }
}, },
"node_modules/eslint": { "node_modules/eslint": {
"version": "10.14.0", "version": "10.16.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.14.0.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.16.0.tgz",
"integrity": "sha512-T0pNsxkb9IKmtQjhpK3d7nWOpFv+YHuMbTJnSVMoQblF0onvXfErrtp4V1jHtsQPan7dKaGVD0q1WCXnzMF31A==", "integrity": "sha512-Xu3PRLG/wCaZWZ20gkExUcNqL2mWWsXTR+Lln3Sof4Y9WuA678fH9hrlQ8B6UNwbTnsKdDdBYOd2jxtycXVTGQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"workspaces": [ "workspaces": [
@@ -3576,7 +3650,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.5", "@eslint/config-array": "^0.23.7",
"@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",
@@ -3601,7 +3675,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": "^10.2.6", "minimatch": "^11.0.5",
"natural-compare": "^1.4.0", "natural-compare": "^1.4.0",
"optionator": "^0.9.3" "optionator": "^0.9.3"
}, },
@@ -3700,18 +3774,20 @@
} }
}, },
"node_modules/eslint-plugin-import-x": { "node_modules/eslint-plugin-import-x": {
"version": "4.17.1", "version": "4.18.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.17.1.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-import-x/-/eslint-plugin-import-x-4.18.1.tgz",
"integrity": "sha512-4cdstYkKCyjumM2Q9NSI03K8D2a9F4Ssz33K2lv2hQa4KmR9jPLwk3uWGtNvclfqBrPGfGuMBwsGMbe6dMRbfg==", "integrity": "sha512-D1h++38NS2Z40zf8jbd2OHqDrnIFRKpdp8sL0jP4xSDGZj6MNwEQua8F+r3tOWjcHrsWuhHOJ7wASWioJ31tfg==",
"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", "minimatch": "^9.0.3 || ^10.1.2 || ^11.0.1",
"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"
@@ -3736,10 +3812,17 @@
} }
} }
}, },
"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.0", "version": "29.17.2",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.17.0.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.17.2.tgz",
"integrity": "sha512-6jtpU6MhYKbagkES02TupWAUUooJpZtKg94Ax0b8HhUorv3InSTBU8RRtlSBe0LocOcShXOpyec3PHzPDkJCSg==", "integrity": "sha512-PkDicB9njFXWby0rfpHSMGLkNf37c6EavIDUPNXVv1BGRLyr1nnea4jRc1EFOlUTZCW5iGzVGGHXb/siEf+QmQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -4171,13 +4254,13 @@
} }
}, },
"node_modules/glob": { "node_modules/glob": {
"version": "14.0.3", "version": "14.0.7",
"resolved": "https://registry.npmjs.org/glob/-/glob-14.0.3.tgz", "resolved": "https://registry.npmjs.org/glob/-/glob-14.0.7.tgz",
"integrity": "sha512-A1vjIwC3qpdCso45Iw127gnp7sPhqgY8lUQhDrArIs+GbmfaaVPFuoyy7WyLT9EPZCRZ7j7aLdwUhQmHWesEow==", "integrity": "sha512-ob8P0VbyEjcLG2ycNYmzYhZj65kkcN5b7tt5moGhTq3rkXtuU8MB+i0GIzPtLnSHVF2DkK4M+nQRojDvsOGVJw==",
"dev": true, "dev": true,
"license": "BlueOak-1.0.0", "license": "BlueOak-1.0.0",
"dependencies": { "dependencies": {
"minimatch": "^11.0.2", "minimatch": "^11.0.5",
"minipass": "^7.1.3", "minipass": "^7.1.3",
"path-scurry": "^3.0.0" "path-scurry": "^3.0.0"
}, },
@@ -5219,17 +5302,17 @@
} }
}, },
"node_modules/minimatch": { "node_modules/minimatch": {
"version": "11.0.3", "version": "11.0.10",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.3.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.10.tgz",
"integrity": "sha512-iny/40PEGkNJQ5/Pv6z3nm6FbRAby32GeZRjCUJk2WnNDbgPSTcdI+DDvLqsgBdD4cD5sMtMheqPPnehCCa8Nw==", "integrity": "sha512-L3/cjhQ5E6lft0VCp/2mO3Ic74RnutKy3rz7iGwp/6w1hKcO262g2rbfacFyw6eBig5OdI0nu5PpuA0/WQs9Tw==",
"dev": true, "dev": true,
"license": "BlueOak-1.0.0", "license": "BlueOak-1.0.0",
"dependencies": { "dependencies": {
"@isaacs/nonrecursive-glob-match": "^1.0.3", "@isaacs/nonrecursive-glob-match": "^1.1.0",
"brace-expansion": "^5.0.12" "brace-expansion": "^5.0.12"
}, },
"engines": { "engines": {
"node": "18 || 20 || >=22" "node": "20 || >=22"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/isaacs" "url": "https://github.com/sponsors/isaacs"
@@ -5293,13 +5376,13 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/nock": { "node_modules/nock": {
"version": "15.0.5", "version": "15.0.7",
"resolved": "https://registry.npmjs.org/nock/-/nock-15.0.5.tgz", "resolved": "https://registry.npmjs.org/nock/-/nock-15.0.7.tgz",
"integrity": "sha512-nVeuZGS2we1PyvqbW082Qj0EB4bd//6pZk/zOPDlaTPU72qcWrqfHg3kx9JcBcH1fJxwJHjmsfuQ4mss42su4w==", "integrity": "sha512-BH7UHCRo/zHX0PT0oyz6RH0KZwkYo6TiSF5eJ3gg8lrvtSW6aKiNAXTmWUbHxmjMfvvrTT0ygl7/WM15XoAthg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@mswjs/interceptors": "^0.44.0" "@mswjs/interceptors": "^0.45.14"
}, },
"engines": { "engines": {
"node": ">=22.20.0" "node": ">=22.20.0"
@@ -5611,9 +5694,9 @@
} }
}, },
"node_modules/prettier": { "node_modules/prettier": {
"version": "3.9.10", "version": "3.10.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.10.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.10.1.tgz",
"integrity": "sha512-skGHTH1Yb9QvaTC4hWnRTzEYtCpApF0UMBPz+t/0ZPzP8ihefo/btKd+QA7pUE0fEwA1SbS/NmhyEcstdXOIdA==", "integrity": "sha512-70vp3ZUYoPlFbF9uiTdXHUUCGEIp7d4+6p+8DYbkm2jP7x/3i/paXVF6dopSI3zd/CEitrZN1rc4i85xWmmXlg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"bin": { "bin": {
@@ -5759,9 +5842,9 @@
} }
}, },
"node_modules/rettime": { "node_modules/rettime": {
"version": "0.11.12", "version": "0.11.13",
"resolved": "https://registry.npmjs.org/rettime/-/rettime-0.11.12.tgz", "resolved": "https://registry.npmjs.org/rettime/-/rettime-0.11.13.tgz",
"integrity": "sha512-5ExtR1ppiDBQkVoPw5NAqdbfH4Iq2VOmQKHMtUoaFxA9bo2krzFYBtyq6K40xxbYp+2w/YOr6D+1ToF6tTN53A==", "integrity": "sha512-kzDWDmrxn6KPqqyFaBcXtV+GzaUzgYulSrWBetyxsPZjlXabWoeg3uZJU+zK/TnFUtkWC2Yw7J/VAWYnzy0tRA==",
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
+1 -1
View File
@@ -65,7 +65,7 @@
}, },
"overrides": { "overrides": {
"glob": "^14.0.3", "glob": "^14.0.3",
"minimatch": "^11.0.3" "minimatch": "^11.0.10"
}, },
"bugs": { "bugs": {
"url": "https://github.com/shivammathur/setup-php/issues" "url": "https://github.com/shivammathur/setup-php/issues"
+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.5relay // match 7.4relay...8.6relay
// 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-5])relay(-v?\d+\.\d+\.\d+|-nightly)?$/.test( case /^(7\.4|8\.[0-6])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.5relay // match 7.4relay...8.6relay
// 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-5])relay(-v?\d+\.\d+\.\d+|-nightly)?$/.test( case /^(7\.4|8\.[0-6])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': `Mozilla/5.0 (${process.platform} ${process.arch}) setup-php` 'User-Agent': `setup-php (${process.platform}; ${process.arch}; +https://setup-php.com)`
}; };
if (auth_token) { if (auth_token) {
headers['Authorization'] = 'Bearer ' + auth_token; headers['Authorization'] = 'Bearer ' + auth_token;
+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 ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php add_ppa >/dev/null 2>&1
(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 -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 ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php add_ppa >/dev/null 2>&1
[[ "$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
+10 -4
View File
@@ -104,7 +104,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 ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php add_ppa >/dev/null 2>&1
[ "${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,7 +124,11 @@ 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() {
run_script "php-builder" "${runner:?}" "$version" "${debug:?}" "${ts:?}" if [[ -n "${asan:-}" && "$version" =~ ${no_asan_builds:?} ]]; then
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.
@@ -217,7 +221,7 @@ get_php_packages() {
# Function to install packaged PHP # Function to install packaged PHP
add_packaged_php() { add_packaged_php() {
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php add_ppa >/dev/null 2>&1
IFS=' ' read -r -a packages <<<"$(get_php_packages)" IFS=' ' read -r -a packages <<<"$(get_php_packages)"
install_packages "${packages[@]}" install_packages "${packages[@]}"
} }
@@ -237,7 +241,9 @@ 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
if [[ "$version" =~ ${php_builder_versions:?} || "$ts" = "zts" ]]; then # Sury's Ubuntu archive does not publish the PHP CLI debug symbols.
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
+3 -2
View File
@@ -304,9 +304,10 @@ 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 -OutFile $tool_path).StatusCode $status_code = (Invoke-WebRequest -Passthru -Uri $url -UserAgent $user_agent -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/[^/?#]+$') {
@@ -314,7 +315,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 -OutFile $tool_path).StatusCode $status_code = (Invoke-WebRequest -Passthru -Uri $url -UserAgent $user_agent -OutFile $tool_path).StatusCode
} }
} catch { } catch {
$status_code = 0 $status_code = 0
+11 -2
View File
@@ -224,6 +224,12 @@ 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
@@ -263,12 +269,15 @@ 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"
status_code=$(get -v -e "$tool_path" "${url[@]}") # Tools are single files, so let servers gzip them in transit when curl can decode it.
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=$(get -v -e "$tool_path" "${url[0]}") status_code=$(download_tool "$tool_path" "${url[0]}")
fi fi
fi fi
if [ "$status_code" = "200" ]; then if [ "$status_code" = "200" ]; then
+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://bazel.build/bazel-release.pub.gpg stable jdk1.8 add_list bazel/apt https://storage.googleapis.com/bazel-apt https://releases.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
+316 -109
View File
@@ -37,35 +37,45 @@ set_base_version() {
# Helper function to update package lists. # Helper function to update package lists.
update_lists_helper() { update_lists_helper() {
list=$1 local 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" ${SUDO} apt-get update -o Dir::Etc::sourcelist="$list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0" "${@:2}"
else else
${SUDO} apt-get update ${SUDO} apt-get update
fi fi
} }
# Search active APT files, including symlinks, without descending into directories.
grep_sources() (
shopt -s nullglob
local files=("$list_dir"/*.list "$list_dir"/*.sources)
(( ${#files[@]} )) && grep -d skip -D skip "$@" -- "${files[@]}"
)
# Function to update the package lists. # Function to update the package lists.
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_sources -El -e "$ppa_search" 2>/dev/null | head -n 1)"
fi
hash_cmd="$(command -v sha256sum || command -v shasum)"
if [ -n "$status_token" ] && [ -n "$hash_cmd" ]; then
status_file=/tmp/os_lists_"$(echo -n "$status_token" | $hash_cmd | awk '{print $1}')"
elif [ -n "$status_token" ]; then
status_file=/tmp/os_lists_$(date +%s)
fi fi
[ -n "$list" ] || return 1
status_file="/tmp/os_lists_refresh_${list##*/}"
[[ "${runner:-}" != self-hosted ]] && cmp -s "$list" "$status_file" && return 0
local output rc
output=$(LC_ALL=C update_lists_helper "$list" -o APT::Update::Error-Mode=any 2>&1) || {
rc=$?
[[ "${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
@@ -156,7 +166,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 \
|| get -s -n "" "$ppa_sp/keys/$ppa.fingerprint" || { [ -n "${4:-}" ] && get -s -n "" "${4%.gpg}.fingerprint"; }
} }
@@ -170,26 +180,49 @@ 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
} }
# Function to add a GPG key. # Check for a binary OpenPGP public keyring readable by APT.
add_key() { is_gpg_keyring() {
ppa=${1:-ondrej/php} local keys
ppa_url=$2 [ -s "$1" ] && LC_ALL=C file -Lb -- "$1" | grep -Eiq '^(OpenPGP public key|PGP(/GPG)? (public key|key public ring))' || return 1
package_dist=$3 keys=$(gpg --batch --with-colons --show-keys "$1" 2>/dev/null) || return 1
key_source=$4 [[ -z "${2:-}" ]] || awk -F: -v signer="$2" '$1 == "fpr" && $10 ~ (signer "$") {found=1} END {exit !found}' <<< "$keys"
key_file=$5
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"
key_urls=("${sks[@]/%/\/pks\/lookup\?"$sks_params"}")
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
} }
# Function to add a GPG key.
add_key() (
local ppa=$1 ppa_url=$2 package_dist=$3 key_source=$4 key_file=$5
local mirror=${6:-} signer=${7:-} fingerprint sks_params
local key_urls=("$key_source")
if [[ -z "$key_source" || "$key_source" = "$ppa_url" ]]; then
key_urls=()
if fingerprint="$("${ID}"_fingerprint "$ppa" "$ppa_url" "$package_dist" "$mirror")" && [[ "$fingerprint" =~ ^[[:xdigit:]]+$ ]]; then
sks_params="op=get&options=mr&exact=on&search=0x$fingerprint"
key_urls=("${sks[@]/%/\/pks\/lookup\?"$sks_params"}")
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() {
local ppa=$1 local ppa=$1
@@ -200,10 +233,10 @@ handle_existing_list() {
echo "Repository $ppa ($branches) already exists" && return 1 echo "Repository $ppa ($branches) already exists" && return 1
fi fi
if merged_components="$(merge_components_from_file "$check_lists_file" "$branches")"; then if merged_components="$(merge_components_from_file "$check_lists_file" "$branches")"; then
sudo rm -f "$check_lists_file" && printf '%s\n' "$merged_components" && return 0 printf '%s\n' "$merged_components" && return 0
fi fi
if [[ "$list_format" = "deb822" && "$check_lists_file" = *.list ]]; then if [[ "$list_format" = "deb822" && "$check_lists_file" = *.list ]]; then
sudo rm -f "$check_lists_file" && printf '%s\n' "$branches" && return 0 printf '%s\n' "$branches" && return 0
fi fi
echo "Repository $ppa ($branches) already exists" && return 1 echo "Repository $ppa ($branches) already exists" && return 1
} }
@@ -217,48 +250,43 @@ 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 local arch list dest by_hash=
arch="$(dpkg --print-architecture)" arch="$(dpkg --print-architecture)"
sudo rm -f "$list_dir"/"${ppa/\//-}".list "$list_dir"/"${ppa/\//-}".sources "$list_dir"/"$list_basename".list "$list_dir"/"$list_basename".sources || true case "${url%/}" in
"$ppa_sp/sury"|"$ppa_sp/apache2") by_hash=' by-hash=force' ;;
esac
dest="$list_dir/$list_basename.$(get_sources_extension "$type")"
for list in "$list_dir/${ppa/\//-}".{list,sources} "$list_dir/$list_basename".{list,sources}; do
[[ "$list" = "$dest" ]] || remove_list_entry "$list" "$url" || return 1
done
preserve_list "$dest" "$url" || return 1
if [ "$type" = "deb822" ]; then if [ "$type" = "deb822" ]; then
cat <<EOF | sudo tee "$list_dir"/"$list_basename".sources >/dev/null {
Types: deb printf '%s\n' "Types: deb" "URIs: $url" "Suites: $suite" "Components: $components" "Architectures: $arch" "Signed-By: $key_file"
URIs: $url if [ -n "$by_hash" ]; then printf '%s\n' 'By-Hash: force'; fi
Suites: $suite } | sudo tee "$dest" >/dev/null
Components: $components
Architectures: $arch
Signed-By: $key_file
EOF
else else
echo "deb [arch=$arch signed-by=$key_file] $url $suite $components" | sudo tee "$list_dir"/"$list_basename".list >/dev/null 2>&1 echo "deb [arch=$arch signed-by=$key_file$by_hash] $url $suite $components" | sudo tee "$dest" >/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 primary=${2:-} local pattern=${2:-${3:-}}
local secondary=${3:-}
local status_token=${4:-$primary}
local match_file= local match_file=
check_lists_file= check_lists_file=
if [ -n "$primary" ]; then if [ -n "$pattern" ]; then
match_file=$(grep -Elr "$primary" "$list_dir" 2>/dev/null | head -n 1) match_file=$(grep_sources -El -e "$pattern" 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" "$status_token" update_lists "$ppa" "$match_file"
fi fi
check_lists_file="$match_file"
return 0 return 0
fi fi
return 1 return 1
@@ -266,21 +294,19 @@ check_lists() {
# Function to add a sources list. # Function to add a sources list.
add_list() { add_list() {
ppa=${1-ondrej/php} local ppa=${1-$default_ppa}
ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"} ppa_url=${2:-"$lpc_ppa/$ppa/ubuntu"}
key_source=${3:-"$ppa_url"} key_source=${3:-}
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" "$status_token"; then if check_lists "$ppa" "$primary_pattern" "$secondary_pattern" "${8:-}"; 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"
@@ -288,14 +314,25 @@ 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" add_key "$ppa" "$ppa_url" "$package_dist" "$key_source" "$key_file" "${6:-}" || return 1
write_list "$list_format" "$ppa" "$ppa_url" "$package_dist" "$branches" "$key_file" [[ -z "$list_path" ]] || remove_list_entry "$list_path" "$ppa_url" || return 1
write_list "$list_format" "$ppa" "$ppa_url" "$package_dist" "$branches" "$key_file" || return 1
list_path="$list_dir"/"${ppa%%/*}"-"$ID"-"${ppa#*/}"-"$package_dist"."$list_extension" list_path="$list_dir"/"${ppa%%/*}"-"$ID"-"${ppa#*/}"-"$package_dist"."$list_extension"
update_lists "$ppa" "$list_path" "$status_token" # A caller requesting an index needs a successful refresh, even if APT has cached lists.
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;
} }
@@ -309,66 +346,187 @@ 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")"
local status_token check_lists "$ppa" "$primary_pattern" "$secondary_pattern" || return 1
status_token="${ppa_url}|${package_dist}|${branches}" }
if check_lists "$ppa" "$primary_pattern" "$secondary_pattern" "$status_token"; then
return 0; # Remove matching entries from one APT file and invalidate its cached refresh.
remove_list_entry() {
local list=$1 ppa_url=$2 uri filter
[[ -f "$list" ]] && grep -Fq -- "${ppa_url%/}" "$list" || return 0
uri=$(escape_regex "${ppa_url%/}")
[[ "$ppa_url" != //* ]] || uri="https?:$uri"
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 else
return 1; filter="/^[[:blank:]]*deb(-src)?[[:blank:]]+(\\[[^]]*\\][[:blank:]]+)?$uri\\/*([[:space:]]|$)/d"
fi fi
sudo sed --follow-symlinks -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
}
# Keep any other entries at an active sibling path before publishing a managed source.
preserve_list() {
local list=$1 url saved stamp="${RUNNER_TEMP:-/tmp}/os_lists_${1##*/}"
[[ -e "$list" || -L "$list" ]] || return 0
if [[ -f "$stamp" ]] && tail -n +4 "$stamp" | cmp -s - "$list"; then
sudo rm -f -- "$list"
return
fi
shift
for url in "$@"; do remove_list_entry "$list" "$url" || return 1; done
[[ -e "$list" || -L "$list" ]] || return 0
saved=$(sudo mktemp --suffix=".${list##*.}" "${list%.*}.XXXXXXXX") && sudo mv -fT -- "$list" "$saved"
} }
# Function to remove a PPA. # Function to remove a PPA.
remove_list() { remove_list() {
ppa=${1-ondrej/php} local ppa=${1-$default_ppa} list ppa_url
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
grep -lr "$ppa_url" "$list_dir" | xargs -n1 sudo rm -f while IFS= read -r -d '' list; do
remove_list_entry "$list" "$ppa_url" || return 1
done < <(grep_sources -FlZ --exclude="${3:-}" -e "${ppa_url%/}")
done done
sudo rm -f "$key_dir"/"${ppa/\//-}"-keyring /tmp/os_lists* || true [[ ! -e "$key_dir/${ppa/\//-}-keyring" ]] || sudo rm -f "$key_dir/${ppa/\//-}-keyring"
} }
# 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:-ondrej/php} ppa=${1:-$default_ppa}
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
} }
# Function to add the PPA mirror. # Remove sources from caches that still have the old Launchpad mirrors.
add_ppa_sp_mirror() { remove_legacy_mirrors() {
ppa=$1 local ppa old_ppa old_sp
ppa_name="$(basename "$ppa")" for ppa in ondrej/php ondrej/apache2; do
remove_list "$ppa" || true old_ppa="//${ppa_sp#*://}/$ppa/ubuntu"
[ "${debug:?}" = "debug" ] && add_list sp/"$ppa_name" "$ppa_sp/$ppa/ubuntu" "$ppa_sp/$ppa/ubuntu/key.gpg" "$VERSION_CODENAME" "main/debug" old_sp="//${sp#*://}/$ppa/ubuntu"
add_list sp/"$ppa_name" "$ppa_sp/$ppa/ubuntu" "$ppa_sp/$ppa/ubuntu/key.gpg" if grep_sources -Fq -e "$old_ppa" -e "$old_sp"; then
remove_list "$ppa" "$old_ppa" && remove_list "$ppa" "$old_sp" || return 1
fi
done
} }
add_sury_list() { # Function to add the Sury mirror.
ppa=${1:-ondrej/php} add_ppa_sp_mirror() {
[ "${debug:?}" = "debug" ] && add_list "$ppa" "$sury"/"${ppa##*/}"/ "$sury"/"${ppa##*/}"/apt.gpg "$VERSION_CODENAME" "main/debug" local ppa=$1 name=${1##*/} url="$ppa_sp/sury"
add_list "$ppa" "$sury"/"${ppa##*/}"/ "$sury"/"${ppa##*/}"/apt.gpg [[ "$ppa" =~ $mirrored_ppas ]] || return 1
[ "$name" != apache2 ] || url="$ppa_sp/apache2"
local key_mirror="$ppa_sp/keys/sury/$name.gpg"
remove_list "$ppa" || true
remove_legacy_mirrors || return 1
[ "${debug:?}" = "debug" ] && add_list "sp/$name" "$url" "$url/apt.gpg" "$VERSION_CODENAME" "main/debug" "$key_mirror"
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.
# Arguments: [--keyring path primary-key-url mirror-key-url] list ID, primary URL, mirror URL, keyring, suite, components, optional source URLs to replace.
add_list_with_fallback() (
local managed_key='' key_url='' key_mirror=''
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_sources -qF --exclude="$source" -f <(printf '%s\n' "${@:7}") || 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
preserve_list "$list_dir/$source" "$primary" "$mirror" "${@:7}" || return 1
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:-ondrej/php} ppa=${1:-$default_ppa}
if [[ "$ID" = "ubuntu" || "$ID_LIKE" =~ ubuntu ]] && [[ "$ppa" =~ "ondrej/" ]]; then if [[ "$ID ${ID_LIKE:-}" =~ ubuntu|debian && "$ppa" =~ $mirrored_ppas ]]; then
if [ "$VERSION_ID" = "26.04" ]; then remove_legacy_mirrors || return 1
add_sury_list local components=main name=${ppa##*/} primary="$sury/${ppa##*/}/" key_mirror="$ppa_sp/keys/sury/${ppa##*/}.gpg"
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
if is_ubuntu_ppa_up "$ppa" ; then local mirror="$ppa_sp/sury/" managed_key="$key_dir/sury-$name-keyring.gpg" key=
[ "${runner:?}" = "self-hosted" ] && find "$list_dir" -type f -name 'sp*' -exec grep -qF "${sp/https:\/\/}" {} \; -delete local -a curl_opts=("${curl_opts[@]}" --connect-timeout 5 --max-time 15)
[ "${debug:?}" = "debug" ] && add_list "$ppa" "$lpc_ppa/$ppa/ubuntu" "$lpc_ppa/$ppa/ubuntu" "$VERSION_CODENAME" "main/debug" if [ "$name" = apache2 ]; then
add_list "$ppa" mirror="$ppa_sp/apache2/"
elif [ "$ppa" = "ondrej/php" ]; then [ "${debug:-}" != debug ] || components="main/debug main"
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
@@ -377,25 +535,70 @@ 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:-ondrej/php} ppa=${1:-$default_ppa}
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)"
IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")" local repo=${ppa_sources[$ID/$ppa]:-$ppa}
local list_path local list_path
list_path="$(grep -Elr "$primary_pattern" "$list_dir" 2>/dev/null | head -n 1)" list_path="$list_dir/${repo%%/*}-$ID-${repo#*/}-$package_dist.$(get_sources_extension "$list_format")"
if [ -z "$list_path" ] && [ -n "$secondary_pattern" ]; then if [[ -n "${2:-}" || ! -s "$list_path" ]]; then
list_path="$(grep -Elr "$secondary_pattern" "$list_dir" 2>/dev/null | head -n 1)" IFS='|' read -r primary_pattern secondary_pattern <<< "$(get_repo_patterns "$list_format" "$ppa_url" "$package_dist" "$branches")"
list_path="$(grep_sources -El -e "$primary_pattern" 2>/dev/null | head -n 1)"
[ -n "$list_path" ] || return 1
fi fi
local status_token local rc=0
status_token="${ppa_url}|${package_dist}|${branches}" update_lists "$ppa" "$list_path" --on-missing-key retry_sury_update || rc=$?
update_lists "$ppa" "${list_path:-$primary_pattern}" "$status_token"
. /etc/os-release . /etc/os-release
return "$rc"
} }
# Variables # Variables
@@ -416,6 +619,10 @@ 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'
+15 -1
View File
@@ -7,6 +7,7 @@ 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.[7-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"
@@ -76,16 +77,27 @@ 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
@@ -95,6 +107,7 @@ read_env() {
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|nsc-runner)- ) ]] && check_builds_cache_runner; then
_runner=github _runner=github
# shellcheck disable=SC2034
builds_cache_warning=true builds_cache_warning=true
fi fi
fi fi
@@ -120,6 +133,7 @@ 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
} }