--prefer-dist 플래그에도 불구하고 작성기 종속성의 느린 업데이트
변경 사항이 없는데도 Composer 종속성이 업데이트되는 데 최대 2 분이 걸리는 이유는 무엇입니까?
인기 제안을 추가하는 것입니다 --prefer-dist
내 명령에 추가 한 플래그를 :
php composer.phar update --prefer-dist
그러나 이것은 차이가 없습니다. 아래는 내 composer.json 파일입니다. 명백한 것이 누락 되었습니까?
{
"name": "my-namespace/symfony",
"type": "project",
"description": "",
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.3.*",
"symfony/monolog-bundle": "2.3.*",
"sensio/framework-extra-bundle": "2.3.*",
"sensio/generator-bundle": "2.3.*",
"sensio/distribution-bundle": "2.2.*",
"my-namespace/my-bundle": "1.0.*"
},
"repositories": [
{
"type": "vcs",
"url": "http://username:password@git.com/my-bundle.git"
}
],
"scripts": {
"post-install-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "dev",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"branch-alias": {
"dev-master": "2.3-dev"
}
}
}
이 문제는 종종 CLI 환경에서로드되는 xdebug와 관련이 있습니다. (xdebug가 활성화되었는지 여부는 중요하지 않습니다.)
다음 명령 중 하나를 사용하여 xdebug가 활성화되었는지 확인할 수 있습니다.
// Unix
php -m | grep xdebug
// Windows
php -m | findstr xdebug
최대의 자세한 정보와 프로파일 링 정보를 사용하면 작업에 너무 오래 걸리는 작업에 대한 추가 정보를 얻을 수 있습니다. ( 패키지를 업데이트하는 경우 설치 를 업데이트로 대체하십시오 .)
composer install --prefer-dist -vvv --profile
Factors that can slow down Composer:
As pointed out,
xdebug
can affect the performance of Composer. Runningcomposer diagnose
will also warn you about this.Running
update
instead ofinstall
. People too often just runupdate
constantly. This makes Composer go through the entire dependency resolving process, regardless of whether or not anything has changed. When you runinstall
, Composer takes the requirements directly from your .lock file, skipping the dependency resolving process. You should only runupdate
during the development lifecycle of your application. And even then, it's not something you have to run daily usually.If you have a specific dependency that you update frequently yourself, you could try simplifying the process by running
composer update vendor/package --with-dependencies
instead.Setting
minimum-stability
todev
. This greatly expands the amount of possibilities that the dependency resolver has to consider. You should almost never lower theminimum-stability
todev
unless you absolutely have no other choice. Look into alternatives, such as temporarily using a inline@dev
flag.
Seems like the problem was resolved, but this might help someone.
Whenever I ran composer install or update, it took more than 10 seconds just to fetch the https://packagist.org/packages.json file. Eventually I found out that the problem was related to IPv6, since fetching files from IPv4 sites took less than a second.
The problem is that my ISP doesn't support IPv6, but I had it enabled in my ethernet properties. After I unticked Internet Protocol Version 6 (TCP/IPv6)
in my network settings, install/update speeds drastically improved (dropped from 200+ seconds to like 10)
I was having this issue while running Symfony2 on a VM that had low memory. I increased the machine's memory and it improved drastically. You may check the memory on your system and see if it can be upgraded.
You are using a private repository. This will not allow to download zipped version of the version you include, but must clone the repository. Additionally, it might be that the whole repository must be scanned to find the required version.
You should check whether using Satis is an option. That way you could prepare ZIPs of your own software and download it just like the things hosted on Github (which has an API for this that is used by Composer to allow downloading ZIPs even if they are not explicitly prepared).
Indeed, xdebug is certainly going to slow things down. Uninstalling xdebug is not ideal though. A good option is to use HHVM and put it on composer duty.
Installing HHVM is pretty painless, and HHVM itself is much more rapid than PHP5. It's a double-win -- YMMV, but I got near-5x speed increase (on the eyeball dyno admittedly) in the composer usage I'd get even if xdebug weren't in the picture.
If you are on OS X, then this link might help (blog article I wrote on the matter):
http://circlical.com/blog/2015/11/11/slow-composer-on-os-x
I had same issue with composer update
, I updated composer itself to the latest version using composer selfupdate
and now it's speed acceptable.
Check if zip
and unzip
are installed. If they are missing, Composer will clone the repo instead of downloading a zipped release.
I added precedence ::ffff:0:0/96 100 into /etc/gai.conf file and try your update.
'Development Tip' 카테고리의 다른 글
ggplot2에 대한 미학 테이블이나 카탈로그가 있습니까? (0) | 2020.11.30 |
---|---|
Jenkins가 작업을 실행하지 않음 (보류 중-다음 실행기를 기다리는 중) (0) | 2020.11.30 |
디스크에 쓰지 않고 AWS S3의 텍스트 파일을 Pandas로 가져 오는 방법 (0) | 2020.11.30 |
JQuery 아이콘 색상 지정 (재정의) 방법 (0) | 2020.11.30 |
약어에 대한 C # 명명 규칙 (0) | 2020.11.30 |