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 why-not produces LogicException (ProcessExecutor) similar to #10703 #10783

Closed
InvisibleSmiley opened this issue May 16, 2022 · 4 comments
Labels
Milestone

Comments

@InvisibleSmiley
Copy link

I have almost the same problem as described in #10703 but with Composer command "why-not".
Last known good: 2.2.9
Broken since: 2.3.0

My composer.json:

{
    "name": "foo/bar",
    "require": {
        "php": "^7.4"
    }
}

Output of composer diagnose:

Checking composer.json: WARNING
No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com oauth access: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: OK
Composer version: 2.3.5
PHP version: 7.4.29
PHP binary path: C:\php74\php.exe
OpenSSL version: OpenSSL 1.1.1n  15 Mar 2022
cURL version: 7.70.0 libz 1.2.12 ssl OpenSSL/1.1.1n
zip: extension present, unzip present, 7-Zip present (7z)

When I run this command:

composer why-not php 8.1

I get the following output:

In ProcessExecutor.php line 149:

  [LogicException]
  You must use the ProcessExecutor instance which is part of a Composer\Loop instance to be able to run async processes


Exception trace:
  at phar://C:/Users/me/bin/composer.phar/src/Composer/Util/ProcessExecutor.php:149
 Composer\Util\ProcessExecutor->executeAsync() at phar://C:/Users/me/bin/composer.phar/src/Composer/Package/Version/VersionGuesser.php:324
 Composer\Package\Version\VersionGuesser->guessFeatureVersion() at phar://C:/Users/me/bin/composer.phar/src/Composer/Package/Version/VersionGuesser.php:181
 Composer\Package\Version\VersionGuesser->guessGitVersion() at phar://C:/Users/me/bin/composer.phar/src/Composer/Package/Version/VersionGuesser.php:77
 Composer\Package\Version\VersionGuesser->guessVersion() at phar://C:/Users/me/bin/composer.phar/src/Composer/Repository/PathRepository.php:215
 Composer\Repository\PathRepository->initialize() at phar://C:/Users/me/bin/composer.phar/src/Composer/Repository/ArrayRepository.php:311
 Composer\Repository\ArrayRepository->getPackages() at phar://C:/Users/me/bin/composer.phar/src/Composer/Repository/ArrayRepository.php:109
 Composer\Repository\ArrayRepository->findPackage() at phar://C:/Users/me/bin/composer.phar/src/Composer/Repository/CompositeRepository.php:82
 Composer\Repository\CompositeRepository->findPackage() at phar://C:/Users/me/bin/composer.phar/src/Composer/Command/BaseDependencyCommand.php:84
 Composer\Command\BaseDependencyCommand->doExecute() at phar://C:/Users/me/bin/composer.phar/src/Composer/Command/ProhibitsCommand.php:56
 Composer\Command\ProhibitsCommand->execute() at phar://C:/Users/me/bin/composer.phar/vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at phar://C:/Users/me/bin/composer.phar/vendor/symfony/console/Application.php:1015
 Symfony\Component\Console\Application->doRunCommand() at phar://C:/Users/me/bin/composer.phar/vendor/symfony/console/Application.php:299
 Symfony\Component\Console\Application->doRun() at phar://C:/Users/me/bin/composer.phar/src/Composer/Console/Application.php:334
 Composer\Console\Application->doRun() at phar://C:/Users/me/bin/composer.phar/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at phar://C:/Users/me/bin/composer.phar/src/Composer/Console/Application.php:130
 Composer\Console\Application->run() at phar://C:/Users/me/bin/composer.phar/bin/composer:88
 require() at C:\Users\me\bin\composer.phar:29

prohibits [-r|--recursive] [-t|--tree] [--] <package> <version>

And I expected this to happen:

foo/bar  -  requires  php (^7.4)
@stof
Copy link
Contributor

stof commented May 16, 2022

which exact version of composer are you using ?

@InvisibleSmiley
Copy link
Author

What it says in the composer diagnose output.

@stof
Copy link
Contributor

stof commented May 16, 2022

Do you have a path repository configured in your global composer config ? Otherwise, I don't see why a PathRepository would try to initialize.

@InvisibleSmiley
Copy link
Author

Yes I have:

{
    "repositories": [
        {
            "type": "path",
            "url": "D:/Projects/my-project",
            "options": {
                "symlink": false
            }
        }
    ]
}

Seldaek added a commit to Seldaek/composer that referenced this issue May 24, 2022
…e, and make sure async is always enabled on the process executor, fixes composer#10783
@Seldaek Seldaek added this to the 2.3 milestone May 24, 2022
@Seldaek Seldaek added the Bug label May 24, 2022
Seldaek added a commit to Seldaek/composer that referenced this issue May 24, 2022
…e, and make sure async is always enabled on the process executor, fixes composer#10783
emahorvat52 pushed a commit to emahorvat52/composer that referenced this issue Feb 3, 2023
…e, and make sure async is always enabled on the process executor, fixes composer#10783 (composer#10799)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants