Bug 26434 - Plugin dirs duplicates in @INC with plack
Summary: Plugin dirs duplicates in @INC with plack
Status: Pushed to oldoldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 26849
  Show dependency treegraph
 
Reported: 2020-09-11 14:02 UTC by Fridolin Somers
Modified: 2020-10-28 15:50 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Who signed the patch off:
Manual merge request:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.05, 19.11.11, 19.05.16


Attachments
Bug 26434: Fix plugin dirs addition to @INC (2.36 KB, patch)
2020-09-11 14:12 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 26434: Fix plugin dirs addition to @INC (2.43 KB, patch)
2020-09-14 13:16 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 26434: Fix plugin dirs addition to @INC (2.47 KB, patch)
2020-09-17 08:32 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 26434: add Array::Utils module [19.05] (768 bytes, patch)
2020-10-27 14:13 UTC, Mason James
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2020-09-11 14:02:38 UTC
Plugin dirs defined in koha-conf.xml are added to @INC in order to compile perl code.
Looks like with plack those dirs are added several times.
This may lead to an error "INCLUDE_PATH exceeds 64 directories".
Comment 1 Fridolin Somers 2020-09-11 14:12:58 UTC
Created attachment 109946 [details] [review]
Bug 26434: Fix plugin dirs addition to @INC

Plugin dirs defined in koha-conf.xml are added to @INC in order to compile perl code.
Looks like with plack those dirs are added several times.
This may lead to an error "INCLUDE_PATH exceeds 64 directories".

This bug was identified with Carrousel plugin : https://inlibro.com/instructions-carrousel/

Test plan :
1) Enable plack and plugins
2) Look at page about.pl : @INC contains one plugin dir 'var/lib/plugins'
3) Install plugin KitchenSink : https://github.com/bywatersolutions/koha-plugin-kitchen-sink
4) Dont apply patch
5) Use configure on KitchenSink
6) Look at page about.pl : @INC contains server plugin dir 'var/lib/plugins'
7) Apply patch and restart plack
8) Use configure on KitchenSink
9) Look at page about.pl : @INC contains one plugin dir 'var/lib/plugins'
Comment 2 Fridolin Somers 2020-09-11 14:15:28 UTC
Strangely we also see in @INC the template dirs :
koha-tmpl/opac-tmpl and koha-tmpl/intranet-tmpl
The duplicates like plugin dirs thats causes the error.
With patch thoses dirs aren't duplicate anymore.
Comment 3 David Cook 2020-09-14 07:06:38 UTC
I want to say that I've seen these duplicates as well although I'd have to look again.

I'm not sure about this solution though. I think this could use some more investigation.
Comment 4 Kyle M Hall 2020-09-14 13:14:41 UTC
(In reply to Fridolin SOMERS from comment #2)
> Strangely we also see in @INC the template dirs :
> koha-tmpl/opac-tmpl and koha-tmpl/intranet-tmpl
> The duplicates like plugin dirs thats causes the error.
> With patch thoses dirs aren't duplicate anymore.

Considering the way TT finds plugins and include files, I'm not surprised it would push template directories onto @INC.
Comment 5 Kyle M Hall 2020-09-14 13:16:22 UTC
Created attachment 110056 [details] [review]
Bug 26434: Fix plugin dirs addition to @INC

Plugin dirs defined in koha-conf.xml are added to @INC in order to compile perl code.
Looks like with plack those dirs are added several times.
This may lead to an error "INCLUDE_PATH exceeds 64 directories".

This bug was identified with Carrousel plugin : https://inlibro.com/instructions-carrousel/

Test plan :
1) Enable plack and plugins
2) Look at page about.pl : @INC contains one plugin dir 'var/lib/plugins'
3) Install plugin KitchenSink : https://github.com/bywatersolutions/koha-plugin-kitchen-sink
4) Dont apply patch
5) Use configure on KitchenSink
6) Look at page about.pl : @INC contains server plugin dir 'var/lib/plugins'
7) Apply patch and restart plack
8) Use configure on KitchenSink
9) Look at page about.pl : @INC contains one plugin dir 'var/lib/plugins'

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Martin Renvoize 2020-09-17 08:32:16 UTC
Created attachment 110255 [details] [review]
Bug 26434: Fix plugin dirs addition to @INC

Plugin dirs defined in koha-conf.xml are added to @INC in order to compile perl code.
Looks like with plack those dirs are added several times.
This may lead to an error "INCLUDE_PATH exceeds 64 directories".

This bug was identified with Carrousel plugin : https://inlibro.com/instructions-carrousel/

Test plan :
1) Enable plack and plugins
2) Look at page about.pl : @INC contains one plugin dir 'var/lib/plugins'
3) Install plugin KitchenSink : https://github.com/bywatersolutions/koha-plugin-kitchen-sink
4) Dont apply patch
5) Use configure on KitchenSink
6) Look at page about.pl : @INC contains server plugin dir 'var/lib/plugins'
7) Apply patch and restart plack
8) Use configure on KitchenSink
9) Look at page about.pl : @INC contains one plugin dir 'var/lib/plugins'

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2020-09-17 08:33:04 UTC
Simple clean fix, no regresssions, no QA failures.

Passing QA
Comment 8 Jonathan Druart 2020-09-28 09:10:47 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 9 Lucas Gass 2020-10-16 16:26:54 UTC
backported to 20.05.x for 20.05.05
Comment 10 Aleisha Amohia 2020-10-20 02:03:17 UTC
backported to 19.11.x for 19.11.11
Comment 11 Victor Grousset/tuxayo 2020-10-20 21:15:06 UTC
Backported to 19.05.x branch for 19.05.16
Comment 12 Mason James 2020-10-27 14:13:42 UTC
Created attachment 112577 [details] [review]
Bug 26434: add Array::Utils module [19.05]
Comment 13 Victor Grousset/tuxayo 2020-10-27 17:46:05 UTC
Backport to 19.05.x fixed, thanks James! :)