-
-
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
Allow arbitrary tag names #8071
Comments
We also accept a limited subset of https://semver.org/#spec-item-9 (for historical reasons we are not fully compatible on this spec). The subset is defined by this regex: https://github.com/composer/semver/blob/46d9139568ccb8d9e7cdd4539cab7347568a5e2e/src/VersionParser.php#L39 |
Thanks very much. This almost does what we need. We can use, for example, |
If you look at my second comment, you will see that we do support a subset of pre-release versions. Can you not work with any of those? |
Sort of. We could patch |
All this talking about patches only, makes me wonder, have you ever considered looking at https://github.com/cweagans/composer-patches ? Just wondering if this perhaps could benefit your use-case. It is of course not entirely clear to me what your use-case is, so it could be useless. |
We could do it that way, but it is more work and it means that in the |
Well, unfortunately, the above thread pretty much summarizes all your options. We are not likely to be changing our way of matching versions to accommodate edge-case scenarios. |
Thanks. It comes back to the original request: I think it should be possible for people to |
Unfortunately there is a small disconnect between tags and versions. So this is currently not possible, and unlikely to change. |
Would the project accept a patch that would allow arbitrary tags to be used? I note that Composer bills itself as a dependency manager and semantic versions are not mentioned on the web site until well into the documentation. So it is not obvious that only semvar-compatible tags can be used. |
The question is, how would these versions be handled by the solver ? |
Yeah @stof has a very valid point. We cannot determine priority for arbitrary patch names. I really recommend you simply settle on a patching strategy that is more deterministic than "I want exactly this arbitrary patch". Composer handles versions really well. It is not a patching tool. Hence the plugin I referenced, or other options are available. We will not accept a patch to allow arbitrary tags at this point. |
The solver could handle it the same way it handles other exact requires. If I require SomeProject 1.2.3 and something else has an incompatible require, it fails. Likewise, if I require SomeProject 1.2.3-local.1 and something else requires SomeProject at any other version, it fails. |
In our use case, we often need to use locally-modified versions of packages. We tag them like
<original version>-<local string>
, for example,5.2.0-localstring2
(this represents our second change to 5.2.0). When we put these in a require directive, Composer says "Could not parse version constraint".Is there a way to get Composer to accept an arbitrary string as a tag name? Obviously, it won't do any version matching, but it would be very useful to be able to say "use this exact tag". Is there a way to do this?
The text was updated successfully, but these errors were encountered: