webflo / drupal-core-strict

27 stars 7 forks source link

Update from Drupal 8.4.4 to 8.5.0 is not working for me #5

Open osopolar opened 6 years ago

osopolar commented 6 years ago

Am I doing something wrong? My composer.json file looks like:

{
    "name": "drupal/drupal",
    "description": "Drupal is an open source content management platform powering millions of websites and applications.",
    "type": "project",
    "license": "GPL-2.0+",
    "_readme": [
        "Use webflo/drupal-core-strict virtual package to ensure to get",
        "exactly the versions of Drupal core's dependencies as they are",
        "specified in Drupal core's composer.lock file"
    ],
    "require": {
        "drupal/core": "^8.5",
        "webflo/drupal-core-strict": "^8.5",
        "composer/installers": "^1.0.24",
        "wikimedia/composer-merge-plugin": "~1.4",
        "swiftmailer/swiftmailer": "^5.4",
        "html2text/html2text": "~4.0.1",
        "drupal-composer/drupal-scaffold": "dev-master",
        "tijsverkoyen/css-to-inline-styles": "^2.2"
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "config": {
        "preferred-install": "dist",
        "autoloader-suffix": "Drupal8"
    },
    "extra": {
        "_readme": [
            "By default Drupal loads the autoloader from ./vendor/autoload.php.",
            "To change the autoloader you can edit ./autoload.php.",
            "This file specifies the packages.drupal.org repository.",
            "You can read more about this composer repository at:",
            "https://www.drupal.org/node/2718229"
        ],
        "merge-plugin": {
            "include": [
                "core/composer.json"
            ],
            "recurse": false,
            "replace": false,
            "merge-extra": false
        },
        "installer-paths": {
            "core": ["type:drupal-core"],
            "modules/contrib/{$name}": ["type:drupal-module"],
            "profiles/contrib/{$name}": ["type:drupal-profile"],
            "themes/contrib/{$name}": ["type:drupal-theme"],
            "drush/contrib/{$name}": ["type:drupal-drush"],
            "modules/custom/{$name}": ["type:drupal-custom-module"],
            "themes/custom/{$name}": ["type:drupal-custom-theme"]
        }
    },
    "autoload": {
        "psr-4": {
            "Drupal\\Core\\Composer\\": "core/lib/Drupal/Core/Composer"
        }
    },
    "scripts": {
        "pre-autoload-dump": "Drupal\\Core\\Composer\\Composer::preAutoloadDump",
        "post-autoload-dump": [
          "Drupal\\Core\\Composer\\Composer::ensureHtaccess"
        ],
        "post-package-install": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup",
        "post-package-update": "Drupal\\Core\\Composer\\Composer::vendorTestCodeCleanup"
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    ]
}

I tried to update drupal core with the following commands:

but none of these works. I always get the following error:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - webflo/drupal-core-strict 8.6.x-dev requires symfony/class-loader v3.4.4 -> satisfiable by symfony/class-loader[v3.4.4] but these conflict with your requirements or minimum-stability.
    - webflo/drupal-core-strict 8.5.x-dev requires symfony/class-loader v3.4.4 -> satisfiable by symfony/class-loader[v3.4.4] but these conflict with your requirements or minimum-stability.
    - webflo/drupal-core-strict 8.5.0-rc1 requires symfony/class-loader v3.4.4 -> satisfiable by symfony/class-loader[v3.4.4] but these conflict with your requirements or minimum-stability.
    - webflo/drupal-core-strict 8.5.0-beta1 requires symfony/class-loader v3.4.4 -> satisfiable by symfony/class-loader[v3.4.4] but these conflict with your requirements or minimum-stability.
    - webflo/drupal-core-strict 8.5.0-alpha1 requires symfony/class-loader v3.4.3 -> satisfiable by symfony/class-loader[v3.4.3] but these conflict with your requirements or minimum-stability.
    - webflo/drupal-core-strict 8.5.0 requires symfony/class-loader v3.4.4 -> satisfiable by symfony/class-loader[v3.4.4] but these conflict with your requirements or minimum-stability.
    - Installation request for webflo/drupal-core-strict ^8.5 -> satisfiable by webflo/drupal-core-strict[8.5.0, 8.5.0-alpha1, 8.5.0-beta1, 8.5.0-rc1, 8.5.x-dev, 8.6.x-dev].

I also tried to change my composer.json file to:

    "drupal/core": "^8.5",
    "webflo/drupal-core-strict": "^8.5",

But it didn't work anyway. What did I miss?

jibran commented 6 years ago

Just try:

composer update --with-dependencies

with

    "drupal/core": "^8.5",
    "webflo/drupal-core-strict": "^8.5",
osopolar commented 6 years ago

Thanks jibran for helping me. I tried your suggestions but that didn't work nigher. Same problems as above.

osopolar commented 6 years ago

I changed the issue description to contain the complete composer.json file. The problem is caused by core/composer.json, at least when I remove that, the problem goes away:

        "merge-plugin": {
            "include": [
                "core/composer.json"
            ],
            "recurse": false,
            "replace": false,
            "merge-extra": false
        },

Can somebody explain me why? Is is save to not include core/composer.json while using webflo/drupal-core-strict? Drupal Composer doesn't contain that part neither, it uses webflo/drupal-core-require-dev.

After running composer update drupal/core webflo/drupal-core-strict --no-dev --with-dependencies (composer update --with-dependencies will also update the contrib modules what I want to do separately) I only got the following two warnings:

Dependency "composer/installers" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "wikimedia/composer-merge-plugin" is also a root requirement, but is not explicitly whitelisted. Ignoring.

These packages didn't get updated. I wondered why these packages got ignored, as webflo/drupal-core-strict requires a more specific version as the root composer.json file. I wouldn't have expected that behavior, but found an explanation in a different issue:

It only triggers for dependencies which are under the one package you try to update, but which are also required by the root package, because we do not allow automatic updating of transitive dependencies if they are required by the root, unless whitelisted as well for update, so the warning warns about this.

Anyway, I removed them from my composer.json and finally drupal got updated to 8.5.0.

chx commented 6 years ago
"webflo/drupal-core-strict": "^8.5",

this is strange

"webflo/drupal-core-strict": "8.5.0",

is what I would do but then again, I know nothing and that's exactly how much I want to know about the composer intricacies. This package keeps me sane (or, if you will, helps me retain whatever of that is left).

FatherShawn commented 6 years ago

I'm seeing a similar issue. I paired down the composer.json as minimally as possible. No composer.lock no /vendor directory:

{
  "name": "drupal-composer/drupal-project",
  "description": "Project template for Drupal 8 projects with composer",
  "type": "project",
  "license": "GPL-2.0+",
  "authors": [
    {
      "name": "",
      "role": ""
    }
  ],
  "repositories": [
    {
      "type": "composer",
      "url": "https://packages.drupal.org/8"
    },
    {
      "type": "composer",
      "url": "https://asset-packagist.org"
    },
    {
      "type": "composer",
      "url": "https://www.setasign.com/downloads/"
    }
  ],
  "require": {
    "composer/installers": "^1.2",
    "drupal/core": "^8.5.1",
    "oomphinc/composer-installers-extender": "^1.1",
    "webflo/drupal-core-strict":"^8.5.1"
  },
  "require-dev": {
    "webflo/drupal-core-require-dev": "^8.5"
  },
  "conflict": {
    "drupal/drupal": "*"
  },
  "minimum-stability": "dev",
  "prefer-stable": true,
  "config": {
    "sort-packages": true
  },
  "autoload": {
    "classmap": [
      "scripts/composer/ScriptHandler.php"
    ]
  },
  "scripts": {
    "drupal-scaffold": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold",
    "pre-install-cmd": [
      "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
    ],
    "pre-update-cmd": [
      "DrupalProject\\composer\\ScriptHandler::checkComposerVersion"
    ],
    "post-install-cmd": [
      "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
    ],
    "post-update-cmd": [
      "DrupalProject\\composer\\ScriptHandler::createRequiredFiles"
    ]
  },
  "extra": {
    "installer-types": [
      "bower-asset"
    ],
    "installer-paths": {
      "docroot/libraries/masonry": [
        "bower-asset/masonry"
      ],
      "docroot/libraries/imagesloaded": [
        "bower-asset/imagesloaded"
      ],
      "docroot/libraries/dropzone": [
        "bower-asset/dropzone"
      ],
      "docroot/core": [
        "type:drupal-core"
      ],
      "docroot/libraries/{$name}": [
        "type:drupal-library"
      ],
      "docroot/modules/contrib/{$name}": [
        "type:drupal-module"
      ],
      "docroot/profiles/contrib/{$name}": [
        "type:drupal-profile"
      ],
      "docroot/themes/contrib/{$name}": [
        "type:drupal-theme"
      ],
      "drush/contrib/{$name}": [
        "type:drupal-drush"
      ],
      "docroot/themes/custom/hols/libraries/{$name}": [
        "type:bower-asset"
      ]
    }
  }
}

Results in:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - webflo/drupal-core-strict 8.5.1 requires symfony/debug v3.4.4 -> satisfiable by symfony/debug[v3.4.4].
    - webflo/drupal-core-strict 8.5.x-dev requires symfony/debug v3.4.4 -> satisfiable by symfony/debug[v3.4.4].
    - webflo/drupal-core-strict 8.6.x-dev requires symfony/debug v3.4.4 -> satisfiable by symfony/debug[v3.4.4].
    - Conclusion: don't install symfony/debug v3.4.4
    - Installation request for webflo/drupal-core-strict ^8.5.1 -> satisfiable by webflo/drupal-core-strict[8.5.1, 8.5.x-dev, 8.6.x-dev].
FatherShawn commented 6 years ago

removing webflo/drupal-core-strict in my full site composer.json allows composer to proceed.

zahardev commented 6 years ago

Encountered the same error - "Your requirements could not be resolved to an installable set of packages." What worked for me was removing vendor folder.

webflo commented 6 years ago

It works best if you set the constraint to a specific version. Similar to @chx in https://github.com/webflo/drupal-core-strict/issues/5#issuecomment-376380464