From 28858688069e8864a0335a69b7e57bc4a5af5107 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 3 Apr 2025 16:26:28 +0200 Subject: [PATCH 01/11] Reverting release version changes --- src/Composer/Composer.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Composer/Composer.php b/src/Composer/Composer.php index 8831172dc9cb..07d6973334d4 100644 --- a/src/Composer/Composer.php +++ b/src/Composer/Composer.php @@ -51,10 +51,10 @@ class Composer extends PartialComposer * * @see getVersion() */ - public const VERSION = '2.8.7'; - public const BRANCH_ALIAS_VERSION = ''; - public const RELEASE_DATE = '2025-04-03 16:26:28'; - public const SOURCE_VERSION = ''; + public const VERSION = '@package_version@'; + public const BRANCH_ALIAS_VERSION = '@package_branch_alias_version@'; + public const RELEASE_DATE = '@release_date@'; + public const SOURCE_VERSION = '2.8.999-dev+source'; /** * Version number of the internal composer-runtime-api package From 5e890f0dc8334219844911bff79a1e26036ad2bb Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Thu, 3 Apr 2025 16:41:33 +0200 Subject: [PATCH 02/11] Fix release workflow --- .github/workflows/release.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e3e56167f5b7..ad20dd841715 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,8 +61,8 @@ jobs: uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1 with: body: TODO - name: ${{ github.ref }} - tag_name: ${{ github.ref }} + name: ${{ github.ref_name }} + tag_name: ${{ github.ref_name }} draft: true files: | composer.phar @@ -76,12 +76,10 @@ jobs: with: github-token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} script: | - // github.ref value looks like 'refs/tags/TAG', cleanup - const tag = "${{ github.ref }}".replace(/refs\/tags\//, ''); // create new issue on Docker repository github.rest.issues.create({ owner: "${{ github.repository_owner }}", repo: "docker", - title: `New Composer tag: ${ tag }`, - body: `https://github.com/${{ github.repository }}/releases/tag/${ tag }`, + title: `New Composer tag: ${{ github.ref_name }}`, + body: `https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }}`, }); From 96be561e51d5ecea4737ee536718b712c237bc64 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 4 Apr 2025 14:38:29 +0200 Subject: [PATCH 03/11] Fix support for various version schemes in the composer schema (#12367) Fixes #12364 --- res/composer-schema.json | 2 +- .../Composer/Test/Json/ComposerSchemaTest.php | 21 +++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/res/composer-schema.json b/res/composer-schema.json index fb84c2ab8931..fcbd818e9e84 100644 --- a/res/composer-schema.json +++ b/res/composer-schema.json @@ -28,7 +28,7 @@ "version": { "type": "string", "description": "Package version, see https://getcomposer.org/doc/04-schema.md#version for more info on valid schemes.", - "pattern": "^v?\\d+(\\.\\d+){0,3}(-(dev|(patch|p|alpha|a|beta|b|RC)\\d*))?$|^dev-.*$" + "pattern": "^v?\\d+(?:[.-]\\d+){0,3}[._-]?(?:(?:stable|beta|b|RC|rc|alpha|a|patch|pl|p)(?:(?:[.-]?\\d+)*+)?)?(?:[.-]?dev|\\.x-dev)?(?:\\+.*)?$|^dev-.*$" }, "default-branch": { "type": ["boolean"], diff --git a/tests/Composer/Test/Json/ComposerSchemaTest.php b/tests/Composer/Test/Json/ComposerSchemaTest.php index def2994452a9..90295667c52a 100644 --- a/tests/Composer/Test/Json/ComposerSchemaTest.php +++ b/tests/Composer/Test/Json/ComposerSchemaTest.php @@ -51,14 +51,27 @@ public function versionProvider(): array ['1.0.0-dev', true], ['1.0.0-alpha3', true], ['1.0.0-beta232', true], + ['10.4.13beta.2', true], + ['1.0.0.RC.15-dev', true], ['1.0.0-RC', true], ['v2.0.4-p', true], ['dev-master', true], ['0.2.5.4', true], + ['12345678-123456', true], + ['20100102-203040-p1', true], + ['2010-01-02.5', true], + ['0.2.5.4-rc.2', true], + ['dev-feature+issue-1', true], + ['1.0.0-alpha.3.1+foo/-bar', true], + ['00.01.03.04', true], + ['041.x-dev', true], + ['dev-foo bar', true], ['invalid', false], - ['1.0b', false], - ['1.0.0-', false], + ['1.0be', false], + ['1.0.0-meh', false], + ['feature-foo', false], + ['1.0 .2', false], ]; } @@ -74,11 +87,11 @@ public function testVersionPattern(string $version, bool $isValid): void self::assertEquals([ [ 'property' => 'version', - 'message' => 'Does not match the regex pattern ^v?\d+(\.\d+){0,3}(-(dev|(patch|p|alpha|a|beta|b|RC)\d*))?$|^dev-.*$', + 'message' => 'Does not match the regex pattern ^v?\\d+(?:[.-]\\d+){0,3}[._-]?(?:(?:stable|beta|b|RC|rc|alpha|a|patch|pl|p)(?:(?:[.-]?\\d+)*+)?)?(?:[.-]?dev|\\.x-dev)?(?:\\+.*)?$|^dev-.*$', 'constraint' => [ 'name' => 'pattern', 'params' => [ - 'pattern' => '^v?\d+(\.\d+){0,3}(-(dev|(patch|p|alpha|a|beta|b|RC)\d*))?$|^dev-.*$', + 'pattern' => '^v?\\d+(?:[.-]\\d+){0,3}[._-]?(?:(?:stable|beta|b|RC|rc|alpha|a|patch|pl|p)(?:(?:[.-]?\\d+)*+)?)?(?:[.-]?dev|\\.x-dev)?(?:\\+.*)?$|^dev-.*$', ] ], ], From 17d7a3b6a2128ebc8a7e99dfebfe98ddcf073d1e Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Fri, 4 Apr 2025 15:12:04 +0200 Subject: [PATCH 04/11] Add a CI job running with a 32bits build of PHP (#12366) * Add a CI job running with a 32bits build of PHP * Move to a run that only happens on main branch --------- Co-authored-by: Jordi Boggiano --- .github/workflows/php32bit.yml | 50 ++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/php32bit.yml diff --git a/.github/workflows/php32bit.yml b/.github/workflows/php32bit.yml new file mode 100644 index 000000000000..baf30c9c009b --- /dev/null +++ b/.github/workflows/php32bit.yml @@ -0,0 +1,50 @@ +name: "Continuous Integration (32bit)" + +on: + push: + branches: + - main + paths-ignore: + - 'doc/**' + +env: + COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist" + COMPOSER_UPDATE_FLAGS: "" + +permissions: + contents: read + +jobs: + tests: + name: "CI" + + runs-on: ubuntu-latest + container: shivammathur/node:latest-i386 + + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - uses: shivammathur/setup-php@9e72090525849c5e82e596468b86eb55e9cc5401 # 2.32.0 + with: + coverage: "none" + extensions: "intl, zip" + ini-values: "memory_limit=-1, phar.readonly=0, error_reporting=E_ALL, display_errors=On" + php-version: "8.4" + tools: composer + + - name: "Install dependencies from composer.lock using composer binary provided by system" + run: "composer install ${{ env.COMPOSER_FLAGS }}" + + - name: "Run install again using composer binary from source" + run: "bin/composer install ${{ env.COMPOSER_FLAGS }}" + + - name: "Make source binary the one used by default" + run: | + echo -e "$(pwd)/bin\n$(cat $GITHUB_PATH)" > $GITHUB_PATH + echo -e "COMPOSER_BINARY=$(pwd)/bin/composer" >> $GITHUB_ENV + + - name: "Prepare git environment" + run: "git config --global user.name composer && git config --global user.email composer@example.com" + + - name: "Run tests" + run: "vendor/bin/simple-phpunit --verbose" From 62e8d0e6a887c23042a5c19d9634d636b2e5eff4 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 4 Apr 2025 15:22:24 +0200 Subject: [PATCH 05/11] Bump deps, fixes #12365 --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 1847ba41038d..cbdcb9e2b3c2 100644 --- a/composer.lock +++ b/composer.lock @@ -532,16 +532,16 @@ }, { "name": "justinrainbow/json-schema", - "version": "6.4.0", + "version": "6.4.1", "source": { "type": "git", "url": "https://github.com/jsonrainbow/json-schema.git", - "reference": "16b274cb469bc8165c59b76c283724a035d27f4c" + "reference": "35d262c94959571e8736db1e5c9bc36ab94ae900" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/16b274cb469bc8165c59b76c283724a035d27f4c", - "reference": "16b274cb469bc8165c59b76c283724a035d27f4c", + "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/35d262c94959571e8736db1e5c9bc36ab94ae900", + "reference": "35d262c94959571e8736db1e5c9bc36ab94ae900", "shasum": "" }, "require": { @@ -601,9 +601,9 @@ ], "support": { "issues": "https://github.com/jsonrainbow/json-schema/issues", - "source": "https://github.com/jsonrainbow/json-schema/tree/6.4.0" + "source": "https://github.com/jsonrainbow/json-schema/tree/6.4.1" }, - "time": "2025-04-01T18:50:59+00:00" + "time": "2025-04-04T13:08:07+00:00" }, { "name": "marc-mabe/php-enum", From 4cf3df4a70d6f3dc1d643b3b4446026bd708c80e Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 4 Apr 2025 15:56:22 +0200 Subject: [PATCH 06/11] Fix some issues running tests on 32bit --- .github/workflows/php32bit.yml | 1 + phpunit.xml.dist | 2 +- tests/Composer/Test/InstallerTest.php | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/php32bit.yml b/.github/workflows/php32bit.yml index baf30c9c009b..5946d2807c17 100644 --- a/.github/workflows/php32bit.yml +++ b/.github/workflows/php32bit.yml @@ -42,6 +42,7 @@ jobs: run: | echo -e "$(pwd)/bin\n$(cat $GITHUB_PATH)" > $GITHUB_PATH echo -e "COMPOSER_BINARY=$(pwd)/bin/composer" >> $GITHUB_ENV + git config --global --add safe.directory $(pwd) - name: "Prepare git environment" run: "git config --global user.name composer && git config --global user.email composer@example.com" diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 0bf7ddfae209..1724e39017de 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -14,7 +14,7 @@ bootstrap="tests/bootstrap.php" > - + diff --git a/tests/Composer/Test/InstallerTest.php b/tests/Composer/Test/InstallerTest.php index 64a11cd4988f..3db9294d73cf 100644 --- a/tests/Composer/Test/InstallerTest.php +++ b/tests/Composer/Test/InstallerTest.php @@ -508,6 +508,10 @@ public static function loadIntegrationTests(string $path): array try { $testData = self::readTestFile($file, $fixturesDir); + // skip 64bit related tests on 32bit + if (str_contains($testData['EXPECT'], 'php-64bit') && PHP_INT_SIZE === 4) { + continue; + } $installed = []; $installedDev = []; From b26a4854dfc7b5efc31ff706a6336da5ec328776 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 4 Apr 2025 16:09:16 +0200 Subject: [PATCH 07/11] Fix issue formatting rdkafka on 32bit --- phpunit.xml.dist | 2 +- src/Composer/Repository/PlatformRepository.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 1724e39017de..0bf7ddfae209 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -14,7 +14,7 @@ bootstrap="tests/bootstrap.php" > - + diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php index f5a2eb5ace07..4c6024946b93 100644 --- a/src/Composer/Repository/PlatformRepository.php +++ b/src/Composer/Repository/PlatformRepository.php @@ -489,7 +489,7 @@ protected function initialize(): void * pre-release ID in practice is always 0xff even for RCs etc, so we ignore it */ $libRdKafkaVersionInt = $this->runtime->getConstant('RD_KAFKA_VERSION'); - $this->addLibrary($libraries, $name.'-librdkafka', sprintf('%d.%d.%d', ($libRdKafkaVersionInt & 0xFF000000) >> 24, ($libRdKafkaVersionInt & 0x00FF0000) >> 16, ($libRdKafkaVersionInt & 0x0000FF00) >> 8), 'librdkafka for '.$name); + $this->addLibrary($libraries, $name.'-librdkafka', sprintf('%d.%d.%d', ($libRdKafkaVersionInt & 0x7F000000) >> 24, ($libRdKafkaVersionInt & 0x00FF0000) >> 16, ($libRdKafkaVersionInt & 0x0000FF00) >> 8), 'librdkafka for '.$name); } break; From 0f99f6f287e1bd18f129ffb512c6433e141bec63 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 4 Apr 2025 16:25:34 +0200 Subject: [PATCH 08/11] Fix some more 32bit tests --- tests/Composer/Test/Downloader/XzDownloaderTest.php | 3 +++ tests/Composer/Test/InstallerTest.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/Composer/Test/Downloader/XzDownloaderTest.php b/tests/Composer/Test/Downloader/XzDownloaderTest.php index 1cabefb568f4..d461c48237f7 100644 --- a/tests/Composer/Test/Downloader/XzDownloaderTest.php +++ b/tests/Composer/Test/Downloader/XzDownloaderTest.php @@ -36,6 +36,9 @@ public function setUp(): void if (Platform::isWindows()) { $this->markTestSkipped('Skip test on Windows'); } + if (PHP_INT_SIZE === 4) { + $this->markTestSkipped('Skip test on 32bit'); + } $this->testDir = self::getUniqueTmpDirectory(); } diff --git a/tests/Composer/Test/InstallerTest.php b/tests/Composer/Test/InstallerTest.php index 3db9294d73cf..a7fca8e00efa 100644 --- a/tests/Composer/Test/InstallerTest.php +++ b/tests/Composer/Test/InstallerTest.php @@ -509,7 +509,7 @@ public static function loadIntegrationTests(string $path): array try { $testData = self::readTestFile($file, $fixturesDir); // skip 64bit related tests on 32bit - if (str_contains($testData['EXPECT'], 'php-64bit') && PHP_INT_SIZE === 4) { + if (str_contains($testData['EXPECT-OUTPUT'], 'php-64bit') && PHP_INT_SIZE === 4) { continue; } From 61dcc2cafccc79bb600e194caa7599885a74e9be Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 4 Apr 2025 16:31:29 +0200 Subject: [PATCH 09/11] Fix tests --- tests/Composer/Test/InstallerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Composer/Test/InstallerTest.php b/tests/Composer/Test/InstallerTest.php index a7fca8e00efa..7c8ae39986d5 100644 --- a/tests/Composer/Test/InstallerTest.php +++ b/tests/Composer/Test/InstallerTest.php @@ -509,7 +509,7 @@ public static function loadIntegrationTests(string $path): array try { $testData = self::readTestFile($file, $fixturesDir); // skip 64bit related tests on 32bit - if (str_contains($testData['EXPECT-OUTPUT'], 'php-64bit') && PHP_INT_SIZE === 4) { + if (str_contains($testData['EXPECT-OUTPUT'] ?? '', 'php-64bit') && PHP_INT_SIZE === 4) { continue; } From a0e90ea136c0569928fe0c78d3c07bc8585aca0c Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 4 Apr 2025 16:56:42 +0200 Subject: [PATCH 10/11] Update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed0154f359d1..4879452020db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +### [2.8.8] 2025-04-04 + + * Fixed json schema issues with version validation (#12367) + * Fixed issues running on 32bit machines (#12365) + ### [2.8.7] 2025-04-03 * Bumped justinrainbow/json-schema dependency to 6.x (#12348) @@ -2006,6 +2011,7 @@ * Initial release +[2.8.8]: https://github.com/composer/composer/compare/2.8.7...2.8.8 [2.8.7]: https://github.com/composer/composer/compare/2.8.6...2.8.7 [2.8.6]: https://github.com/composer/composer/compare/2.8.5...2.8.6 [2.8.5]: https://github.com/composer/composer/compare/2.8.4...2.8.5 From 85ff84d6c5260ba21740a7c5c9a111890805d6e7 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 4 Apr 2025 16:56:46 +0200 Subject: [PATCH 11/11] Release 2.8.8 --- src/Composer/Composer.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Composer/Composer.php b/src/Composer/Composer.php index 07d6973334d4..5aa3a24ab39e 100644 --- a/src/Composer/Composer.php +++ b/src/Composer/Composer.php @@ -51,10 +51,10 @@ class Composer extends PartialComposer * * @see getVersion() */ - public const VERSION = '@package_version@'; - public const BRANCH_ALIAS_VERSION = '@package_branch_alias_version@'; - public const RELEASE_DATE = '@release_date@'; - public const SOURCE_VERSION = '2.8.999-dev+source'; + public const VERSION = '2.8.8'; + public const BRANCH_ALIAS_VERSION = ''; + public const RELEASE_DATE = '2025-04-04 16:56:46'; + public const SOURCE_VERSION = ''; /** * Version number of the internal composer-runtime-api package