Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibilty with Composer 2.0 #184

Closed
tobias-kuendig opened this issue Apr 8, 2020 · 83 comments
Closed

Compatibilty with Composer 2.0 #184

tobias-kuendig opened this issue Apr 8, 2020 · 83 comments
Milestone

Comments

@tobias-kuendig
Copy link

tobias-kuendig commented Apr 8, 2020

If you've landed here looking for a version of the wikimedia/composer-merge-plugin compatible with Composer 2.0, please see #189 and help test!


It seems like composer 2.0 is right around the corner. Downloading https://getcomposer.org/composer.phar already gives you a 2.0 build.

Are there any plans to make this plugin compatible? It currently explicitly requires a v1 composer api to be present.

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

  Problem 1
    - Root composer.json requires wikimedia/composer-merge-plugin 1.4.1 -> satisfiable by wikimedia/composer-merge-plugin[v1.4.1].
    - wikimedia/composer-merge-plugin v1.4.1 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match your constraint.
@bd808
Copy link
Member

bd808 commented Apr 9, 2020

Yes.

@bd808 bd808 added this to the 1.5.0 milestone Apr 9, 2020
@bd808
Copy link
Member

bd808 commented Apr 9, 2020

@tobias-kuendig We really haven't done any testing beyond the things that composer test does in this repo to test the new ^2.0 api compatibility. If you have some more active way of testing things for your common use cases and could report on your findings here that would be greatly appreciated.

@LukeTowers
Copy link

Glad to hear it @bd808! @tobias-kuendig could you test this out in October by changing the dependency to wikimedia/composer-merge-plugin: dev-composer20 and ensuring that everything October uses still functions normally in a composer 2.0 environment?

@tobias-kuendig
Copy link
Author

tobias-kuendig commented Apr 10, 2020

Not quite there yet!

$ php composer.phar --version
Composer version 2.0-dev (2.0-dev+a7ad186c89a597239536586b6fd09ac5df154869) 2020-04-09 15:12:35

Using October's composer.json with a few October plugins installed locally so the merge-plugin has something to merge.

The following error is fixed by #182

  - Installing wikimedia/composer-merge-plugin (dev-composer20 7274d02): Extracting archive
PHP Fatal error:  Uncaught Error: Undefined class constant 'PRE_DEPENDENCIES_SOLVING' in <dir>/vendor/wikimedia/composer-merge-plugin/src/MergePlugin.php:159
Stack trace:
#0 phar://<dir>/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php(397): Wikimedia\Composer\MergePlugin::getSubscribedEvents()
#1 phar://<dir>/composer.phar/src/Composer/Plugin/PluginManager.php(305): Composer\EventDispatcher\EventDispatcher->addSubscriber(Object(Wikimedia\Composer\MergePlugin))
#2 phar://<dir>/composer.phar/src/Composer/Plugin/PluginManager.php(206): Composer\Plugin\PluginManager->addPlugin(Object(Wikimedia\Composer\MergePlugin))
#3 phar://<dir>/composer.phar/src/Composer/Installer/PluginInstaller.php(70): Composer\Plugin\PluginManager->registerPackage(Object(Composer\Package\CompletePackage), true)
#4 phar://<dir>/composer.phar/src/Composer/Installer/InstallationManager.php(299): Composer\Installer\Plugin in <dir>/vendor/wikimedia/composer-merge-plugin/src/MergePlugin.php on line 159

The installation of October's modules are failing now:

  - Installing october/backend (dev-master d0232da): Extracting archive
    Install of october/backend failed
  - Installing october/cms (dev-master 1a8e565): Extracting archive
    Install of october/cms failed
  - Installing october/system (dev-master 8204f6c): Extracting archive
    Install of october/system failed

// ...

                                                                                                       
  [RuntimeException]                                                                                    
  Expected empty path to extract october/backend-dev-master into but directory exists: modules/backend  
                                                                                                        

