-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
force a single dependency to install on different (lower) requirements #6126
Comments
Alias should be to a specific version, not to a version constraint. You have to pick a specific version that satisfies the constraint that the other library requires. |
If you however don't want to alias an older version as 3.x, but rather want to actually install 3.x on a php 5.3 or php 5.4 system (which seems really dumb, since it explicitly does not support that), then you could just call |
@alcohol, your comments do not solve the issues. Please read my full comments, I specifically mentioned 3 ways I tried to address the issue of only forcing one dependency to ignore the requirements of just a specific package. Alias was only one item. Using the command line argument is not a solution that I want as it is far to broad. Additionally it's not a valid solution for others using the package. |
Well, if nikic/php-parser tells you that the 3.0 version does not work on PHP 5.4, why would you want to force installing it ? even if you force composer to bypass the platform check, it would not work. |
@stof nikic/php-parser tells us they only support php 5.5+ but they also note that there is nothing that would prevent it from working with php 5.3. That aside, we use nikic/php-parser in the framework as part of a CLI tool for developing on the framework with the note that it should be used only in php 5.6. So between nikic/php-parser actually working on php 5.3 and this is a CLI tool that only developers are going to use, installing on php <=5.5 is not a concern for us. The problem is, nikic/php-parser needs to be required in the framework package (and not just in dev mode) and thus breaks the CI testing on travis and when others composer install the framework on PHP <=5.5 |
I gave you a solution. That you did not accept it (for whatever reasons), is not my problem. There is no issue here, other than you being stubborn. |
that's wrong. The nikic/php-parser codebase can parse PHP 5.3 code. but it cannot run on PHP 5.3 (I'm not sure whether it can run on PHP 5.4, but I'm 100% sure it cannot run on 5.3 as the first file I checked is using the short array syntax) |
@alcohol I gave a "solution" using using |
@stof Maybe I misunderstood a statement I read in the nikic/php-parser version history about what versions it will work on vs what php versions they support. but like I said, we don't actually care if nikic/php-parser 3.x works on lower php versions as it's only included in the package as a CLI tool for developers to use in >php5.3 unfortunately, we now have issues with composer installs for <php 5.5 in our CI testing environments. Hence the use case for force a single dependency to install on different (lower) requirements |
Additionally, if I take the full json with the |
The inability to include a package without checking for its requirements is still a major issue. Common use case is to update a framework but a module has not updated its composer.json requirements to be compatible with the new version. |
@jonaseberledmind putting the burden of solving that on the package manager instead of the library maintainer is just approaching the problem the wrong way around in my opinion. |
My
composer.json
:on php 5.3 and 5.4 I get the following output:
And I expected this to be possible:
on php 5.3 and php 5.4 I want to override just the one package nikic/php-parser requires php >=5.5 to force install version 3
current capabilities of
as
won't allow broad version aliasing sinceCould not parse version constraint ~3.0 as 1.0: Invalid version string "~3.0" in "~3.0 as 1.0", the alias source must be an exact version
current capabilities of
config platform
doesn't seem to have options to specify just a single dependency to fake platform packages (PHP and extensions) so that you can emulate a production env on just a single dependency. additionally it also does not seem to be able to specify multiple platform options to fake PHP as infake 5.5 for <= 5.4 and exact for >=5.5
alternative options was the following json
This is not an elegant solution and I would rather just force the dependency to install 3.0 on both php 5.3 and php 5.4
The text was updated successfully, but these errors were encountered: