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

Composer 2: update fails for repositories in Path #8766

Closed
moufmouf opened this issue Apr 10, 2020 · 4 comments
Closed

Composer 2: update fails for repositories in Path #8766

moufmouf opened this issue Apr 10, 2020 · 4 comments

Comments

@moufmouf
Copy link

I am trying to update my thecodingmachine/discovery Composer plugin to Composer 2.

I followed the steps in #8726

My composer.json:

{
  "minimum-stability": "dev",
  "repositories": [
    {
      "type": "path",
      "url": "fixtures/copy"
    },
    {
      "type": "path",
      "url": "fixtures/package_a"
    },
    {
      "type": "path",
      "url": "fixtures/package_b"
    }
  ],
  "require": {
    "thecodingmachine/discovery": "*",
    "package/b": "*"
  }
}

What I'm getting when I run composer update -vvv:

Reading composer-test.json

Loading config file composer-test.json

Checked CA file /etc/ssl/certs/ca-certificates.crt: valid

Executing command (/home/travis/build/thecodingmachine/discovery/tests): git branch --no-color --no-abbrev -v

Executing command (/home/travis/build/thecodingmachine/discovery/tests): git rev-list master..6cb3f17ae351edc9e267def283df2f2f31003848

Executing command (/home/travis/build/thecodingmachine/discovery/tests): git describe --exact-match --tags

Failed to initialize global composer: Composer could not find the config file: /home/travis/.config/composer/composer.json

To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section

Running 2.0-dev+40a35abb9423e16f8bafcb1ed1b7e027881b0422 (2020-04-10 10:24:43) with PHP 7.2.15 on Linux / 4.15.0-1028-gcp

Loading composer repositories with package information

Updating dependencies

Executing command (/home/travis/build/thecodingmachine/discovery/tests/fixtures/copy/): git log -n1 --pretty=%H

Executing command (/home/travis/build/thecodingmachine/discovery/tests/fixtures/copy/): git branch --no-color --no-abbrev -v

Executing command (/home/travis/build/thecodingmachine/discovery/tests/fixtures/copy/): git rev-list master..6cb3f17ae351edc9e267def283df2f2f31003848

Executing command (/home/travis/build/thecodingmachine/discovery/tests/fixtures/copy/): git describe --exact-match --tags

Executing command (/home/travis/build/thecodingmachine/discovery/tests/fixtures/package_a/): git branch --no-color --no-abbrev -v

Executing command (/home/travis/build/thecodingmachine/discovery/tests/fixtures/package_a/): git rev-list master..6cb3f17ae351edc9e267def283df2f2f31003848

Executing command (/home/travis/build/thecodingmachine/discovery/tests/fixtures/package_a/): git describe --exact-match --tags

Executing command (/home/travis/build/thecodingmachine/discovery/tests/fixtures/package_b/): git branch --no-color --no-abbrev -v

Executing command (/home/travis/build/thecodingmachine/discovery/tests/fixtures/package_b/): git rev-list master..6cb3f17ae351edc9e267def283df2f2f31003848

Executing command (/home/travis/build/thecodingmachine/discovery/tests/fixtures/package_b/): git describe --exact-match --tags

Downloading https://repo.packagist.org/packages.json

[200] https://repo.packagist.org/packages.json

Writing /home/travis/.cache/composer/repo/https---repo.packagist.org/packages.json into cache

Generating rules

Resolving dependencies through SAT

Looking at all rules.

Something's changed, looking at all rules again (pass #1)

Dependency resolution completed in 0.001 seconds

Analyzed 81 packages to resolve dependencies

Analyzed 90 rules to resolve dependencies

Lock file operations: 3 installs, 0 updates, 0 removals

Installs: thecodingmachine/discovery:dev-master, package/a:dev-master, package/b:dev-master

  - Locking package/a (dev-master)

  - Locking package/b (dev-master)

  - Locking thecodingmachine/discovery (dev-master)

Writing lock file

Installing dependencies from lock file (including require-dev)

Reading composer-test.lock

Package operations: 3 installs, 0 updates, 0 removals

Installs: thecodingmachine/discovery:dev-master, package/a:dev-master, package/b:dev-master

  - Installing thecodingmachine/discovery (dev-master): Symlinking from fixtures/copy

Loading plugin TheCodingMachine\Discovery\DiscoveryPlugin

    Install of thecodingmachine/discovery failed

  - Installing package/a (dev-master): Symlinking from fixtures/package_a

    Install of package/a failed

  - Marking package/a (9999999-dev) as installed, alias of package/a (dev-master)

  - Installing package/b (dev-master): Symlinking from fixtures/package_b

    Install of package/b failed

  - Marking package/b (9999999-dev) as installed, alias of package/b (dev-master)

  - Marking thecodingmachine/discovery (1.1.x-dev) as installed, alias of thecodingmachine/discovery (dev-master)

                                                                               

  [InvalidArgumentException]                                                   

  The "/home/travis/build/thecodingmachine/discovery/tests/vendor/composer/"   

  directory does not exist.                                                    

                                                                               

Exception trace:

 () at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/vendor/symfony/finder/Finder.php:657

 Symfony\Component\Finder\Finder->in() at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/src/Composer/Util/Filesystem.php:59

 Composer\Util\Filesystem->isDirEmpty() at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/src/Composer/Downloader/FileDownloader.php:242

 Composer\Downloader\FileDownloader->cleanup() at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/src/Composer/Downloader/DownloadManager.php:361

 Composer\Downloader\DownloadManager->cleanup() at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/src/Composer/Installer/LibraryInstaller.php:118

 Composer\Installer\LibraryInstaller->cleanup() at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/src/Composer/Installer/InstallationManager.php:240

 Composer\Installer\InstallationManager->Composer\Installer\{closure}() at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/src/Composer/Installer/InstallationManager.php:270

 Composer\Installer\InstallationManager->Composer\Installer\{closure}() at n/a:n/a

 call_user_func() at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/vendor/react/promise/src/React/Promise/Promise.php:49

 React\Promise\Promise->call() at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/vendor/react/promise/src/React/Promise/Promise.php:21

 React\Promise\Promise->__construct() at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/src/Composer/Installer/InstallationManager.php:278

 Composer\Installer\InstallationManager->execute() at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/src/Composer/Installer.php:677

 Composer\Installer->doInstall() at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/src/Composer/Installer.php:523

 Composer\Installer->doUpdate() at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/src/Composer/Installer.php:242

 Composer\Installer->run() at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/src/Composer/Command/UpdateCommand.php:180

 Composer\Command\UpdateCommand->execute() at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/vendor/symfony/console/Command/Command.php:245

 Symfony\Component\Console\Command\Command->run() at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/vendor/symfony/console/Application.php:835

 Symfony\Component\Console\Application->doRunCommand() at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/vendor/symfony/console/Application.php:185

 Symfony\Component\Console\Application->doRun() at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/src/Composer/Console/Application.php:287

 Composer\Console\Application->doRun() at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/vendor/symfony/console/Application.php:117

 Symfony\Component\Console\Application->run() at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/src/Composer/Console/Application.php:113

 Composer\Console\Application->run() at phar:///home/travis/.phpenv/versions/7.2.15/bin/composer/bin/composer:61

 require() at /home/travis/.phpenv/versions/7.2.15/bin/composer:25

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...

PR: thecodingmachine/discovery#10
Travis logs (see line 650): https://travis-ci.org/github/thecodingmachine/discovery/jobs/673474129

Thanks for your work on v2 :D

@stof
Copy link
Contributor

stof commented Apr 10, 2020

This seems the same than #8764

@stof
Copy link
Contributor

stof commented Apr 10, 2020

hmm, I see 2 things here:

  • Install of thecodingmachine/discovery failed makes me thing that something fails during the installation, which might indicate an issue with the path repositories (but the weird thing is that I haven't found yet where this message comes from exactly)
  • the final exception seems to be related to FileDownloader->cleanup() complaining that a folder does not exist. Given that the cleanup is now called for all packages on failure, it should be careful about not assuming success for all previous step (which might not even have started depending on when the failure happened).

@Seldaek
Copy link
Member

Seldaek commented Apr 13, 2020

Should work with latest snapshot, well the plugin install might still fail but at least you should see the real error.

@moufmouf
Copy link
Author

Actually, it works perfectly now!

Thanks @Seldaek and @stof for all your work!

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

No branches or pull requests

3 participants