Exception trace:
 () at phar://<dir>/composer.phar/src/Composer/Downloader/ArchiveDownloader.php:43
 Composer\Downloader\ArchiveDownloader->install() at phar://<dir>/composer.phar/src/Composer/Downloader/DownloadManager.php:270
 Composer\Downloader\DownloadManager->install() at phar://<dir>/composer.phar/src/Composer/Installer/LibraryInstaller.php:230
 Composer\Installer\LibraryInstaller->installCode() at phar://<dir>/composer.phar/src/Composer/Installer/LibraryInstaller.php:134
 Composer\Installer\LibraryInstaller->install() at phar://<dir>/composer.phar/src/Composer/Installer/InstallationManager.php:299
 Composer\Installer\InstallationManager->install() at phar://<dir>/composer.phar/src/Composer/Installer/InstallationManager.php:244
 Composer\Installer\InstallationManager->Composer\Installer\{closure}() at n/a:n/a
 call_user_func() at phar://<dir>/composer.phar/vendor/react/promise/src/React/Promise/FulfilledPromise.php:20
 React\Promise\FulfilledPromise->then() at phar://<dir>/composer.phar/vendor/react/promise/src/React/Promise/Deferred.php:34
 React\Promise\Deferred->then() at phar://<dir>/composer.phar/vendor/react/promise/src/React/Promise/Promise.php:26
 React\Promise\Promise->then() at phar://<dir>/composer.phar/src/Composer/Installer/InstallationManager.php:245
 Composer\Installer\InstallationManager->execute() at phar://<dir>/composer.phar/src/Composer/Installer.php:677
 Composer\Installer->doInstall() at phar://<dir>/composer.phar/src/Composer/Installer.php:523
 Composer\Installer->doUpdate() at phar://<dir>/composer.phar/src/Composer/Installer.php:242
 Composer\Installer->run() at phar://<dir>/composer.phar/src/Composer/Command/InstallCommand.php:119
 Composer\Command\InstallCommand->execute() at phar://<dir>/composer.phar/vendor/symfony/console/Command/Command.php:245
 Symfony\Component\Console\Command\Command->run() at phar://<dir>/composer.phar/vendor/symfony/console/Application.php:835
 Symfony\Component\Console\Application->doRunCommand() at phar://<dir>/composer.phar/vendor/symfony/console/Application.php:185
 Symfony\Component\Console\Application->doRun() at phar://<dir>/composer.phar/src/Composer/Console/Application.php:287
 Composer\Console\Application->doRun() at phar://<dir>/composer.phar/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar://<dir>/composer.phar/src/Composer/Console/Application.php:113
 Composer\Console\Application->run() at phar://<dir>/composer.phar/bin/composer:61
 require() at <dir>/composer.phar:25

Looks like the installation now fails if the target directory is not empty. This check was recently added:

composer/composer@7325169

I guess this not a problem that concerns the merge-plugin, though.

Removing the modules folder and running composer install again brings another error to light:

> init: Wikimedia\Composer\MergePlugin_composer_tmp0->onInit
  [merge-plugin] Loading plugins/october/demo/composer.json...
  [merge-plugin] Deferring duplicate php
  [merge-plugin] Merging composer/installers
  [merge-plugin] Loading plugins/offline/responsiveimages/composer.json...
  [merge-plugin] Deferring duplicate php
  [merge-plugin] Deferring duplicate composer/installers
  [merge-plugin] Merging psr/log
  [merge-plugin] Merging ext-dom
  [merge-plugin] Merging rosell-dk/webp-convert
Reading ./composer.lock
> pre-install-cmd: Wikimedia\Composer\MergePlugin_composer_tmp0->onInstallUpdateOrDump
  [merge-plugin] Already merged plugins/october/demo/composer.json completely
  [merge-plugin] Already merged plugins/offline/responsiveimages/composer.json completely
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Reading ./composer.lock
Generating rules
Resolving dependencies through SAT
Looking at all rules.

