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
composer update strips composer.lock of package without indication or reason #7268
Comments
|
The author of that package has since released a new version which takes care of my problem. I'm not sure if the problem remains reproducible if using the dev-master, but it certainly was a reproducible prior to this new release |
|
I have the exact same problem with: When running |
|
I believe to have similar issues. Since version 1.6.4 seemingly arbitrary packages are being removed when running |
|
Can confirm as well. This seems to be a serious regression. |
|
I can confirm this as well. Every second time composer 1.6.4 runs fine on our Symfony 3.4 project, but every other time a package (in our case it's gregwar/form-bundle) gets magically removed. |
|
Current snapshot version doesn't exhibit this error btw. So apparently it is already fixed in that branch and might "just" need a release. |
Due to composer/composer#7268 we use the snapshot version for now.
|
I can confirm the behavior presented by @kdambekalns . Temporary fix(These steps are for the people who already have some machines to deploy to and they don't want to go through the process of rolling back composer on every machine.)
|
|
Another way that can be used to downgrade for now: |
Workaround for composer/composer#7268
|
I think I have the same issue. Running Rolling back Composer from 1.6.4 to 1.6.3 solves the issue. |
|
Not sure, but could this be the cause ef7252b ? You can clone the composer repository, remove this package, and compile. And then see if it persists. |
|
I think I am another experiencing this issue with Composer 1.6.4 release. Every second call to But I was fortunate in the sense that I had a small project just starting, so I was able to isolate it to a single library. The issue describe here is repeatable (on macOS High Sierra and a Windows 8.1 VM). With the above, on Composer 1.6.4 the composer.lock file is deleted on every second call of the Not sure if this is an issue with composer or PHP Dotenv, but I hope this is helpful nonetheless. |
|
Same here, every other |
|
ef7252b is not part of the 1.6.4 release. It is only part of the nightly channel (the upcoming 1.7 version) |
Well, then something else (1.6.3...1.6.4) has caused the regression doesn't it?
It has been 12 days since the first initial report and different users from different projects reported a similar observation so it should be evident that something has caused a regression between 1.6.3 and 1.6.4 and it would be motivating to hear from some of the developers (@naderman @Seldaek @alcohol) involved if it is likely to be fixed soon. |
|
I can confirm @cameronterry 's scenario. Will investigate a bit further. Edit: Observations so far; It does not remove the dependency. This implies to me it is not a solving issue. The lockfile is completely removed. The installed.json is also completely empty. This is cause for concern. The former should never happen, not even if all dependencies are uninstalled (AFAIK), but might be an entirely different issue by itself. Using |
|
@cameronterry thanks for the simple repro case. @alcohol yeah I was pretty sure this was the culprit, just was on holidays the last couple days so wasn't able to dig in yet. I'll take a look now, hopefully I can find a way to fix this without reverting the commit entirely as I am pretty sure it was fixing some other oddball issues. |
|
Alright if y'all can verify that a |
|
Ran |
|
I can confirmed the issue appears to be resolved, @Seldaek. Thank you very much! |
|
v1.6.5 is out |
|
This works for me in: Generate your Bundle in your bin folder with
And follow the steps as always, now, do what you want in your composer.json file with the line Replace with Here's the new part:
|

Below is a fresh installation of Laravel 5.6 + 1 package that is causing a weird issue
My
composer.json:{ "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "type": "project", "require": { "php": "^7.1.3", "faustbrian/laravel-collectable": "dev-master", "fideloper/proxy": "^4.0", "laravel/framework": "5.6.*", "laravel/tinker": "^1.0" }, "require-dev": { "filp/whoops": "^2.0", "fzaninotto/faker": "^1.4", "mockery/mockery": "^1.0", "nunomaduro/collision": "^2.0", "phpunit/phpunit": "^7.0" }, "autoload": { "classmap": [ "database/seeds", "database/factories" ], "psr-4": { "App\\": "app/" } }, "autoload-dev": { "psr-4": { "Tests\\": "tests/" } }, "extra": { "laravel": { "dont-discover": [ ] } }, "scripts": { "post-root-package-install": [ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], "post-create-project-cmd": [ "@php artisan key:generate" ], "post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "@php artisan package:discover" ] }, "config": { "preferred-install": "dist", "sort-packages": true, "optimize-autoloader": true }, "minimum-stability": "dev", "prefer-stable": true }Output of
composer diagnose:When I run this command:
I get the following output:
Then if I run
I expect that the above cat / grep command will still return the same results, but instead composer update actually strips the composer.lock of the package, although it doesn't mention removing it, nor should it be removing it in any case
Composer install of this package faustbrian/laravel-collectable:dev-master correctly installs the package, but any subsequent composer update will strip composer.lock of the package, without giving any indication that it's done so or for any valid reason that I can see
The text was updated successfully, but these errors were encountered: