1
0
Fork 0
Go to file
Nils Adermann 6b2edeae56 Fix solver problem exceptions with unexpected contradictory "Conclusions"
This 5 character fix comes with a solver test as well as a functional
installer test essentially verifying the same thing. The solver test is
more useful when working on the solver. But the functional test is less
likely to be accidentally modified incorrectly during refactoring, as
every single package, version and link in the rather complex test
scenario is essential, and a modified version of the test may very well
still result in a successful installation but no longer verify the bug
described below.

Background:

In commit 451bab1c2c from May 19, 2012 I
refactored literals from complex objects into pure integers to reduce
memory consumption. The absolute value of an integer literal is the id
of the package it refers to in the package pool. The sign indicates
whether the package should be installed (positive) or removed (negative),

So a major part of the refactoring was swapping this call:

$literal->getPackageId()

For this:

abs($literal)

Unintentionally in line 554/523 I incorrectly applied this change to the
line:

$this->literalFromId(-$literal->getPackageId());

It was converted to:

-abs($literal);

The function literalFromId used to create a new literal object. By using
the abs() function this change essentially forces the resulting literal
to be negative, while the minus sign previously inverted the literal, so
positive into negative and vice versa.

This particular line is in a function meant to analyze a conflicting
decision during dependency resolution and to draw a conclusion from it,
then revert the state of the solver to an earlier position, and attempt
to solve the rest of the rules again with this new "learned" conclusion.

Because of this bug these conclusions could only ever occur in the
negative, e.g. "don't install package X". This is by far the most likely
scenario when the solver reaches this particular line, but there are
exceptions.

If you experienced a solver problem description that contained a
statement like "Conclusion: don't install vendor/package 1.2.3" which
directly contradicted other statements listed as part of the problem,
this could likely have been the cause.
2019-02-03 16:33:55 +01:00
.github Add note about CS fixes to contribution notes 2018-11-26 13:43:24 +01:00
bin Add support for running composer with phpdbg (#7798) 2018-11-26 12:32:31 +01:00
doc Document --no-check-all better, fixes #7889 2019-01-28 16:17:46 +01:00
res Add support.chat to schema, refs #7714 2018-11-26 19:52:05 +01:00
src Fix solver problem exceptions with unexpected contradictory "Conclusions" 2019-02-03 16:33:55 +01:00
tests Fix solver problem exceptions with unexpected contradictory "Conclusions" 2019-02-03 16:33:55 +01:00
.gitattributes Exclude non-essential files from dist package 2017-12-09 22:20:45 -08:00
.gitignore Add PHPCSFixer config 2015-04-15 01:22:20 +01:00
.php_cs CS fixer 2018-07-24 14:32:52 +02:00
.travis.yml Fixes from PHPStan (#7687) 2018-11-12 15:23:32 +01:00
CHANGELOG.md Update changelog 2019-01-30 08:31:28 +01:00
LICENSE lets avoid silly commits in the future 2017-01-19 12:10:26 +01:00
PORTING_INFO Import initial partial port of the libzypp satsolver. 2011-04-05 17:37:19 +02:00
README.md Fix: Remove VersionEye badges 2018-06-24 18:53:36 +02:00
appveyor.yml Improve Appveyor caching and update PHP 2018-08-31 14:27:28 +01:00
composer.json Update target release for master 2018-08-16 16:58:19 +02:00
composer.lock Update xdebug-handler, fixes #7921 2019-01-28 20:52:02 +00:00
phpunit.xml.dist Stop running PEAR Repo test suite as it fails and is kinda irrelevant at this point 2016-02-25 13:10:46 +00:00

README.md

Composer - Dependency Management for PHP

Composer helps you declare, manage, and install dependencies of PHP projects.

See https://getcomposer.org/ for more information and documentation.

Build Status

Installation / Usage

Download and install Composer by following the official instructions.

For usage, see the documentation.

Packages

Find packages on Packagist.

Community

IRC channels are on irc.freenode.org: #composer for users and #composer-dev for development.

For support, Stack Overflow also offers a good collection of Composer related questions.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project and its community you agree to abide by those terms.

Requirements

PHP 5.3.2 or above (at least 5.3.4 recommended to avoid potential bugs)

Authors

See also the list of contributors who participated in this project.

Security Reports

Please send any sensitive issue to security@packagist.org. Thanks!

License

Composer is licensed under the MIT License - see the LICENSE file for details

Acknowledgments