Dependency resolution completed in 0.001 seconds
> pre-operations-exec: Wikimedia\Composer\MergePlugin_composer_tmp0->onDependencySolve
PHP Fatal error:  Uncaught Error: Call to undefined method Composer\Installer\InstallerEvent::getRequest() in phar://<dir>/composer.phar/src/Composer/Plugin/PluginManager.php(195) : eval()'d code:302
Stack trace:
#0 [internal function]: Wikimedia\Composer\MergePlugin_composer_tmp0->onDependencySolve(Object(Composer\Installer\InstallerEvent))
#1 phar://<dir>/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php(164): call_user_func(Array, Object(Composer\Installer\InstallerEvent))
#2 phar://<dir>/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php(132): Composer\EventDispatcher\EventDispatcher->doDispatch(Object(Composer\Installer\InstallerEvent))
#3 phar://<dir>/composer.phar/src/Composer/Installer.php(638): Composer\EventDispatcher\EventDispatcher->dispatchInstallerEvent('pre-operations-...', true, true, Object(Composer\DependencyResolver\LocalRepoTransaction))
#4 phar://<dir>/composer.phar/src/Composer in phar://<dir>/composer.phar/src/Composer/Plugin/PluginManager.php(195) : eval()'d code on line 302

Fatal error: Uncaught Error: Call to undefined method Composer\Installer\InstallerEvent::getRequest() in phar://<dir>/composer.phar/src/Composer/Plugin/PluginManager.php(195) : eval()'d code:302
Stack trace:
#0 [internal function]: Wikimedia\Composer\MergePlugin_composer_tmp0->onDependencySolve(Object(Composer\Installer\InstallerEvent))
#1 phar://<dir>/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php(164): call_user_func(Array, Object(Composer\Installer\InstallerEvent))
#2 phar://<dir>/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php(132): Composer\EventDispatcher\EventDispatcher->doDispatch(Object(Composer\Installer\InstallerEvent))
#3 phar://<dir>/composer.phar/src/Composer/Installer.php(638): Composer\EventDispatcher\EventDispatcher->dispatchInstallerEvent('pre-operations-...', true, true, Object(Composer\DependencyResolver\LocalRepoTransaction))
#4 phar://<dir>/composer.phar/src/Composer in phar://<dir>/composer.phar/src/Composer/Plugin/PluginManager.php(195) : eval()'d code on line 302

The required request property (and the getRequest method) are no longer available:
composer/composer@d52ce3c#diff-97f8c7e9c3a659cc5e166734b7ab8987

This was too deep into the Composer internals for me to provide a quick fix!

@reedy
Copy link
Member

reedy commented Apr 15, 2020

It seems like composer 2.0 is right around the corner. Downloading https://getcomposer.org/composer.phar already gives you a 2.0 build.

It should be noted that's "latest snapshot" not "latest stable" ;)

@dereuromark
Copy link

We hit the same issue trying out this branch:

Fatal error: Uncaught Error: Undefined class constant 'PRE_DEPENDENCIES_SOLVING' in vendor/wikimedia/composer-merge-plugin/src/MergePlugin.php:159

@reedy
Copy link
Member

reedy commented Jun 4, 2020

We hit the same issue trying out this branch:

Fatal error: Uncaught Error: Undefined class constant 'PRE_DEPENDENCIES_SOLVING' in vendor/wikimedia/composer-merge-plugin/src/MergePlugin.php:159

Using what versions?

https://github.com/wikimedia/composer-merge-plugin/blob/composer20/src/MergePlugin.php#L154-L160

PRE_OPERATIONS_EXEC is new in 2.0, so it sounds like it isn't found in your version, hence falling back to the 1.0 constant which doesn't exist in 2.0...

@dereuromark
Copy link

dereuromark commented Jun 4, 2020

The dev-composer20 branch here together with composer 2.0.0-alpha1

@dereuromark
Copy link

Maybe it should be

    $installerStartEvent = '';
    if (defined('InstallerEvents::PRE_OPERATIONS_EXEC')) {
        // composer-plugin-api ^2.0
        $installerStartEvent = InstallerEvents::PRE_OPERATIONS_EXEC;
    } elseif (defined('InstallerEvents::PRE_DEPENDENCIES_SOLVING')) {
        // composer-plugin-api ^1.0
        $installerStartEvent = InstallerEvents::PRE_DEPENDENCIES_SOLVING;
    }

@dereuromark
Copy link

