Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filter impossible packages from the pool (#9620)
Adds a new pass to the PoolOptimizer Co-authored-by: Jordi Boggiano <j.boggiano@seld.be>
- Loading branch information
Showing
4 changed files
with
115 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
tests/Composer/Test/DependencyResolver/Fixtures/poolbuilder/filter-impossible-packages.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--TEST-- | ||
Do not load packages into the pool that cannot meet the fixed/locked requirements, when a loose requirement is encountered during update | ||
|
||
--REQUEST-- | ||
{ | ||
"require": { | ||
"some/pkg": "*", | ||
"root/req": "*" | ||
}, | ||
"locked": [ | ||
{"name": "some/pkg", "version": "1.0.3", "require": {"dep/dep": "*"}, "id": 1}, | ||
{"name": "root/req", "version": "1.0.0", "require": {"dep/dep": "2.*"}, "id": 2}, | ||
{"name": "dep/dep", "version": "2.0.0", "id": 3} | ||
], | ||
"allowList": [ | ||
"some/pkg" | ||
], | ||
"allowTransitiveDeps": true | ||
} | ||
|
||
--FIXED-- | ||
[ | ||
] | ||
|
||
--PACKAGE-REPOS-- | ||
[ | ||
[ | ||
{"name": "some/pkg", "version": "1.0.4", "require": {"dep/dep": "*"}}, | ||
{"name": "root/req", "version": "1.0.0", "require": {"dep/dep": "2.*"}}, | ||
{"name": "dep/dep", "version": "1.0.0", "provide": {"other/pkg": "*"}}, | ||
{"name": "dep/dep", "version": "1.0.1", "provide": {"other/pkg": "*"}}, | ||
{"name": "dep/dep", "version": "1.0.2", "provide": {"other/pkg": "*"}}, | ||
{"name": "dep/dep", "version": "2.0.0"}, | ||
{"name": "dep/dep", "version": "2.0.1"} | ||
] | ||
] | ||
|
||
--EXPECT-- | ||
[ | ||
2, | ||
"some/pkg-1.0.4.0", | ||
"dep/dep-1.0.0.0", | ||
"dep/dep-1.0.1.0", | ||
"dep/dep-1.0.2.0", | ||
"dep/dep-2.0.0.0", | ||
"dep/dep-2.0.1.0" | ||
] | ||
|
||
--EXPECT-OPTIMIZED-- | ||
[ | ||
2, | ||
"some/pkg-1.0.4.0", | ||
"dep/dep-2.0.1.0" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters