Skip to content

Commit

Permalink
Allow latest Composer if no lock file present
Browse files Browse the repository at this point in the history
We're bumping the plugin-api-version for the no lock file present case to allow Composer 2.8 which works with PHP 8.4 (to allow clean boots, and builds without deprecation errors).

This is a very inconsequential change for users that have no lock file, as no lock file means no package installs, plugins, etc.
  • Loading branch information
dzuelke committed Nov 22, 2024
1 parent 8f336f3 commit f5db191
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

- PHP/8.4.1 [David Zuelke]

### CHG

- Use latest Composer (instead of 2.2 LTS) if no lock file is present [David Zuelke]

## [v259] - 2024-11-21

### ADD
Expand Down
4 changes: 3 additions & 1 deletion bin/util/platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ function mkmetas($package, array &$metapaks, &$have_runtime_req = false) {
if($metapaks) $repositories[] = ["type" => "package", "package" => $metapaks];
} else {
// default to using Composer 2 if there is no lock file
$lock["plugin-api-version"] = "2.2.0";
// 2.6.0 will allow any current 2.x Composer version (see further below), which means 2.8 is possible
// that matters because the LTS Composer 2.2 (which we'd get if we used "2.2.0" here) throws countless deprecation warnings
$lock["plugin-api-version"] = "2.6.0";
}

// if no PHP is required anywhere, we need to add something
Expand Down
6 changes: 3 additions & 3 deletions test/spec/composer-2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
end
end
context "with only an index.php" do
it "builds using Composer 2.2" do
it "builds using Composer 2.3 or later" do
new_app_with_stack_and_platrepo('test/fixtures/default').deploy do |app|
expect(app.output).to match(/- composer \(2\.2\./)
expect(app.output).to match(/Composer version 2\.2\./)
expect(app.output).to match(/- composer \(2\.([3-9]|\d{2,})\./)
expect(app.output).to match(/Composer version 2\.([3-9]|\d{2,}\.)/)
end
end
end
Expand Down

0 comments on commit f5db191

Please sign in to comment.