Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Solarium has a permissive license which can be found here: https://github.com/solariumphp/solarium/blob/master/COPYING
I think it might make it much easier for people to install search_api_solr if they can download the module and be done with it. This also allows us to only update the library version at our leisure.
Thoughts?
Comment | File | Size | Author |
---|---|---|---|
#12 | include_solarium_in_the-2661698-12.patch | 5.59 KB | borisson_ |
Comments
Comment #2
borisson_The library is currently locked on version
3.4.1
so that's not really an argument.Also, there are other modules (and drupal core) that require developers to run composer install before the library is usable.
Getting #2494073: Prevent modules which have unmet Composer dependencies from being installed into drupal core should be a good thing to improve the DX, so we don't have to.
Comment #3
BerdirYes, this will become common. Commerce will require it, Swiftmailer does, Payment/Currency too.
Core just removed the vendor directory too.
It's also not just about the license of the library you are using, drupal.org simply doesn't allow it, even if it is GPL. (pretty sure that what 7.x-1.x is doing is also not allowed actually).
I'd rather do the opposite and throw out support for having a local vendor folder. People will have to learn how to use composer/composer_manager properly. And it adds an event listener that has to run early on every request.
Comment #4
borisson_I think this is a great idea. It'll also remove the really weird bootstrap file that we currently use in the tests.
Comment #5
borisson_Comment #6
Nick_vhNot so quick. Drupal 8.1.x might have removed it from the source but it is available when downloading the packaged version. Until we can do this with contributed modules I am very against removal of the fact to have support for local composer packages. I understand we're in php revolution but it is by far a standard that people understand fully.
We also do not depend on composer manager and if we want to remove the support for installations without composer manager then we need to adjust accordingly and make composer manager a dependency.
Comment #7
borisson_This is not possible for contributed modules because the vendor module should live in the root and that's not in the download of a contrib module.
I understand composer is a new thing for a lot of people, but since we're not the only module to include composer-libraries (see #3) we shouldn't do something different to other what other modules to make sure the learned skills from other modules can be transferred to solr.
We shouldn't depend on
composer_manager
either, there's multiple ways to composer, some of them are without composer_manager, see https://bojanz.wordpress.com/2015/09/18/d8-composer-definitive-intro/ for more.Comment #8
BerdirWe will also need to update travis.yml so it uses a different method to download the library. Running composer require + composer update --lock in the drupal root should work.
@Nick
If people can figure out how to run composer in the module folder, then they can figure out composer_manager too. Including the code simply isn't an option, d.o doesn't allow it with the exception of core.
And as @borrisson_ said, a dependency on composer_manager isn't required, there are other ways too. We probably should update our install instructions to explain or point to an explanation on ways to do this.
Comment #9
borisson_We can link to the same documentation as #2494073: Prevent modules which have unmet Composer dependencies from being installed does, until we get that one in drupal core. https://www.drupal.org/documentation/install/composer-dependencies
Comment #10
borisson_Changed the currently shipped docs.
Comment #11
drunken monkeyIt's "its", not "it's".
Otherwise, this looks great, would be good to go in my opinion.
In the module's D7 version we've fused
INSTALL.txt
andREADME.txt
, to avoid such duplication of content, but that's another issue.Comment #12
borisson_Fixed #11.
Comment #13
bojanz CreditAttribution: bojanz at Centarro commented+1 if that means anything. This is the way things work now when you need a library.
Once https://github.com/wikimedia/composer-merge-plugin/pull/102 lands and we update merge plugin in core, we'll be able to tell people to just do "composer require drupal/search_api_solr", deprecating Composer Manager, it's been an awkward experience.
Comment #14
XanoAny contributed module that includes Composer packages in its repository will inevitably clash with other modules having the same packages in their dependencies list. As long as the required versions are compatible, this will likely not cause real issues, but the moment the requirements include different version constraints, users will experience more severe problems without the root cause being clear. When using Composer to resolve dependencies, users will see useful error messages about these conflicts, telling them exactly what's wrong.
Comment #15
Anonymous (not verified) CreditAttribution: Anonymous commentedWith
Include Solarium in the repository
https://www.drupal.org/node/2661698
underway, with comment there
> People will have to learn how to use composer/composer_manager properly
but composer not currently production-recommended over drush, what is the _current_ proper way for installing solarium library dependency?
E.g., given
Should the library be subsequently installed as
or otherwise integrated into the makefile.yaml?
And, if it's now `composer` for production-release, how should installed solarium library be updated?
EXEC of
pulls in a lot of other deps/updates
and it's unclear whether that's recommended when composer is not (yet) being used to manage all of the drupal install.
Comment #16
bojanz CreditAttribution: bojanz at Centarro commented@bugsonly
https://bojanz.wordpress.com/2015/09/18/d8-composer-definitive-intro/
http://tim.millwoodonline.co.uk/post/137808458560/composer-dependencies-...
Comment #17
Nick_vhIRC discussion regarding this issue:
[10:35am] Nick_vh: can we at least block the search_api_solr issue till that story is resolved
[10:35am] Nick_vh: so we can see what to do then?
[10:36am] Nick_vh: berdir: ^^
[10:36am] berdir: It's not really related to that. Fact is, you already have to run composer to get the library (as I said, committing it really is not an option)
[10:36am] berdir: and if you can use composer to do that, you can also figure out composer_manager
[10:36am] Nick_vh: berdir: that is why I initially wanted to include it in the module
[10:36am] Nick_vh: for the newbies
[10:36am] Nick_vh: but understandably, this brings other complications
[10:37am] berdir: IMHO, installing solr is a lot harder than doing htis
[10:37am] Nick_vh: not if you use hosted solr
[10:37am] Nick_vh: berdir: trust me, there are a ton of people who never did composer
[10:37am] Nick_vh: and a simple dpm to tell them they need to go to the d.o link and follow instructions
[10:38am] Nick_vh: isn’t too much to ask I think
[10:38am] Nick_vh: documentation has never hurt anyone
[10:38am] berdir: sorry, missed part of what you said
[10:39am] berdir: sure, I'm not against adding documentation
[10:39am] berdir: I also have no problem with waiting to remove it until the core issue about the composer dependency thing is fixed
[10:39am] Nick_vh: it’s either that or include that ourselves if I can make the call
[10:39am] berdir: or we can do that already now as our own install requirements check and then remove it when core is fixed
[10:40am] Nick_vh: berdir: right - that’s what I proposed in irc to borisson_ earlier
[10:40am] berdir: ok
[10:40am] Nick_vh: we should’ve added the irc log to the issue I guess
[10:40am] berdir: that works for me. I don't think I can find time to do it myself, but +1 to that and happy to commit it if someone does it
So please either block this issue on the core issue #2494073: Prevent modules which have unmet Composer dependencies from being installed or make a patch that includes that documentation if the requirements of the search_api_solr fail (eg, solarium is not found).
Either one of those two will result in a "Fixed" state.
Comment #18
Nick_vhComment #19
Nick_vhComment #20
bojanz CreditAttribution: bojanz at Centarro commentedThe core issue is just a generic way of doing:
A patch in here could easily do something similar.
Comment #21
Anonymous (not verified) CreditAttribution: Anonymous commented@bojanz
> https://bojanz.wordpress.com/2015/09/18/d8-composer-definitive-intro/
> http://tim.millwoodonline.co.uk/post/137808458560/composer-dependencies-...
Thx for the links! switched completely over to composer-only; nice.
Comment #22
borisson_It looks like mollux already did that in https://github.com/mollux/search_api_solr/commit/7ade94b4f58590a0cdadf2a...
So to keep better attribution, we could commit this and merge that pull request. If you want I can copy that in my patch as well though.
Comment #23
BerdirI'm OK with a separate issue/pull request for that. However, I would prefer to have this as a PR on https://github.com/amateescu/search_api_solr so we are sure that at least the test environment set up still works on travis. See #8, I think that wasn't addressed yet?
Comment #24
borisson_I created a pull request, I think we can update the .travis.yml in another issue #2662612: Update travis.yml to support PHP 7
Comment #25
mkalkbrennerI came across a similar issue in search_api_solr_multilingual where I add another dependency managed via composer.
I implemented and documented it the same way as the current suggested patch. If I understand the discussion correctly we already have a consensus on the latest patch, right?
I tested the installation process from scratch and therefor I mark this as RTBC.
Comment #26
mkalkbrennerComment #27
BerdirSee my feedback in https://github.com/amateescu/search_api_solr/pull/78
Comment #28
BerdirOh, forget that, looks like it was already addressed there.
Comment #29
mkalkbrennerLast call ;-)
I will commit this if nobody votes against this patch anymore.
Comment #30
BerdirThis being the PR referenced above?
Fine with me. We should open a follow-up to add a requirements hook, see #20 + #22, though.
Comment #31
mkalkbrennerSure, we can open a follow-up. But this follow up should be obsolete due to #2494073: Prevent modules which have unmet Composer dependencies from being installed.
Comment #32
BerdirIt will be when that gets committed yes. No idea when that will happen, no activity on that issue for quite a while now. Which is why we said we want to have something in the module for now.
Comment #33
mkalkbrennerOpened follow up:
#2687197: Verify the composer managed dependencies using hook_requirements()
Comment #36
geerlingguy CreditAttribution: geerlingguy commentedJust a note, as someone who's more sympathetic to @Nick_vh's comments through this issue (and on IRC): As a long-time Drupalist and someone who regularly uses Composer outside of Drupal work, the cognitive dissonance I get from trying to get all the dependencies working in a typical D8 site is alarming...
When I was testing this module in a few different scenarios, I had different results each time, and it took me maybe 30 min to an hour to finally get the *@$( dependencies straight with different versions (e.g. latest alpha as of this writing, and dev release).
drush dl
the module, install, and done.composer.json
file in the module after noticing fatal exceptions when installing and using the module, thencd
into this module's folder, and then runcomposer install
, then rundrush cr
, then go back to configuring the module.My point isn't necessarily that we're doing things wrong—it's that @Nick_vh has an EXTREMELY valid point here:
To be honest, just composer use itself is enough that many people I support for Hosted Solr (and other activities) are going to get their minds blown... but we can work through that. The main thing is we need to give very reliable, step-by-step documentation at every place where people might encounter these issues.
#2494073: Prevent modules which have unmet Composer dependencies from being installed is hugely important, imo, and I think it should be a blocker to the next alpha/beta of this module, since many people who click the download link on Drupal.org will get hit by this. And maybe adding a step-by-step install guide on the project page too. (And the same goes for any other Drupal module that is going to rely on dependencies that will normally be managed by Composer Manager).
Comment #37
bojanz CreditAttribution: bojanz at Centarro commentedThanks to the fixes that are a part of Drupal 8.0.6 and 8.1-RC1, we can stop recommending Composer Manager (as long as we require those minimal core versions).
The current Commerce instructions:
That's it, two steps. All dependent modules and libraries downloaded.
The first step will be gone once Drupal Packagist is deployed on drupal.org infrastructure.
The Commerce project page has a note that says "The tarballs are for informative purposes only, Composer must be used for installation."
Comment #38
geerlingguy CreditAttribution: geerlingguy commented@Nick - do you think we could get something similar added to the project page for Drupal 8 install instructions?
Comment #39
geerlingguy CreditAttribution: geerlingguy commented@bojanz - Thanks for your follow-up too; for Search API Solr, all you need to do to install with composer (and not Composer Manager) for an existing Drupal 8 codebase is:
Worked great, and this is much more intuitive for someone familiar with Composer than using Composer Manager.
Could we get this kind of instruction added on the project page or in the install/readme?
Comment #40
ibakayoko CreditAttribution: ibakayoko as a volunteer commented#39 works for me.
Thank you for the solution.
The modules are not added into the contrib folder. That is the only issue.
Comment #41
XanoUse https://github.com/composer/installers to install Drupal extensions in the correct folders.
Comment #42
bojanz CreditAttribution: bojanz at Centarro commented@ibakayoo
All you need is an installer path in your composer.json.
See the bottom of https://github.com/drupal-composer/drupal-project/blob/8.x/composer.json for an example
Comment #43
ressa CreditAttribution: ressa as a volunteer commentedI still use drush and not Composer to download modules. For a quick-start with the latest (alpha) version, the installation commands could be like this:
Comment #44
bojanz CreditAttribution: bojanz at Centarro commentedSo you download search_api_solr with Drush, then redownload it with Composer? Your first Drush line ends up having no effect.
Comment #45
ressa CreditAttribution: ressa as a volunteer commentedI had the same experience like @ibakayoko: "The modules are not added into the contrib folder. That is the only issue.".
I just tested again, and it was because Composer couldn't find the module with a tag like "drupal/search_api_solr 8.1":
So these commands work and downloads both search_api_solr and search_api. So yeah, strike the first line :-)
NOTE: updated commands to use https://packages.drupal.org/8 and the new package syntax.
Search API Solr fulltext search View at http://example.com/solr-search/content
Comment #46
letuptit CreditAttribution: letuptit commentedhttps://www.drupal.org/project/search_api_solr/issues/2661698#comment-11...
worked for me.
Thank iu!!!