91 Commits (1211ba1d5177cf17a635fb8eb0f16db13fdf31a4)

Author SHA1 Message Date
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
5 years ago
Nils Adermann 29ff6a40ae Follow up to #7946 test: add solver flag to assert path execution 5 years ago
Nils Adermann 728e57b9e0 Merge branch 'master' into 2.0
* master:
  Fix solver problem exceptions with unexpected contradictory "Conclusions"
  Also load config into IO if not freshly created
  Only load configuration into IO if IO is available
  Fix defaultRepos fallback does not use auth config
  Add warning/info msg when tweaking disable-tls setting to avoid confusion, fixes #7935
5 years ago
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
Jordi Boggiano 2e0f31106a Merge remote-tracking branch 'origin/master' into 2.0 6 years ago
Gabriel Caruso 2a13bb2649 Fixes from PHPStan (#7687)
* fix docblocks

* remove redundant conditional

* fix wrong variable name

* fix wrong namespaces

* add missing private members

* remove unused/redundant arguments

* move testcase class

* exclude TestCase.php

* Tweak RuleWatchGraph type hints

* Tweak doc comment
6 years ago
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
6 years ago
Nils Adermann b6e2d60c9e Create the pool in the installer before giving it to the solver 6 years ago
Nils Adermann 1228bcdffc Internalize pool creation in repository set, store root aliases in set
The pool is still exposed too early in a few places which will require
further refactoring
6 years ago
Nils Adermann 6ef65e5319 Add a new RepositorySet class and restrict pool usage to the solver
Breaking change for the plugin interface so bumping the version of
composer-plugin-api to 2.0.0

First step for a refactoring of the package metadata loading mechanism
6 years ago
Gabriel Caruso a4b220273e Refactoring Tests (#6849) 7 years ago
Nils Adermann 7dffe79a0f Update tests of solver problem message to match new message 7 years ago
Jordi Boggiano 122e422682 CS fixes 7 years ago
Niels Keurentjes 8e78ce9a43 Add extra logging before and after SAT solving 8 years ago
Jefferson Carpenter b7845bb6c0 Update SolverTest.php 9 years ago
Rob Bast b523fc0b7b ran fixers 9 years ago
Jordi Boggiano ce08582671 Fix CS 9 years ago
Rob Bast a1427d7fd6 replace all occurences in code and comments 9 years ago
Possum 2e99b9fdf5 Use https where possible 9 years ago
Jordi Boggiano 94926218e8 CS fixes 10 years ago
Nils Adermann 5b80144ad0 Resolve job packages after whitelist generation 11 years ago
Nils Adermann 3148ffd355 Whitelist packages with names matching those specified before generating rules
Addresses #2690 doesn't do any performance optimisations yet which we
could do now
11 years ago
Jordi Boggiano 38917c2047 Add parallel build to travis script 11 years ago
Jordi Boggiano 051d219438 Fix whatProvides returning too many results when no constraint is given 11 years ago
Jordi Boggiano cc9dac8fe2 Fix tests and convert all package lists to Name[Versions] format 11 years ago
Robert Gruendler 5160dd2f5e Return different error code for SolverProblemsException
To make it easier for external tools to detect SolverProblems and react
to them accordingly,
this PR introduces a new exit code.
11 years ago
Jordi Boggiano 1c39ad779b Fix wording 12 years ago
Jordi Boggiano 5d78fa6ce6 Report typos in package name if no version matches 12 years ago
Jordi Boggiano beb9a5bd72 Code optimizations: avoid loops in match() 12 years ago
Jordi Boggiano fb4183d5ad Fix tests 12 years ago
Jordi Boggiano d4aab7d5b6 Fix solver test 12 years ago
Jordi Boggiano 6573fd3f77 Add hint in solver exceptions as to what may be wrong 12 years ago
Jordi Boggiano 175d1939b5 Fix tests 12 years ago
Jordi Boggiano 4fcc114f97 Merge pull request #808 from palex-fpt/not-equal-operator
Add '<>' operator to Version Parser
12 years ago
Nils Adermann cc7632489d Make problem report messages more readable
Added pretty strings to constraints
12 years ago
Alexey Prilipko e130386612 Add '<>' operator for Version Parser 12 years ago
Grégoire Pineau f4e9dd4fb8 Fixed PSR rules 12 years ago
Nils Adermann a08c2a0b9f Corrected altered error message in test 12 years ago
Nils Adermann 67fde90666 Correctly sort operations within transactions using DFS
Fixes #655
12 years ago
Nils Adermann a7f1605cdf Add test for correct sorting when force installing deps 12 years ago
Nils Adermann 26e051cb76 Decisions are now encapsulated in a separate object 12 years ago
Nils Adermann 0c1944a9d0 Let the solver handle aliases instead of the installer 12 years ago
Nils Adermann c37e126e14 Installed packages are now always removed unless otherwise requested
This means that an update request must always be accompanied by an install
request, otherwise the package might be removed rather than updated.
12 years ago
Jordi Boggiano f7440076fa Revert "Merge remote-tracking branch 'naderman/remove-packages-by-default'"
This reverts commit 2988152602, reversing
changes made to adb4188e12.
12 years ago
Nils Adermann 2cb2cde096 Installed packages are now always removed unless otherwise requested
This means that an update request must always be accompanied by an install
request, otherwise the package might be removed rather than updated.
12 years ago
Nils Adermann a16aa68c1d Rule literals are sorted, so first literal added is not first retrieved
Fixes #477
12 years ago
Nils Adermann 2c87fe5a22 Collect solver problems in Problem objects with human readable output. 12 years ago
Martin Hasoň 2b08df5192 Changed repository priority in the pool 13 years ago
Nils Adermann f3ff53b17c Create problems directly, rather than generating impossible rules 13 years ago
Nils Adermann dd443cd570 Complete circular dependency with alternatives through virtual packages test 13 years ago