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
Have to run composer install twice to make custom installer paths work #6
Comments
It's probably worth noting, that the packages are using custom types, as defined in the
|
For reference, here's the theme's
And here's the plugin's
|
Hey Jeff! Thanks for providing all the details - I will try look into this soon. Could you also confirm what version of composer you're on? |
Composer version 1.2.0 2016-07-19 01:28:52 |
To further clarify, I did some additional tests. Starting out, the Also, just creating an empty Does this plugin just copy the package from the |
Hi Jeff - thanks for the additional information. I haven't had a chance to look into this yet but hopefully I will soon. The installer does not copy from It would also be helpful for me to know if you have an global plugins at play. If you could provide me the output from |
|
My first hunch has that there is another installer that is taking precedence over this plugin, but it appears you don't have any global plugins installed. Thanks for sending along the info regardless! |
It is very important for me to get this working correctly ASAP - so anything I can do, let me know! |
If the intended effect is had after running |
I suppose so... |
Another observation: Delete |
This probably is related to the order composer installs packages. Try adding oomphinc/composer-installers-extender to the required section of packages you are installing. This solved it in my case. |
I actually got composer/installers to merge my pull request to support Vanilla. So, I'm good now - though this is still a bug. |
I can confirm this issue: If the package composer.json requires oomphinc/composer-installers-extender everything works fine on first install. This is my working setup:
Main composer.json
Package fooVendorName/bar-legacy-userfunc is being installed to |
This fixed the issue for me (see Can we rename this issue to "Have to run composer install twice to make custom installer paths work" so it's more easily findable in the issue queue? And maybe make a note in the README as well? |
I'm having the same issue, putting this package in require doesn't help me. |
I have this problem as well! But I am not in control of the packages I'm requiring, so I can't add this to their required sections...not sure how to proceed with this. |
I have same problem and I want requiring 3rd party packages like |
Hi everyone - I apologize that we have not been able to address this any sooner! I've done some digging through the composer's source and I believe I have a working solution. TL;DR: move The explanation: In my testing, this issue is avoided by putting Consider these examples: Example 1
Example 2
Example 3
This seems to be a working fix - please try this approach and report back if it still does not work for you so I can continue troubleshooting. If it works consistently then I can update the readme to include this information. Ultimately a true fix lies within composer itself, and I'm going to take a look to see what can be done there. |
Thanks, @balbuf, for your detailed response! However, I'm sorry to have to report that the fix you suggested doesn't seem to be working for me. Here is my composer.json, with the irrelevant parts removed: {
"name": "acquia/lightning",
"description": "The best of Drupal, curated by Acquia",
"type": "drupal-profile",
"license": "GPL-2.0+",
"minimum-stability": "dev",
"prefer-stable": true,
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
}
],
"extra": {
"installer-types": ["library"],
"installer-paths": {
"docroot/core": [
"type:drupal-core"
],
"docroot/libraries/{$name}": [
"enyo/dropzone"
],
"docroot/profiles/lightning/modules/contrib/{$name}": [
"type:drupal-module"
]
}
},
"require": {
"cweagans/composer-patches": "^1.5.0",
"oomphinc/composer-installers-extender": "^1.0",
"drupal/core": "~8.3.1",
"drupal/embed": "^1.0",
"drupal/entity_embed": "1.0.0-beta2",
"drupal/media_entity": "^1.0",
"drupal/media_entity_instagram": "^1.0",
"drupal/media_entity_twitter": "^1.3",
"drupal/media_entity_image": "^1.0",
"drupal/ctools": "^3.0",
"drupal/panels": "^4.0",
"drupal/page_manager": "^4.0",
"drupal/panelizer": "^4.0",
"drupal/scheduled_updates": "1.0.0-alpha6",
"drupal/workbench_moderation": "1.2.0",
"drupal/acquia_connector": "^1.1",
"drupal/config_update": "^1.1",
"drupal/features": "^3.0",
"drupal/inline_entity_form": "^1.0",
"drupal/metatag": "^1.0",
"drupal/token": "^1.0",
"drupal-composer/drupal-scaffold": "^2.0.0",
"drupal/pathauto": "^1.0",
"drupal/entity_browser": "1.0.0",
"drupal/views_infinite_scroll": "^1.1",
"drupal/media_entity_document": "^1.0",
"drupal/video_embed_field": "^1.0",
"drupal/contact_storage": "^1.0",
"drupal/diff": "^1.0",
"drupal/entity_block": "1.0.0-alpha2",
"drupal/search_api": "^1.0",
"drupal/layout_plugin": "^1.0@alpha",
"enyo/dropzone": "^4.3"
},
} Have I missed something? (Hopefully :) But with this composer.json, enyo/dropzone is still installed in vendor/enyo/dropzone. |
I tested the I am mostly interested in this projects in correlation with https://asset-packagist.org. I tried with with the following adjustments (resulting json below):
Using this approach Dropzone ended up in However if I subsequently delete the {
"name": "acquia/lightning",
"description": "The best of Drupal, curated by Acquia",
"type": "drupal-profile",
"license": "GPL-2.0+",
"minimum-stability": "dev",
"prefer-stable": true,
"repositories": [
{
"type": "composer",
"url": "https://packages.drupal.org/8"
},
{
"type": "composer",
"url": "https://asset-packagist.org"
}
],
"extra": {
"installer-types": ["npm-asset"],
"installer-paths": {
"docroot/core": [
"type:drupal-core"
],
"docroot/libraries/{$name}": [
"type:npm-asset"
],
"docroot/profiles/lightning/modules/contrib/{$name}": [
"type:drupal-module"
]
}
},
"require": {
"cweagans/composer-patches": "^1.5.0",
"oomphinc/composer-installers-extender": "^1.0",
"drupal/core": "~8.3.1",
"drupal/embed": "^1.0",
"drupal/entity_embed": "1.0.0-beta2",
"drupal/media_entity": "^1.0",
"drupal/media_entity_instagram": "^1.0",
"drupal/media_entity_twitter": "^1.3",
"drupal/media_entity_image": "^1.0",
"drupal/ctools": "^3.0",
"drupal/panels": "^4.0",
"drupal/page_manager": "^4.0",
"drupal/panelizer": "^4.0",
"drupal/scheduled_updates": "1.0.0-alpha6",
"drupal/workbench_moderation": "1.2.0",
"drupal/acquia_connector": "^1.1",
"drupal/config_update": "^1.1",
"drupal/features": "^3.0",
"drupal/inline_entity_form": "^1.0",
"drupal/metatag": "^1.0",
"drupal/token": "^1.0",
"drupal-composer/drupal-scaffold": "^2.0.0",
"drupal/pathauto": "^1.0",
"drupal/entity_browser": "1.0.0",
"drupal/views_infinite_scroll": "^1.1",
"drupal/media_entity_document": "^1.0",
"drupal/video_embed_field": "^1.0",
"drupal/contact_storage": "^1.0",
"drupal/diff": "^1.0",
"drupal/entity_block": "1.0.0-alpha2",
"drupal/search_api": "^1.0",
"drupal/layout_plugin": "^1.0@alpha",
"npm-asset/dropzone": "^4"
}
} |
I started digging a bit more. As far as I can tell the situation is related to the specificity of version constraints. Expanding on the examples by @balbuf: Example 4 {
"name": "oomphinc/composer-test",
"require": {
"oomphinc/composer-installers-extender": "*",
"psr/log": "1.0.2"
},
"extra": {
"installer-types" : [ "library" ],
"installer-paths": {
"off-the-beaten-path/{$name}/": ["type:library"]
}
}
}
Example 5 {
"name": "oomphinc/composer-test",
"require": {
"oomphinc/composer-installers-extender": "*",
"psr/log": "^1.0"
},
"extra": {
"installer-types" : [ "library" ],
"installer-paths": {
"off-the-beaten-path/{$name}/": ["type:library"]
}
}
}
Example 6 {
"name": "oomphinc/composer-test",
"require": {
"oomphinc/composer-installers-extender": "1.1.2",
"psr/log": "1.0.2"
},
"extra": {
"installer-types" : [ "library" ],
"installer-paths": {
"off-the-beaten-path/{$name}/": ["type:library"]
}
}
}
|
I tried a few things and wanted to report on what has finally worked for me. As @kasperg said, tweaking the version constraints seems to have a positive effect. Here's my abbreviated composer.json, which installs things to the right place:
With this, |
I've done a little more testing and discovered that Composer really does seem to be utterly non-deterministic about installation order for anything (including this package) that has more listed dependencies than php and composer-plugin-api. I can make this work on my local machine, but on Travis CI, the exact same composer.json things in the wrong location ( I'm not sure this can be solved at all until composer/composer#6371 is merged. |
I really appreciate all the additional investigative work! It does appear that, arbitrarily, certain factors such as version specificity and composer.json order have influence on whether this issue manifests itself, but ultimately the install order cannot be reliably controlled in that way. Thus, that is not a viable workaround unfortunately. I'd like to see if we can get composer/composer#6371 merged as the preferred solution, as that would reliably fix the issue for this plugin and any others out there that have their own dependencies. Failing that, I would consider removing |
Thank you for your work! I have some idea: What about some response message back to the bash about moving these vendors, packages? Is it possible? |
I don't know what I am doing bad, but right now it not working at all. |
FYI: installing this plugin globally solves the issue as well. |
With following composer.json I can't make bootstrap-sass to install in a custom path. Am I missing something {
"name": "oomphinc/composer-test",
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
],
"require": {
"oomphinc/composer-installers-extender": "1.1.2",
"psr/log": "1.0.2",
"bower-asset/bootstrap-sass": "3.3.7"
},
"extra": {
"installer-types" : [ "library" ],
"installer-paths": {
"otherpath": ["bower-asset/bootstrap-sass"],
"thispath": ["psr/log"],
"morepaths": ["type:npm-asset"]
}
}
} It always get installed into vendor |
Forget about that last comment, my "installer-types" was missing npm-asset and bower-asset as explained in the about page for that repo |
Ok, thanks for the update @rodrigoaguilera ! |
That is a great point @Jelle-S. The issue here is that occasionally In the meantime, I am working with the composer folks to address the root issue there, and hopefully that can be worked out soon. |
Hi all! I just wanted to provide an update that the composer folks have accepted our pull request (composer/composer#6371) which fixes the issue detailed in this thread. This fix is slated to be part of the 1.5 version release of composer, but it is unclear when that will drop. In the meantime, you can use the update immediately by upgrading composer to the latest snapshot: composer self-update --snapshot This will upgrade composer to the latest snapshot of the master branch, which includes the fix for this issue. Be aware that this is not considered a stable release, so there could be bugs that haven't been worked out yet. However, it would be helpful to see if this fix works in all cases outlined above, so I encourage anyone willing to perform the upgrade and report whether this effectively resolves the issue. If you'd like to just test the fix and go back to your previous installed version of composer, you can do so with: composer self-update --rollback or you can update to the latest stable release: composer self-update --stable |
Hi, First |
Hi @maosmurf - did you try upgrading composer to the latest snapshot release ( |
Hi @balbuf - I can confirm that issue is solved in current composer snapshot (1.5-dev (189ba423aedc387a0487df40afc2428947406327) 2017-07-20 10:08:41) Package of type Thank you! |
Composer 1.5 is out now with the fix and I just confirmed that it still works for https://github.com/kurier/composer-bower-assets-order. Thanks for your work @balbuf. I guess we can close this issue now. 🎉 |
I am about to give up. I use this composer.json {
"name": "vendor/project",
"description": "tbd",
"type": "project",
"config": {
"preferred-install": "dist"
},
"license": "internal-only",
"repositories": [
{
"type": "composer",
"url": "https://www.phpmyadmin.net"
}
],
"require": {
"oomphinc/composer-installers-extender": "^1.1",
"phpmyadmin/phpmyadmin": "*"
},
"extra": {
"installer-types": ["application"],
"installer-paths": {
"phpmyadmin/": ["phpmyadmin/phpmyadmin"]
}
}
} and it doesn't work. If I use {
"name": "vendor/project",
"description": "test",
"type": "project",
"config": {
"preferred-install": "dist"
},
"license": "internal-only",
"authors": [
{
"name": "Christian Foellmann",
"email": "foellmann@foe-services.de"
}
],
"require": {
"oomphinc/composer-installers-extender": "^1.1",
"wp-cloud/phpmyadmin": "*"
},
"extra": {
"installer-types": ["application"],
"installer-paths": {
"phpmyadmin/": ["wp-cloud/phpmyadmin"]
}
}
} it works just fine. Any idea why I can't custom install the |
@cfoellmann I think that is a different issue than the one discussed here. I'd suggest opening up a separate issue for this :) |
@cfoellmann yes if you could open a new issue for this that would be great; I'm going to close this issue as there have been no new reports of the problem described herein since the release of Composer 1.5. |
I am still suffering this problem with Composer 1.7.3 (in Ubuntu 18.04). The
|
Hi @Nick-Hope, I opened a new issue and will respond there: #16. I am going to lock this conversation to avoid bothering folks on this thread. For anyone that comes across this issue and experiences something similar, please open a new issue! (Feel free to reference this issue if appropriate.) Thank you! |
I hope this is not something just on my end. For some reason or another, I have to run
composer install
twice, in order to get packages to go where they are assigned incomposer.json
. That is, it has to be run once initially, and then it appears each subsequent run works as expected.Also, after the initial
composer install
, all packages go to thevendor
directory.The text was updated successfully, but these errors were encountered: