-
Notifications
You must be signed in to change notification settings - Fork 43
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
Invalid version string "^2.1" #29
Comments
Result:
The problem i see is that https://semver.mwl.be/#?package=jakoch%2Fphantomjs-installer&version=%5E2.1&minimum-stability=stable |
@jakoch I'm doing some tests .. These are my settings:
I have the same result for every php version I tried |
I guess, i found the reason in the semver docu - http://semver.org/#spec-item-11
The reason that the constraint So much for two-in-one version trickery ... |
Thanks for the OS and PHP versions, I will test the full range of commands, including updates from version to version. CLI:
CLI:
CLI:
Finally, in an empty folder: Result:
Finally, without version constraint on the require:
All cases handled and no loose screws found, yet. :( Back to you @drAlberT : any ideas or additional steps i could try? |
I made a test with a new brand empty project. Same issue: foobar/ $ cat composer.json
{
"name": "dralbert/foobar",
"minimum-stability": "stable",
"require": {
"jakoch/phantomjs-installer": "2.1.1"
},
"config": {
"bin-dir": "bin"
},
"scripts": {
"post-install-cmd": [
"PhantomInstaller\\Installer::installPhantomJS"
],
"post-update-cmd": [
"PhantomInstaller\\Installer::installPhantomJS"
]
}
} foobar/ $ tree -L 2
.
├── [ 102] bin/
│ └── [ 43M] phantomjs*
├── [ 411] composer.json
├── [2.1K] composer.lock
└── [ 170] vendor/
├── [ 183] autoload.php
├── [ 340] composer/
└── [ 136] jakoch/
4 directories, 4 files foobar/ $ composer require jakoch/phantomjs-installer |
@jakoch made a new test .. another server, another OS: $ uname -a
Linux devel 3.2.0-4-686-pae #1 SMP Debian 3.2.73-2+deb7u2 i686 GNU/Linux $ php -v
PHP 5.4.45-0+deb7u2 (cli) (built: Oct 17 2015 09:01:48)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies $ cat composer.json
{
"name": "dralbert/foobar",
"minimum-stability": "stable",
"require": {
"jakoch/phantomjs-installer": "2.1.1"
},
"config": {
"bin-dir": "bin"
},
"scripts": {
"post-install-cmd": [
"PhantomInstaller\\Installer::installPhantomJS"
],
"post-update-cmd": [
"PhantomInstaller\\Installer::installPhantomJS"
]
}
} $ tree -L 2
.
├── bin
│ └── phantomjs
├── composer.json
├── composer.lock
└── vendor
├── autoload.php
├── composer
└── jakoch
4 directories, 4 files $ composer require jakoch/phantomjs-installer
Using version ^2.1 for jakoch/phantomjs-installer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing jakoch/phantomjs-installer (2.1.1)
- Installing jakoch/phantomjs-installer (2.1.1-p01)
Downloading: 100%
Writing lock file
Generating autoload files
> PhantomInstaller\Installer::installPhantomJS
Script PhantomInstaller\Installer::installPhantomJS handling the post-update-cmd event terminated with an exception
Installation failed, reverting ./composer.json to its original content.
[UnexpectedValueException]
Invalid version string "^2.1"
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--] [<packages>]... Same result ;( |
maybe the |
Ahh, now i see where you are coming from:
This is an
followed by Result:
then followed by Result:
The require command changes the constraint from We are using the same commands, but get different results. One more try: on top of
No clue...
Maybe. But before i try the next versioning pattern, i would actually delete the |
@jakoch Bingo! .. https://github.com/jakoch/phantomjs-installer/blob/master/src/PhantomInstaller/Installer.php#L213 If you dump the version here you get "^2.1" and the regex will not match .. so the version string returned by the function is simply |
Ok, got it.. i can only reproduce this with Composer 1.1.0 (stable channel).
|
The origin of the exception are these two lines
I other words: I need to resolve the
Patch incoming... |
…rom the root package. this will match `2.1.1-p01` and return `2.1.1`, instead of getting a `^2.1` from the root. issue #29
I've tagged a new release: https://github.com/jakoch/phantomjs-installer/releases/tag/2.1.1-p02 And: Thank you for your time and help in tracking this problem down !
This works on Composer 1.1.0 stable and 1.2-dev. |
$ composer require jakoch/phantomjs-installer
Using version ^2.1 for jakoch/phantomjs-installer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing jakoch/phantomjs-installer (2.1.1-p01)
- Installing jakoch/phantomjs-installer (2.1.1-p02)
Downloading: 100%
Writing lock file
Generating autoload files
> PhantomInstaller\Installer::installPhantomJS
- Installing phantomjs (2.1.1)
Loading from cache Sounds good 👍 Thank you for solving in such a fast way! |
No problem. Sometimes these dependency problems are really hard to track down and reproduce. Closing. |
I'm opening a new issue for the following comment and for bug verification,
because i tend to loose track of comments to source code.
74d7516#commitcomment-17446718
Steps to reproduce the problem:
composer require jakoch/phantomjs-installer
Workaround:
^2.1
or2.1.*
,2.*
)The text was updated successfully, but these errors were encountered: