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

Sculpin bundles cannot depend on Guzzle #109

Merged
merged 1 commit into from Feb 18, 2014

Conversation

bangpound
Copy link
Contributor

I'm starting to get into Sculpin, and I created a bundle to support oEmbed in posts and templates.

https://packagist.org/packages/bangpound/sculpin-oembed-bundle

I want to use Guzzle in my oEmbed library because it has a lot of features that will make my work simpler, in particular caching, service descriptions and events. However, I cannot simply add Guzzle as a dependency. If I use guzzle/guzzle:~3.7, there are conflicts because react/http depends on a lesser version of Guzzle. If I use guzzle/guzzle:~3.0 (to match react/http), there are conflicts because react/http depends only on sub-components of Guzzle.

I think the fact that sculpin's dependencies are packaged in a phar means that the embedded composer cannot switch out the guzzle subcomponents for the full library.

The only work around is to set up a composer.json file in my project and add sculpin as a dependency. Even then, I can only use guzzle 3.0.

So this presents a messy problem, I think. I suspect react/http is used to provide the built in Sculpin web server. (But I haven't verified this.) Personally, I could get by without react/http because I'm using PHP 5.4.... I'm probably digressing now!

Do you have any advice for this dependency version conflict?

@simensen
Copy link
Member

Hi! Thanks for contacting me! I noticed you posted this WIP a few days ago on Twitter but I wasn't able to reach out before then.

So this presents a messy problem, I think. I suspect react/http is used to provide the built in Sculpin web server. (But I haven't verified this.) Personally, I could get by without react/http because I'm using PHP 5.4.... I'm probably digressing now!

I don't think you can do what Sculpin does using the built in webserver. I could be wrong, and maybe I could explore that more. But really the best way to be able to offer an embedded webserver that is useful and allows you to do other things for a long running process is to use something like react.

Do you have any advice for this dependency version conflict?

Our best bet would be to try to find a happy medium for versions of Guzzle that are shipped with Sculpin and the version of Guzzle you are using now. I can see how this will potentially be a larger issue down the line, though. Eventually version differences are going to hurt quite a bit.

However, if Sculpin itself looses its requirements on Guzzle, you should at least be able to create your own composer.json that will be more likely to work. If you wanted to try relaxing the restrictions on the Guzzle requirements (or straight up upgrade them some) that would probably be a good place to start. You'd be able to use it right now (hopefully?) and if we have the version constraints set to something more reasonable it will hopefully provide us with a little bit of flexibility for future versions of Guzzle.

@bangpound
Copy link
Contributor Author

Thanks Beau. I think I may not have been clear enough. I cannot add a dependency on guzzle/guzzle of any version while using sculpin.phar. This appears to be because react/http depends only on sub-components of guzzle. This means that the subcomponents are added to the PHAR and then they cannot be replaced later by the embedded composer.

I'm going to try adding a dependency to the whole guzzle/guzzle:~3.0 project in sculpin's composer.json. While it would be nice to have guzzle 3.7, I may be able to get by without it!

@simensen
Copy link
Member

If that is the case that is very unfortunate. I'll have to talk to @naderman to see if this is known/expected and whether or not we can work around this somehow.

In the mean time, yes, you can try to include all of guzzle/guzzle if you want to. If guzzle/guzzle 3.7 is still PHP 5.3 compatible, you can try that as well. If it works, we can just start shipping guzzle/guzzle 3.7 with the sculpin.phar.

@bangpound
Copy link
Contributor Author

Beau:

The pull request adds a dependency on guzzle/guzzle, which allows me to build a sculpin.phar that can work on a sculpin project with bangpound/sculpin-oembed-bundle:@dev as a dependency in sculpin.json.

I checked that guzzle 3.7 is still compatible with php 5.3, but since that is an upstream dependency on a library I don't understand, I will leave that for another day!

simensen added a commit that referenced this pull request Feb 18, 2014
Sculpin bundles cannot depend on Guzzle
@simensen simensen merged commit 7ffe39c into sculpin:master Feb 18, 2014
@bangpound bangpound deleted the feature/guzzle branch February 18, 2014 20:13
@simensen
Copy link
Member

simensen commented Apr 9, 2014

I merged this awhile ago but I hadn't built it into sculpin.phar. It should be deployed now. I apologize for the delay!

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

Successfully merging this pull request may close these issues.

None yet

2 participants