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 - Patch support issues #8368

Closed
ihor-sviziev opened this issue Oct 9, 2019 · 1 comment

Comments

@ihor-sviziev
Copy link

commented Oct 9, 2019

My composer.json:

{
    "name": "vendor/module",
    "description": "description",
    "homepage": "https://example.com",
    "require": {
        "php": "^7.1.3",
        "magento/product-community-edition": "~2.3.2",
        "magento/module-catalog-import-export": "101.0.2|101.0.2-p*",
        "psr/log": "^1.0"
    },
    "type": "magento2-module",
    "license": "proprietary",
    "autoload": {
        "files": [
            "registration.php"
        ],
        "psr-4": {
            "Vendor\\Module\\": ""
        }
    }
}

Output of composer diagnose (in another directory):


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: 1.9.0
PHP version: 7.1.32
PHP binary path: /usr/bin/php7.1

When I run this command:

composer diagnose -v

I get the following output:

                                                                                      
  [UnexpectedValueException]                                                          
  Could not parse version constraint 101.0.2-p*: Invalid version string "101.0.2-p*"  
                                                                                      

Exception trace:
 () at phar:///usr/bin/composer/vendor/composer/semver/src/VersionParser.php:477
 Composer\Semver\VersionParser->parseConstraint() at phar:///usr/bin/composer/vendor/composer/semver/src/VersionParser.php:249
 Composer\Semver\VersionParser->parseConstraints() at phar:///usr/bin/composer/src/Composer/Package/Version/VersionParser.php:29
 Composer\Package\Version\VersionParser->parseConstraints() at phar:///usr/bin/composer/src/Composer/Package/Loader/ArrayLoader.php:238
 Composer\Package\Loader\ArrayLoader->parseLinks() at phar:///usr/bin/composer/src/Composer/Package/Loader/ArrayLoader.php:121
 Composer\Package\Loader\ArrayLoader->load() at phar:///usr/bin/composer/src/Composer/Package/Loader/RootPackageLoader.php:115
 Composer\Package\Loader\RootPackageLoader->load() at phar:///usr/bin/composer/src/Composer/Factory.php:351
 Composer\Factory->createComposer() at phar:///usr/bin/composer/src/Composer/Factory.php:576
 Composer\Factory::create() at phar:///usr/bin/composer/src/Composer/Console/Application.php:354
 Composer\Console\Application->getComposer() at phar:///usr/bin/composer/src/Composer/Console/Application.php:471
 Composer\Console\Application->getPluginCommands() at phar:///usr/bin/composer/src/Composer/Console/Application.php:165
 Composer\Console\Application->doRun() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar:///usr/bin/composer/src/Composer/Console/Application.php:106
 Composer\Console\Application->run() at phar:///usr/bin/composer/bin/composer:61
 require() at /usr/bin/composer:24

And I expected this to happen:
It will show diagnose data.

Additional info:

This issue appear even i'll try to execute just composer, composer -v or composer -V.

According to https://github.com/composer/semver/blob/0f299a13ad1188a276c9c12b321475d22cf1ac34/src/VersionParser.php#L39 - version 101.0.2-p2 - valid version, so we should able to depends on it.

Also I think composer should be able to write his version, diagnose with even broken composer.json file in the folder.

@alcohol

This comment has been minimized.

Copy link
Member

commented Oct 10, 2019

Composer cannot operate with a broken composer.json file because this file is read before most actions are taken. So you have to fix the contents before you can execute whichever command you want to execute. To see what kind of constraints we support, please read https://getcomposer.org/doc/articles/versions.md

@alcohol alcohol closed this Oct 10, 2019
@alcohol alcohol added the Won't Fix label Oct 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.