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

Can't install alternate distribution releases with composer #41

Closed
rdoursenaud opened this issue Nov 3, 2015 · 11 comments
Closed

Can't install alternate distribution releases with composer #41

rdoursenaud opened this issue Nov 3, 2015 · 11 comments

Comments

@rdoursenaud
Copy link

Following the docs at http://ckeditor.com/blog/CKEditor-Supports-Bower-and-Composer, I tried the following code:

"require": {
    "ckeditor/ckeditor": "full/4.3.3",
}

Unfortunately composer fails with the following message:

[UnexpectedValueException]                                                            
Could not parse version constraint full/4.3.3: Invalid version string "full/4.3.3"  

On the other hand branches seem to work OK. Unfortunately, I work with a very picky project manager that wants all dependencies to be pinned versions.

Is there any workarounds?

rdoursenaud added a commit to GPCsolutions/dolibarr that referenced this issue Nov 9, 2015
This time using the correct full package

Also used the branch + tag commit to work around that bug:
ckeditor/ckeditor4-releases#41
@schmunk42
Copy link

That does not work in general with composer libraries. You simply do not see the versions unless you're on stability dev.

@schmunk42
Copy link

schmunk42 commented Jun 12, 2017

This is what worked for us: "ckeditor/ckeditor": "~4.7.0+full"

This is what worked: "ckeditor/ckeditor": "dev-full/4.7.x as 4.7.0" (full/4.7.0 does NOT work for some reason)

@oleq @Reinmar @mlewand To my understanding, using a / in the version tag is not covered by semver. Build metadata should be annotated with a + sign, see http://semver.org/#spec-item-10

@rdoursenaud
Copy link
Author

Thanks @schmunk42 for your insights.
Your latest suggestion pins the release but not the specific version.
I worked around it by adding the tag.
It's not very legible but does the trick for now.

The documentation still needs updating though…

@mlewand
Copy link
Contributor

mlewand commented Jun 14, 2017

It looks that Comopser is simply not handling tags that way, since branches are working correctly. You can see Fetching a Particular Build Preset section in our docs to find pretty much what @schmunk42 has suggested, so the docs are fine here.

As for workaround, since Composer doesn't play well with tags that contain backslash, you could simply pin the requirement to a given hash.

To my understanding, using a / in the version tag is not covered by semver. Build metadata should be annotated with a + sign, see http://semver.org/#spec-item-10

Yes, these branches do not follow SemVer - we simply added them to allow devs to fetch a particular build.

@mlewand mlewand closed this as completed Jun 14, 2017
@rdoursenaud
Copy link
Author

@mlewand Thanks for your comment.
The docs are indeed fine but the blog I linked in my first message is not.
Unfortunately it's the first Google result for "ckeditor composer" hence my mixup.
Sorry for the confusion.

@schmunk42
Copy link

I haven't really tested it, but would you consider an additional tag like 4.7.0+full if it would work fine?

@schmunk42
Copy link

The problem with composer and multiple distributions is, because of the fact that ckeditor is often included as a dependency, that you can not specify a version constraint like ^4.2.1.

If you wanna include a full version, you have to "patch" your root composer.json pointing to a specific branch or version, which makes package management with dependency resolution useless in this setup.

Would be really nice, if you could provide a solution for this.

@mlewand
Copy link
Contributor

mlewand commented Jun 16, 2017

And how would Composer resolve anything like ^4.7.0+full? I'm afraid that it will simply skip meta info, and will just use any other preset. That's a no-go for us if it would replace 4.x.x+basic with a 4.x.x+full or the other way around during the update.

@schmunk42
Copy link

Tried it with a fork and it does not work :(

See my issue in composer/composer...

@schmunk42
Copy link

schmunk42 commented Jun 16, 2017

Any chance to make this happen?

It should be released as 3 different packages. E.g. ckeditor/ckeditor (standard), ckeditor/ckeditor-basic, ckeditor/ckeditor-full

composer/composer#6489 (comment)

[edit]
Maybe additional three repos automatically splitted?

@mlewand
Copy link
Contributor

mlewand commented Jun 16, 2017

It is a possibility, I created #69 for this, however it's not a hi priority for us ATM as it will require a bit of work to make it happen (and maintain backward compat).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants