composer / satis

Simple static Composer repository generator - For a full private Composer repo use Private Packagist

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enabling "providers" breaks "replace" for packages from other repositories

Shira-3749 opened this issue · comments

Related to #367 (#371 has only fixed replacing within the same repository).

Repro steps

  1. create satis.json

    {
        "name": "acme/satis",
        "homepage": "http://localhost:8080/",
        "require-all": true,
        "repositories": [
            {
                "type": "package",
                "package": {
                    "name": "acme/phpunit",
                    "version": "7.5.8.0",
                    "dist": {
                        "type": "file",
                        "url": "https://phar.phpunit.de/phpunit-7.5.8.phar"
                    },
                    "replace": {
                        "phpunit/phpunit": "self.version"
                    }
                }
            }
        ]
    }
  2. run satis build

  3. create a test project with the following composer.json

    {
        "name": "acme/project",
        "repositories": [
            {"type":  "composer", "url": "http://localhost:8080/"}
        ],
        "require": {
            "kuria/phpunit-extras": "^2.0.3",
            "acme/phpunit": "^7.5"
        },
        "config": {
            "secure-http": false
        }
    }
  4. run composer update
    This works as expected. The acme/phpunit package is pulled instead of phpunit/phpunit, which is a dependency of kuria/phpunit-extras.

    Updating dependencies (including require-dev)
    Package operations: 3 installs, 0 updates, 0 removals
      - Installing kuria/iterable (v1.0.0): Downloading (100%)
      - Installing acme/phpunit (7.5.8.0): Downloading (100%)
      - Installing kuria/phpunit-extras (v2.0.3): Downloading (100%)
    Writing lock file
    Generating autoload files
    
  5. add "providers": true to satis.json

  6. build satis again

  7. delete composer.lock and vendor in the test project

  8. run composer update
    This fails with the following:

    Updating dependencies (including require-dev)
    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - Installation request for kuria/phpunit-extras ^2.0.3 -> satisfiable by kuria/phpunit-extras[v2.0.3].
        - kuria/phpunit-extras v2.0.3 requires phpunit/phpunit ^7.3.5 -> satisfiable by phpunit/phpunit[7.3.5, 7.4.0, 7.4.1, 7.4.2, 7.4.3, 7.4.4, 7.4.5, 7.5.0, 7.5.1, 7.5.2, 7.5.3, 7.5.4, 7.5.5, 7.5.6, 7.5.7, 7.5.8].
        - don't install acme/phpunit 7.5.8.0|don't install phpunit/phpunit 7.3.5
        - don't install acme/phpunit 7.5.8.0|don't install phpunit/phpunit 7.4.0
        - don't install acme/phpunit 7.5.8.0|don't install phpunit/phpunit 7.4.1
        - don't install acme/phpunit 7.5.8.0|don't install phpunit/phpunit 7.4.2
        - don't install acme/phpunit 7.5.8.0|don't install phpunit/phpunit 7.4.3
        - don't install acme/phpunit 7.5.8.0|don't install phpunit/phpunit 7.4.4
        - don't install acme/phpunit 7.5.8.0|don't install phpunit/phpunit 7.4.5
        - don't install acme/phpunit 7.5.8.0|don't install phpunit/phpunit 7.5.0
        - don't install acme/phpunit 7.5.8.0|don't install phpunit/phpunit 7.5.1
        - don't install acme/phpunit 7.5.8.0|don't install phpunit/phpunit 7.5.2
        - don't install acme/phpunit 7.5.8.0|don't install phpunit/phpunit 7.5.3
        - don't install acme/phpunit 7.5.8.0|don't install phpunit/phpunit 7.5.4
        - don't install acme/phpunit 7.5.8.0|don't install phpunit/phpunit 7.5.5
        - don't install acme/phpunit 7.5.8.0|don't install phpunit/phpunit 7.5.6
        - don't install acme/phpunit 7.5.8.0|don't install phpunit/phpunit 7.5.7
        - don't install acme/phpunit 7.5.8.0|don't install phpunit/phpunit 7.5.8
        - Installation request for acme/phpunit ^7.5 -> satisfiable by acme/phpunit[7.5.8.0]
    
commented

Possibly related to #529 ?