Bug 21480 - misc/translator/translate does not work with perl 5.26
Summary: misc/translator/translate does not work with perl 5.26
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: translate.koha-community.org (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Target Milestone: ---
Assignee: Olli-Antti Kivilahti
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-03 08:42 UTC by Olli-Antti Kivilahti
Modified: 2018-10-24 09:13 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
0001-Bug-21480-misc-translator-translate-does-not-work-wi.patch (2.80 KB, patch)
2018-10-03 08:52 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 21480: misc/translator/translate does not work with perl 5.26 (2.89 KB, patch)
2018-10-03 08:58 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 21480: misc/translator/translate does not work with perl 5.26 (3.02 KB, patch)
2018-10-03 15:38 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Olli-Antti Kivilahti 2018-10-03 08:42:50 UTC
Perl 5.26 (or earlier) introduced a security feature, where implicitly including the program directory as a Perl library directory no longer happens (perl -I. ).

This causes translate to fail because it cannot find the *.pm -files in it's own directory.

This patch adds the familiar mantra
    use lib $FindBin::Bin;
to the relevant scripts.

To test:

1. Install Ubuntu18.04 or something else with Perl 5.26
2. Install Koha (we use the dev-install)
3. cd $KOHA_PATH/misc/trnaslator/
4. perl translate create fi-FI
5. Observe problems with missing modules.
Comment 1 Olli-Antti Kivilahti 2018-10-03 08:50:46 UTC
Tested with:

1. cd $KOHA_PATH/misc/translator/
2. perl translate create fi-FI
3. perl translate update fi-FI
4. perl translate install fi-FI
Comment 2 Olli-Antti Kivilahti 2018-10-03 08:52:27 UTC
Created attachment 79860 [details] [review]
0001-Bug-21480-misc-translator-translate-does-not-work-wi.patch
Comment 3 Julian Maurice 2018-10-03 08:58:24 UTC
Created attachment 79861 [details] [review]
Bug 21480: misc/translator/translate does not work with perl 5.26

Perl 5.26 (or earlier) introduced a security feature, where implicitly
including the program directory as a Perl library directory no longer
happens (perl -I. ).

This causes translate to fail because it cannot find the *.pm -files in
it's own directory.

This patch adds the familiar mantra
    use lib $FindBin::Bin;
to the relevant scripts.

To test:

1. Install Ubuntu18.04 or something else with Perl 5.26
2. Install Koha (we use the dev-install)
3. cd $KOHA_PATH/misc/translator/
4. perl translate create fi-FI
5. Observe problems with missing modules.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 4 Julian Maurice 2018-10-03 08:59:16 UTC
Problem confirmed on Debian 9/Perl 5.24

The patch fixes the issue.
Comment 5 Jonathan Druart 2018-10-03 15:38:18 UTC
Created attachment 79901 [details] [review]
Bug 21480: misc/translator/translate does not work with perl 5.26

Perl 5.26 (or earlier) introduced a security feature, where implicitly
including the program directory as a Perl library directory no longer
happens (perl -I. ).

This causes translate to fail because it cannot find the *.pm -files in
it's own directory.

This patch adds the familiar mantra
    use lib $FindBin::Bin;
to the relevant scripts.

To test:

1. Install Ubuntu18.04 or something else with Perl 5.26
2. Install Koha (we use the dev-install)
3. cd $KOHA_PATH/misc/translator/
4. perl translate create fi-FI
5. Observe problems with missing modules.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Cannot recreate the issue right now but the changes make sense.
Comment 6 Nick Clemens 2018-10-03 17:45:13 UTC
Odd QA script failures here, not caused by this patch, ignoring but mentioning

 FAIL	misc/translator/text-extract2.pl
   OK	  critic
   OK	  forbidden patterns
   OK	  git manipulation
   OK	  pod
   OK	  spelling
   FAIL	  valid
		Name "main::INPUT" used only once: possible typo 

 FAIL	misc/translator/tmpl_process3.pl
   OK	  critic
   OK	  forbidden patterns
   OK	  git manipulation
   OK	  pod
   OK	  spelling
   FAIL	  valid
		main::mkdir_recursive() called too early to check prototype
Comment 7 Nick Clemens 2018-10-05 16:25:47 UTC
Awesome work all!

Pushed to master for 18.11
Comment 8 Martin Renvoize 2018-10-08 08:48:29 UTC
Pushed to 18.05.x for 18.05.05
Comment 9 Fridolin SOMERS 2018-10-19 06:35:16 UTC
Pushed to 17.11.x for 17.11.11