@tobias-kuendig Your PR works fine, thank you
I added up my recommended change in #187 for us to merge, if that is OK with you.

@dereuromark
Copy link

dereuromark commented Jun 9, 2020

It only fixes the constant issue, though
We still also run into

PHP Fatal error: Uncaught Error: Call to undefined method Composer\Installer\InstallerEvent::getRequest() in /project/vendor/wikimedia/composer-merge-plugin/src/MergePlugin.php:302

The Installer Event methods are only:

array(11) {
  [0]=>
  string(11) "__construct"
  [1]=>
  string(11) "getComposer"
  [2]=>
  string(5) "getIO"
  [3]=>
  string(9) "isDevMode"
  [4]=>
  string(21) "isExecutingOperations"
  [5]=>
  string(14) "getTransaction"
  [6]=>
  string(7) "getName"
  [7]=>
  string(12) "getArguments"
  [8]=>
  string(8) "getFlags"
  [9]=>
  string(20) "isPropagationStopped"
  [10]=>
  string(15) "stopPropagation"
}

@lucasvdh
Copy link

Latest stable version of Composer is now officially 2.0 and I'm still encountering issues, even with the composer20 version.

Fatal error: Uncaught Error: Undefined class constant 'PRE_DEPENDENCIES_SOLVING' in vendor/wikimedia/composer-merge-plugin/src/MergePlugin.php:159

What are the plans to fix this and can I do anything to help?

@mcaskill
Copy link
Contributor

@lucasvdh Can you try #189?

The composer20 branch has not been updated since March. The undefined PRE_DEPENDENCIES_SOLVING error requires #187 to fix a constant lookup. Even then, as noted previously, there is an additional error. This all has to do with the architectural differences between Composer v1 and v2.

That's where my PR comes in with an alternative to how extra packages are merged.

I've been spending quite a bit of time, in the last three months, researching Composer v2 and working on support for a few plugins.

micgro42 added a commit to wikimedia/mediawiki-extensions-Wikibase that referenced this issue Oct 26, 2020
The composer merge plugin doesn't yet work with composer 2.

See wikimedia/composer-merge-plugin#184
and https://phabricator.wikimedia.org/T248908

Bug: T266455
Change-Id: I6d78bdb05a518778c958a9b47b053b4e64f7e26d
wmfgerrit pushed a commit to wikimedia/mediawiki-extensions-Wikibase that referenced this issue Oct 26, 2020
The composer merge plugin doesn't yet work with composer 2.

See wikimedia/composer-merge-plugin#184
and https://phabricator.wikimedia.org/T248908

Bug: T266459
Change-Id: I6d78bdb05a518778c958a9b47b053b4e64f7e26d
wmfgerrit pushed a commit to wikimedia/mediawiki-extensions that referenced this issue Oct 26, 2020
* Update Wikibase from branch 'master'
  to 62ae43ef0fe1d916d4f3b824d3ab39e38ff517eb
  - Merge "Prevent Composer from updating to v2 in Travis CI"
  - Prevent Composer from updating to v2 in Travis CI
    
    The composer merge plugin doesn't yet work with composer 2.
    
    See wikimedia/composer-merge-plugin#184
    and https://phabricator.wikimedia.org/T248908
    
    Bug: T266459
    Change-Id: I6d78bdb05a518778c958a9b47b053b4e64f7e26d
wiese added a commit to wiese/dot-files that referenced this issue Oct 26, 2020
I don't "need" v2 at the moment, but have reasons to stick to v1 for
now: wikimedia/composer-merge-plugin#184
@rentalhost
Copy link

Please, keep working on this issue. I need it to my project works fine on C2.

@mlocati
Copy link

mlocati commented Oct 27, 2020

I need it to my project works fine on C2.

You are not alone 😉: a lot of projects use this composer-merge-plugin, and all of them are forced to use version 1 of composer.

@dereuromark
Copy link

Or remove it again :) As we did.

@mcaskill
Copy link
Contributor

mcaskill commented Feb 24, 2021

Support for Composer v2 has been finally resolved with the release of Merge Plugin v2.0.0. See #206 for details.

Thanks @tstarling

@smustgrave
Copy link

Do you know when a release will happen?

@mlocati
Copy link

mlocati commented Feb 24, 2021

Do you know when a release will happen?

@smustgrave We already have version 2.0.0 and 2.0.1 published - see https://packagist.org/packages/wikimedia/composer-merge-plugin

@mcaskill
Copy link
Contributor

Do you know when a release will happen?

@smustgrave I don't know when there will be GitHub Release description (/cc @tstarling) but the package is tagged as @mlocati and I pointed out.

@sjerdo
Copy link

sjerdo commented Feb 24, 2021

Thanks for the update for Composer 2 support!

README.md still contains references to 1.5.x or 1.5. These should be changed to 2.x and 2.0.0

Composer Merge Plugin 1.4.x (and older) requires Composer 1.x.
Composer Merge Plugin 1.5.x (and newer) is compatible with both Composer 2.x and 1.x.

If you are already using Composer Merge Plugin 1.4 (or older) and you are updating the plugin to 1.5 (or newer), it is recommended that you update the plugin first using Composer 1.

@reedy
Copy link
Member

reedy commented Feb 24, 2021

Both 1.5 references fixed.

https://github.com/wikimedia/composer-merge-plugin/releases/tag/v2.0.1 Github "release" created; though I'm not sure how many people actually use that for PHP libraries :)

I'll wait a little bit, but we can tag a 2.0.2 when there's been a bit more testing to bring in the minor README tweaks.

@reedy reedy closed this as completed Feb 24, 2021
wmfgerrit pushed a commit to wikimedia/mediawiki-extensions-Wikibase that referenced this issue Mar 1, 2021
The composer merge plugin doesn't yet work with composer 2.

See wikimedia/composer-merge-plugin#184
and https://phabricator.wikimedia.org/T248908

Bug: T266459
Change-Id: I6d78bdb05a518778c958a9b47b053b4e64f7e26d
(cherry picked from commit c542255)
wmfgerrit pushed a commit to wikimedia/mediawiki-extensions that referenced this issue Mar 1, 2021
* Update Wikibase from branch 'REL1_35'
  to 03aa0fc7d465d924721d48170de73263946d1bd6
  - Prevent Composer from updating to v2 in Travis CI
    
    The composer merge plugin doesn't yet work with composer 2.
    
    See wikimedia/composer-merge-plugin#184
    and https://phabricator.wikimedia.org/T248908
    
    Bug: T266459
    Change-Id: I6d78bdb05a518778c958a9b47b053b4e64f7e26d
    (cherry picked from commit c5422556ba1b3d18c5a17ad1aa8da26d6d745993)
@carloscarucce
Copy link

Still not fully compatible with composer 2?

@bd808 bd808 unpinned this issue Mar 24, 2021
@XedinUnknown
Copy link

@carloscarucce, why, what symptoms are you experiencing?

@carloscarucce
Copy link

@XedinUnknown by the time it hasn't loaded any of my subfolders composer.jsons. I downgraded my composer to v1 then it worked.

@schmunk42
Copy link

@XedinUnknown by the time it hasn't loaded any of my subfolders composer.jsons. I downgraded my composer to v1 then it worked.

I remember I had to run composer update 3 times when upgrading a project to composer 2 with this plugin.

@smustgrave
Copy link

I'm still getting errors using 2.0.1

from package repo (defining 1 package) has higher repository priority. The packages with higher priority do not match your constraint and are therefore not installable.

Seems whatever is in my merge-plugin include tops my main composer file.

@schmunk42
Copy link

@smustgrave
Copy link

I did. Tried all the settings. Can't resolve the conflict

@schmunk42
Copy link

Do you run a full update or just one package?

@smustgrave
Copy link

Full update. Just composer update

@smustgrave
Copy link

Here's my composer file if that helps. The conflict is coming from ckeditor/link. The file I'm including in the merge-plugin for webform also loads ckeditor/link but an older version. I would expect that my composer file would beat anything being merged or is that wrong?

