1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00
Commit graph

94 commits

Author SHA1 Message Date
Nils Adermann
4215344c93 Rule generator cleanup: no need for 2 added package arrays, more specific root alias rule 2020-11-13 14:53:23 +01:00
Nils Adermann
9641ad6025 SolverProblemException: Hide learnt rules on output
Results in too much error output which is not helpful. Very repetitive
and hard to understand. In issue 8903 even leads to endless recursion
bug.
2020-10-21 14:08:12 +02:00
Nils Adermann
8a2bae82ab Improve docblocks on fixed/locked/fixedLocked packages in request
Also fixes two small code review issues
2020-10-14 11:46:13 +02:00
Nils Adermann
fdde9e5933 On composer install we fix locked packages, but consider them locked for error reporting 2020-10-14 11:46:13 +02:00
Nils Adermann
74fb313c39 Separate locked packages from fixed packages in request
Locked packages are basically like removable fixed packages, so we still
only load one version, but we do not require their installation unless
something the user needs requires their use. So they automatically get
removed if they are no longer needed on any update.
2020-10-14 11:46:13 +02:00
Simon Berger
33d7a64df9 Removed unused private functions 2020-09-20 02:16:28 +02:00
Simon Berger
a6475a7118 Removed unused variables, properties and parameters of private functions 2020-09-20 02:16:28 +02:00
Yanick Witschi
bd6f62c535 Consistently reuse the new PlatformRepository::isPlatformPackage() method 2020-09-01 17:19:19 +02:00
Jordi Boggiano
05dacbdabb
Rename DEV_MASTER_ALIAS to DEFAULT_BRANCH_ALIAS 2020-06-25 08:56:14 +02:00
Nils Adermann
edd2aa27db
Add missing isVerbose argument to problem formatting call 2020-06-19 23:31:11 +02:00
Jordi Boggiano
718021724c
Deduplicate more content in complex problem output 2020-06-02 15:46:12 +02:00
Jordi Boggiano
8a7f3a9a09
Avoid rendering problem output for dev-master aliases which is useless 2020-06-02 13:21:06 +02:00
Jordi Boggiano
5e5f9f8142
Remove unused RULE_INTERNAL_ALLOW_UPDATE 2020-06-02 11:22:35 +02:00
Jordi Boggiano
2ddf4346ef
Improve error reporting for RULE_PACKAGE_ALIAS 2020-06-02 10:35:04 +02:00
Jordi Boggiano
98e5f81a5f
Fix detection of fixed package problems to include more cases, fixes #8910 2020-05-19 12:17:25 +02:00
Jordi Boggiano
81bf47ffa2
Use fully qualified calls in hot classes 2020-04-30 21:28:05 +02:00
Jordi Boggiano
80a7c40c76
Shorten long lists of similar versions in problem output, fixes #8743 2020-04-15 16:47:44 +02:00
Markus Staab
c30925e68d
extracted VersionParser::DEV_MASTER_ALIAS (#8742) 2020-04-07 15:49:07 +02:00
Jordi Boggiano
8945936dbd
Deduplicate solver problems which list problems for dev-master AND 9999999-dev 2020-04-07 13:06:03 +02:00
Nils Adermann
80a5fdf398 Remove obsolete rules and their generation
The only automatic conflict we have results from packages using the same name
either by literally having the same name and being different versions or they
replace the same name, so

- removed all types of obsolete rules
- simplified rule generation significantly
- got rid of provide filtering in the pool
- fixed some language in error handling
2020-04-07 11:11:18 +02:00
Nils Adermann
4fab2c7759 Error wording use "thus cannot" instead of "can thus not" 2020-04-02 16:02:17 +02:00
Nils Adermann
9858718ef6 Give a clearer error message explaining how to update a conflicting locked dependency 2020-04-02 15:32:02 +02:00
Jordi Boggiano
189d5adab0
Fix reporting of replace conflicts to not mention provides 2020-01-30 17:13:12 +01:00
Jordi Boggiano
ec90c17e3b
Fix conflict order to be more accurate 2020-01-30 15:55:37 +01:00
Jordi Boggiano
c41df325d8
Remove RepositorySet from Solver and remove getPool from RepositorySet 2020-01-30 15:23:22 +01:00
Jordi Boggiano
1d4cdb60d0
Improve error reporting for conflicts/replaces of various kinds, fixes #7254 2020-01-30 14:43:56 +01:00
Jordi Boggiano
6c9d9e775c
Clean up and deduplicate the output of RULE_LEARNED 2020-01-30 14:43:56 +01:00
Jordi Boggiano
3fc7e10c5c
Improve error reporting of solver issues, refs #7779
Fixes #8525
Fixes #6513
2020-01-30 14:43:54 +01:00
Nils Adermann
5bdc0fc9c5 Request jobs replaced by root require / fixed package
The only type of request job remaining was "install" which is really a
root requirement. The only other kind of input for the solver is now a
set of fixed packages.

Rules have been updated to account for only two kinds of former job
reason: FIXED or ROOT_REQUIRE. The job property has always been
redundant and has been removed, since reasonData suffices.

Problem reasons are always rules, so the unnecessary wrapping in an
array has been removed.

We now only ever generate a single rule per root require or fixed
package, so there is no need for the solver to special handle disabling
"jobs" anymore, the rule can just be disabled as usual.

For consistency special handling of rules for jobs in problems has been
integrated into the rule class like all other rule reasons. As part of
this change the error message for root requirements has been improved a
bit to make it clearer where the package installation request came from.

The word job has also been removed from operations, which are called
operations, not jobs.
2020-01-19 23:21:07 +01:00
Yanick Witschi
d1dc367d86 Removed the filters from the pool 2019-11-27 17:57:24 +01:00
Nils Adermann
10ada7bf82 Refactor Installer class into separate install and update processes
- Introduce separate Lock and LocalRepo transactions, one for changes
  to the lock file, one for changes to locally installed packages based
  on lock file
- Remove various hacks to keep dev dependencies updated and
  incorporated the functionality into the transaction classes
- Remove installed repo, there are now local repo, locked repo and
  platform repo
- Remove access to local repo from solver, only supply locked packages
- Update can now be run to modify the lock file but not install packages
  to local repo
2019-02-11 01:00:02 +01:00
Nils Adermann
287419f6a0 Merge branch 'master' into 2.0
* master:
  Follow up to #7946 test: add solver flag to assert path execution
  Fix tests
  Make sure config command output is also output on --quiet so that warnings can be hidden, fixes #7963
  Recognize composer-plugin-api as a platform package, fixes #7951
  Quote wildcards to avoid issues in some shells, fixes #7960
  Avoid dumping null values for dist reference/shasum and source reference, fixes #7955
  Soften hard exit after revert of composer file
  Make unixy proxy code POSIX compatible
  Update aliases.md
  Same but for Problem.php
  Better error message for present but incompatible versions
  Fix inconsistent casing
  Don't do (new Foo())->bar() - not 5.3-compatible
  Support identifying the HHVM version when not running with HHVM
2019-02-10 20:28:24 +01:00
Fred Emmott
17788c76f6
Better error message for present but incompatible versions
hhvm-nightly (and next week's release) now report 4.x, so all the 3.x
constraints are now giving misleading error messages with this patch.

Before:

```
    - facebook/fbexpect v2.3.0 requires hhvm ^3.28 -> you are running this with PHP and not HHVM.
```

After:

```
    - facebook/fbexpect v2.3.0 requires hhvm ^3.28 -> your HHVM version (4.0.0-dev) does not satisfy that requirement.
```
2019-02-06 12:51:30 -08:00
Nils Adermann
5c491ecc9b
Merge pull request #7625 from naderman/repository-set
Separate RepositorySet from Package Pool, load only metadata of packages directly required
2018-09-12 14:22:01 +02:00
Nils Adermann
c0f19f6c57 Move construction of pool from repo set into a pool builder
Pool construction depends on the install request now, so only required
packages get loaded, add some structure for future asynchronously
loading composer repositories
2018-09-12 11:49:09 +02:00
Gabriel Caruso
71c8735e11 Use combined assignment operators 2018-09-10 14:24:41 +02:00
Markus Staab
05499099a0
Simplify Rule->getJob() 2018-07-18 20:50:46 +02:00
Gabriel Caruso
3d262bd637 Fixes from PHPStan level 0
More fixes from PHPStan level 0
2018-01-14 11:44:15 -02:00
Denis Brumann
2df1a69287 Improve IDE autocompletion
According to type 2nd constructor-argument `$reasonData` can either be a Link or a PackageInterface. IDEs like PhpStorm won't be able to provide autocompletion since both classes are from a different namespace.

In order to provide better autocompletion for `$reasonData` and by extension `$this->reasonData` the use statements should be included or the type hint should use the fully qualified class name.

For the same reason I added the docblock on the protected method `formatePackagesUnique()`.
2017-08-04 13:00:24 +02:00
rubenrua
4e1887a721 Improve memory usage resolving dependencies
It is known that composer update takes a lot of memory: #5915, #5902,

I am playing with a profiler (@blackfireio) to make a demo in my local
PHP meetup (@phpvigo) and I found out a way to use less memory. These
are my first tests:

* Private project using PHP 5.6:
  * Memory: from 1.31GB to 1.07GB
  * Wall Time: from 2min 8s to 1min 33s

* symfony-demo using PHP 7.1 in my old mac book:
  * Memory: from 667MB to 523MB
  * Wall Time: from  5min 29s to 5min 28s

Not use an array inside conflict rules is this improvement main idea:

```php
<?php
//Memory 38MB
gc_collect_cycles();
gc_disable();

class Rule
{
    public $literals;

    public function __construct(array $literals)
    {
        $this->literals = $literals;
    }
}

$rules = array();

$i = 0;
while ($i<80000){ //
    $i++;

    $array = array(-$i, $i);
    $rule = new Rule($array);
    $rules[] = $rule;
}
```

```php
<?php
//Memory 11.1MB
gc_collect_cycles();
gc_disable();

class Rule2Literals
{
    public $literal1;
    public $literal2;

    public function __construct($literal1, $literal2)
    {
        $this->literal1 = $literal1;
        $this->literal2 = $literal2;
    }
}

$rules = array();

$i = 0;
while ($i<80000){ //
    $i++;

    $rule = new ConflictRule(-$i, $i);
    $rules[] = $rule;
}
```

More info https://github.com/composer/composer/pull/6168
2017-02-20 18:52:17 +00:00
ReenExe
53fc30fe56 clear code 2016-05-17 13:34:54 +03:00
Lucas CHERIFI
7e34d9ab97 Typo fix ;-) 2016-05-10 21:45:39 +02:00
Jordi Boggiano
feda2a283f Improve error reporting some more, fixes #4310 2016-04-18 23:03:00 +01:00
Jordi Boggiano
c74e6df65d Fix strings being passed to an int arg, fixes 7.1 build 2016-04-01 11:52:19 +01:00
Jordi Boggiano
623c0dcda7 Improve solver error reporting, fixes #5086, fixes #2575, fixes #2661 2016-04-01 00:18:36 +01:00
Niels Keurentjes
ebfceefca6 Removed long deprecated functions that were no longer referenced anywhere. 2016-02-15 22:00:54 +01:00
Rob Bast
baabc612f6 adjust message, skip test
currently we have no way to put dynamic values or wildcards in EXPECT-OUTPUT
2016-02-05 13:21:30 +01:00
Rob Bast
94daeca57b add test and adjust rule error message 2016-02-05 11:59:05 +01:00
Wouter J
d0e4c5f71e Use "value" instead of "setting" 2015-12-19 12:15:01 +01:00
Wouter J
b156ad0345 Improve error message 2015-12-12 12:19:26 +01:00