composer: Composer Install Exception with local repository
My composer.json
:
{
"name": "shopware/development",
"type": "project",
"license": "MIT",
"repositories": [
{
"type": "path",
"url": "custom/plugins/*",
"options": {
"symlink": true
}
},
{
"type": "path",
"url": "platform",
"options": {
"symlink": true
}
}
],
"config": {
"optimize-autoloader": true
},
"prefer-stable": true,
"minimum-stability": "dev",
"autoload": {
"psr-4": {
"Shopware\\Development\\": "src/"
}
},
"require": {
"php": "~7.2",
"ocramius/package-versions": "1.4.0",
"shopware/platform": "6.1.x@dev"
},
"scripts": {
"post-update-cmd": [
"[ ! -d platform ] || [ -L vendor/shopware/platform ] || (echo 'vendor/shopware/platform should be a symlink to platform'; exit 1)",
"[ ! -d vendor/shopware/platform/.git ] || ln -sf $PWD/dev-ops/pre-commit vendor/shopware/platform/.git/hooks/pre-commit"
]
},
"require-dev": {
"ext-tokenizer": "*",
"ext-xmlwriter": "*",
"bheller/images-generator": "1.0.1",
"fzaninotto/faker": "1.8.0",
"johnkary/phpunit-speedtrap": "3.1.0",
"league/flysystem-memory": "1.0.2",
"mbezhanov/faker-provider-collection": "1.2.1",
"phpunit/phpunit": "8.4.3",
"smalot/pdfparser": "0.14.0",
"symfony/browser-kit": "4.4.1",
"symfony/dependency-injection": "4.4.1",
"symfony/phpunit-bridge": "4.4.1",
"symfony/stopwatch": "4.4.1",
"symfony/var-dumper": "4.4.1",
"symfony/web-profiler-bundle": "4.4.1",
"symfony/dom-crawler": "4.4.1"
}
}
Output of composer diagnose
:
Checking composer.json: WARNING
require.ocramius/package-versions : exact version constraints (1.4.0) should be avoided if the package follows semantic versioning
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys: FAIL
Missing pubkey for tags verification
Missing pubkey for dev verification
Run composer self-update --update-keys to set them up
Checking composer version: OK
Composer version: 1.10.0
PHP version: 7.4.2
PHP binary path: /nix/store/k6gx6n6dajskpmwysi8d2mlgb5k2mp3f-php-7.4.2/bin/php
OpenSSL version: OpenSSL 1.1.1d 10 Sep 2019
When I run this command:
composer install
I get the following output:
Loading composer repositories with package information
[RuntimeException]
The `url` supplied for the path (custom/plugins/*) repository does not exist
And I expected this to happen: It works.
Reproduce: Clone this repo: https://github.com/shopware/development composer install
1.9.3 => works 1.10.0 => exception
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 12
- Comments: 31 (21 by maintainers)
Commits related to this issue
- Add empty directory in custom/plugins to workaround a bug in composer 1.10.0 See https://github.com/composer/composer/issues/8679 — committed to pickware/shopware-development by windaishi 4 years ago
- Add empty directory in custom/plugins to workaround a bug in composer 1.10.0 See https://github.com/composer/composer/issues/8679 — committed to pickware/shopware-development by windaishi 4 years ago
Released now as 1.10.1
Please confirm it works for you after
composer self-update --snapshot
We also use a path with asterisk (“packages/*”) where we put pacakges we need to change during development. That is quite handy as you don’t have to change code under vendor or possibly some other package install path.
The new behaviour is breaking this and actually not really checking what it tries to do. Because if I just create an empty folder “packages/dummy/” composer does not complain although there is still no composer package in the path. So this is as well a workaround for the new check…
I would like to get the old behaviour back, though.
1.10.0 broke our project builds as well. Our composer.jsons contain local paths (e.g.
"url": "/custom/plugins/*"
) that only exist in local development. In Jenkins (where we build the projects) those local paths don’t exist.We fixed this by removing all
"path"
repositories from composer.json in our Jenkins build script:If Composer will require that the local paths exist from now on, it would be nice to have a setting to be able to return to the previous, more lenient behavior, where local paths did not need to exist.
Or maybe the path existence check could be special-cased for any paths that contain wildcards, although that gets complicated/hacky real quick.
But
if (is_dir($url)) {..
will fail because we are developing in linux and have to deploy on Windows. So we can’t e.g. create the empty folder: '/home/userA/dev/bundle-abc` on Windows.“path-type”-repositories are the only way for us to develop a bundle (without pushing it to an package-repo) and still use
composer update/install
. Maybe we missed something and there is a better way. (I can imagine to have these kind of local-“dev”-configuration in an extra file let’s say composer-override.json)The
composer install
isn’t running anymore. It’s for me a breaking change. So all Travis builds are failing and maybe also in the customers deployments.