{
"name": "drupal/recommended-project",
"description": "Project template for Drupal 8 projects with a relocated document root",
"type": "project",
"license": "GPL-2.0-or-later",
"homepage": "https://www.drupal.org/project/drupal",
"support": {
"docs": "https://www.drupal.org/docs/user_guide/en/index.html",
"chat": "https://www.drupal.org/node/314178"
},
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
},
{
"type": "package",
"package": {
"name": "jquery/jquery-ui-touch-punch",
"version": "0.2.3",
"dist": {
"url": "https://github.com/furf/jquery-ui-touch-punch/archive/master.zip",
"type": "zip"
},
"type": "drupal-library"
}
},
{
"type": "package",
"package": {
"name": "ckeditor/fakeobjects",
"version": "4.14.1",
"dist": {
"url": "https://download.ckeditor.com/fakeobjects/releases/fakeobjects_4.14.1.zip",
"type": "zip"
},
"type": "drupal-library"
}
},
{
"type": "package",
"package": {
"name": "ckeditor/iframe",
"version": "4.14.1",
"dist": {
"url": "https://download.ckeditor.com/iframe/releases/iframe_4.14.1.zip",
"type": "zip"
},
"type": "drupal-library"
}
},
{
"type": "package",
"package": {
"name": "ckeditor/link",
"version": "4.15.0",
"dist": {
"url": "https://download.ckeditor.com/link/releases/link_4.15.0.zip",
"type": "zip"
},
"type": "drupal-library"
},
"canonical": false
},
{
"type": "package",
"package": {
"name": "jackmoore/colorbox",
"version": "dev-master",
"dist": {
"url": "https://github.com/jackmoore/colorbox/archive/master.zip",
"type": "zip"
},
"type": "drupal-library"
}
}
],
"require": {
"ext-json": "",
"ckeditor/fakeobjects": "4.14.1",
"ckeditor/iframe": "4.14.1",
"ckeditor/link": "4.15.0",
"composer/installers": "^1.9",
"consolidation/robo": "^2.1",
"cweagans/composer-patches": "^1.6",
"drupal/address": "~1.0",
"drupal/admin_toolbar": "^3.0",
"drupal/anchor_link": "^2.4",
"drupal/autologout": "^1.3",
"drupal/better_exposed_filters": "^5.0@beta",
"drupal/block_class": "^1.2",
"drupal/block_content_revision_ui": "^2.127",
"drupal/block_content_template": "^1.4",
"drupal/block_title_link": "^1.1",
"drupal/block_visibility_groups": "1.x-dev",
"drupal/ckeditor_accordion": "^1.3",
"drupal/ckeditor_iframe": "^2.1",
"drupal/collapsiblock": "^3.0",
"drupal/colorbox": "^1.7",
"drupal/components": "^2.0@beta",
"drupal/config_ignore": "3.x-dev",
"drupal/config_split": "^2.0@beta",
"drupal/content_moderation_notifications": "^3.3",
"drupal/core-composer-scaffold": "^9.0.0",
"drupal/core-project-message": "^9",
"drupal/core-recommended": "^9.0.0@stable",
"drupal/devel_entity_updates": "^3.0",
"drupal/diff": "^1.0",
"drupal/easy_breadcrumb": "^1.13",
"drupal/entity_browser": "^2.5",
"drupal/entity_clone": "^1.0@beta",
"drupal/entity_embed": "^1.1",
"drupal/entity_reference_revisions": "^1.8",
"drupal/extlink": "^1.3",
"drupal/facets": "^1.6",
"drupal/feeds": "^3.0@alpha",
"drupal/feeds_ex": "^1.0@alpha",
"drupal/feeds_tamper": "^2.0@beta",
"drupal/field_group": "^3.1",
"drupal/formdazzle": "^2.1",
"drupal/google_analytics": "^3.1",
"drupal/google_tag": "^1.4",
"drupal/health_check": "^1.2",
"drupal/honeypot": "^2.0",
"drupal/inline_entity_form": "^1.0@rc",
"drupal/jquery_ui_accordion": "^1.1",
"drupal/jsonapi_resources": "1.x-dev",
"drupal/jsonapi_search_api": "^1.0@beta",
"drupal/lark": "^1.0@beta",
"drupal/layout_builder_modal": "^1.1",
"drupal/layout_builder_restrictions": "^2.7",
"drupal/layout_builder_styles": "^1.0@beta",
"drupal/link_field_autocomplete_filter": "^1.14",
"drupal/linkit": "^6.0@beta",
"drupal/mailsystem": "^4.3",
"drupal/media_entity_browser": "^2.0@alpha",
"drupal/menu_block": "^1.6",
"drupal/menu_item_extras": "^2.11",
"drupal/menu_link_attributes": "^1.2",
"drupal/modal_page": "^4.0",
"drupal/paragraphs": "^1.12",
"drupal/pathauto": "^1.8",
"drupal/phpmailer_smtp": "^2.0",
"drupal/publication_date": "2.x-dev@dev",
"drupal/purge": "^3.0",
"drupal/purge_queuer_url": "^1.0",
"drupal/rabbit_hole": "^1.0@beta",
"drupal/redirect": "^1.6",
"drupal/redirect_after_login": "^2.6",
"drupal/redis": "^1.4",
"drupal/samlauth": "3.0-alpha2",
"drupal/search_api": "^1.17",
"drupal/search_api_attachments": "^1.0@beta",
"drupal/search_api_exclude_entity": "^1.3",
"drupal/search_api_solr": "^4.1",
"drupal/simple_sitemap": "^3.7",
"drupal/slack": "^1.3",
"drupal/smart_trim": "^1.3",
"drupal/stage_file_proxy": "1.x-dev",
"drupal/svg_image": "^1.14",
"drupal/tamper": "^1.0@alpha",
"drupal/tooltip_taxonomy": "^1.5",
"drupal/twig_field_value": "^2.0",
"drupal/twig_tweak": "^3.0",
"drupal/uswds_base": "^2.10@alpha",
"drupal/views_conditional": "^1.2",
"drupal/views_field_view": "^1.0@beta",
"drupal/warmer": "^2.0",
"drupal/webform": "^6.0",
"drupal/webform_views": "^5.0@alpha",
"drush/drush": "^10.2",
"jackmoore/colorbox": "dev-master",
"jquery/jquery-ui-touch-punch": "0.2.3",
"predis/predis": "^1.1",
"wikimedia/composer-merge-plugin": "^2.0.0"
},
"require-dev": {
"drupal/core-dev": "^9.0.0",
"drupal/devel": "^3.0@dev",
"kint-php/kint": "^3.3",
"mglaman/drupal-check": "^1.1",
"php-parallel-lint/php-console-color": "^0.3.0",
"php-parallel-lint/php-console-highlighter": "^0.4.0",
"php-parallel-lint/php-parallel-lint": "^1.2"
},
"conflict": {
"drupal/drupal": "
"
},
"minimum-stability": "beta",
"prefer-stable": true,
"extra": {
"drupal-scaffold": {
"locations": {
"web-root": "wwwroot"
},
"file-mapping": {
"[web-root]/sites/development.services.yml": false
}
},
"installer-paths": {
"wwwroot/core": ["type:drupal-core"],
"wwwroot/libraries/{$name}": ["type:drupal-library"],
"wwwroot/modules/contrib/{$name}": ["type:drupal-module"],
"wwwroot/profiles/contrib/{$name}": ["type:drupal-profile"],
"wwwroot/themes/contrib/{$name}": ["type:drupal-theme"],
"drush/Commands/contrib/{$name}": ["type:drupal-drush"],
"wwwroot/modules/custom/{$name}": ["type:drupal-custom-module"],
"wwwroot/themes/custom/{$name}": ["type:drupal-custom-theme"]
},
"patches": {
"drupal/config_ignore": {
"3117694 - Config in active storage not ignored": "https://www.drupal.org/files/issues/2020-05-28/3117694-active-config-25.patch"
},
"drupal/search_api": {
"Better logging for Search API": "https://www.drupal.org/files/issues/2018-07-30/search-api-catch-exception-2686159-13.patch"
},
"drupal/feeds": {
"Check for null feeds before processing": "https://www.drupal.org/files/issues/2020-08-30/feeds-deleted-feed-type-3104727-7.patch"
},
"drupal/collapsiblock": {
"508 fix for jumping collapse links": "https://git.drupalcode.org/project/collapsiblock/-/merge_requests/2/diffs.diff"
},
"drupal/tooltip_taxonomy": {
"Load library on views": "patches/tooltip_taxonomy/tooltip_taxonomy-load-library-views.patch",
"508 fix for tooltip taxonomy": "patches/tooltip_taxonomy/tooltip_taxonomy-508-fixes.patch",
"Remove duplicate tooltips": "patches/tooltip_taxonomy/tooltip_taxonomy-remove-duplicate-tooltips.patch"
},
"drupal/uswds_base": {
"Changing li to span for 508 purposes": "https://git.drupalcode.org/project/uswds_base/-/merge_requests/1.diff"
},
"drupal/smart_trim": {
"Javascript appearing when HTML is being stripped": "https://git.drupalcode.org/project/smart_trim/-/merge_requests/7.diff"
},
"drupal/better_exposed_filters": {
"Add fieldset awareness to DateRange Picker": "patches/better_exposed_filters/bef-datepicker-beta1.patch"
},
"drupal/modal_page": {
"508 Issues: Lost focus and missing ARIA": "patches/modal_pages/modal_page-508-fixes.patch",
"Fix issues with modal not showing on multiple pages": "patches/modal_pages/modal_page-show-on-multiple-pages-fix.patch"
},
"drupal/paragraphs": {
"Integrity constraint violation: 1048 Column 'langcode' cannot be null": "https://www.drupal.org/files/issues/2021-03-01/2901390-76-integrity-constraint-violation-paragraph.patch"
},
"drupal/core": {
"Off-canvas style resets are overriding styles (especially SVGs) resulting in display issues": "https://www.drupal.org/files/issues/2021-01-06/off-canvas-style-resets-2958588-13.patch",
"[PP-1] Implement a generic revision UI": "https://www.drupal.org/files/issues/2021-03-24/2350939-164.patch",
"[PP-1] Use generic access API for node and media revision UI": "https://www.drupal.org/files/issues/2021-03-18/3043321-70.patch"
}
},
"merge-plugin": {
"include": [
"wwwroot/modules/contrib/webform/composer.libraries.json"
],
"recurse": false,
"replace": false,
"ignore-duplicates": true,
"merge-dev": true,
"merge-extra": false,
"merge-extra-deep": false,
"merge-scripts": false
}
},
"config": {
"platform": {
"php": "7.3",
"ext-gd": "1"
},
"sort-packages": true,
"vendor-dir": "vendor"
}
}

