You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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.
5 years ago
.github Add note about CS fixes to contribution notes 6 years ago
bin Add support for running composer with phpdbg (#7798) 6 years ago
doc Document --no-check-all better, fixes #7889 5 years ago
res Add support.chat to schema, refs #7714 6 years ago
src Fix solver problem exceptions with unexpected contradictory "Conclusions" 5 years ago
tests Fix solver problem exceptions with unexpected contradictory "Conclusions" 5 years ago
.gitattributes Exclude non-essential files from dist package 7 years ago
.gitignore Add PHPCSFixer config 9 years ago
.php_cs CS fixer 6 years ago
.travis.yml Fixes from PHPStan (#7687) 6 years ago
CHANGELOG.md Update changelog 5 years ago
LICENSE lets avoid silly commits in the future 8 years ago
PORTING_INFO Import initial partial port of the libzypp satsolver. 13 years ago
README.md Fix: Remove VersionEye badges 6 years ago
appveyor.yml Improve Appveyor caching and update PHP 6 years ago
composer.json Update target release for master 6 years ago
composer.lock Update xdebug-handler, fixes #7921 5 years ago
phpunit.xml.dist Stop running PEAR Repo test suite as it fails and is kinda irrelevant at this point 8 years ago

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