Commit 910a5c5
committed
bug #865 Making conflict smarter: choose an older recipe to apply (weaverryan)
This PR was merged into the 1.x branch.
Discussion
----------
Making conflict smarter: choose an older recipe to apply
Hi!
Flex recipes support a `conflict` key - e.g. https://github.com/symfony/recipes/blob/ee79aec15811a380b09c53d058972c74e77e25d9/doctrine/doctrine-bundle/2.4/manifest.json#L48-L50
In this case, we added that so that we could use `when@dev` in the recipe, but that requires `symfony/framework-bundle` 5.3 or greater.
Anyways, the current `conflict` behavior is overly simple: if a recipe conflicts with a package you have installed, it simply skips the recipe entirely. This, for example, makes the following fail right now:
```
symfony new 4.4_app --version=4.4
cd 4.4_app
composer require doctrine
```
If you try this, the `doctrine/doctrine-bundle` will be skipped **entirely**.
This PR makes that behavior smarter. For each recipe that conflicts with your app (e.g. `doctrine/doctrine-bundle` 2.4 recipe), it will try the next oldest recipe version (e.g. `doctrine/doctrine-bundle` 2.3) until it finds one that does *not* conflict. So, you will always get the latest recipe version *without* any conflicts. If no compatible recipes are found, none would be installed (but I don't believe we have this situation anywhere anyways).
Tested locally on an app also.
Cheers!
Commits
-------
f921327 Making conflict smarter: choose an older recipe to apply3 files changed
+143
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
282 | 292 | | |
283 | 293 | | |
284 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
725 | 726 | | |
726 | 727 | | |
727 | 728 | | |
728 | | - | |
729 | | - | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
730 | 733 | | |
731 | | - | |
732 | | - | |
733 | | - | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
734 | 737 | | |
735 | | - | |
736 | | - | |
| 738 | + | |
737 | 739 | | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
738 | 744 | | |
739 | 745 | | |
740 | 746 | | |
| |||
991 | 997 | | |
992 | 998 | | |
993 | 999 | | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
994 | 1017 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
216 | 307 | | |
217 | 308 | | |
218 | 309 | | |
| |||
358 | 449 | | |
359 | 450 | | |
360 | 451 | | |
361 | | - | |
| 452 | + | |
362 | 453 | | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | 454 | | |
370 | 455 | | |
371 | 456 | | |
| |||
381 | 466 | | |
382 | 467 | | |
383 | 468 | | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
384 | 480 | | |
0 commit comments