@reedy
Copy link
Member

reedy commented Apr 14, 2021

See https://github.com/wikimedia/composer-merge-plugin#replace, you have replace: false

@smustgrave
Copy link

Even setting replace: true didn't work. Still get the error.

@smustgrave
Copy link

And with both set I get this now
[merge-plugin] Both replace and ignore-duplicates are true. These are mutually exclusive.
[merge-plugin] Duplicate packages will be ignored.

Now if I add "canonical": false to the repo within the webform composer.libraries.json file it seems to work. But if that desirable? That all modules and libraries have to add this line now?

@LukeTowers
Copy link

@smustgrave if you have two different versions of the same package attempting to be loaded then yes, you will have composer complaining about it since the wrong version being loaded for one of those packages could cause the package to break. You should examine both requirements and if there really isn't a reason why they couldn't both use the same version of the dependency; then see if you can make the requirements looser on one composer.json or the other so you can make them use the same version of the dependency.

@smustgrave
Copy link

So with these Drupal sites we don't have a lot of control over other modules composer files. Ideally the main composer file should beat out the merged stuff. And the settings don't really seem to have any affect on it. Most likely going to have and downgrade composer or remove the merge-plugin. Until merge-plugin fully works with composer 2.

@LukeTowers
Copy link

@smustgrave what is the other module's composer file?

@reedy
Copy link
Member

reedy commented Apr 14, 2021

Can we move this to a new/seperate issue please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests