[Bug 26658] New: Shebangs are wrong in bin/intranet and bin/opac
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26658 Bug ID: 26658 Summary: Shebangs are wrong in bin/intranet and bin/opac Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: minor Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: julian.maurice@biblibre.com Reporter: julian.maurice@biblibre.com QA Contact: testopia@bugs.koha-community.org Depends on: 20582 Currently it's #!/usr/bin/env perl, it should be #!/usr/bin/perl Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20582 [Bug 20582] Turn Koha into a Mojolicious application -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26658 --- Comment #1 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 111466 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111466&action=edit Bug 26658: Fix shebangs of bin/intranet and bin/opac -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26658 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26658 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |magnus@libriotech.no --- Comment #2 from Magnus Enger <magnus@libriotech.no> --- Is this because of Mojo? I have read things like this, so I thought the "env" version was OK: "Because of this, on modern Linux/Unix systems, people might prefer to use #!/usr/bin/env perl as the hash-bang line." https://perlmaven.com/hashbang But I ain't no expert! :-) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26658 --- Comment #3 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Magnus Enger from comment #2)
Is this because of Mojo? I have read things like this, so I thought the "env" version was OK:
"Because of this, on modern Linux/Unix systems, people might prefer to use #!/usr/bin/env perl as the hash-bang line." https://perlmaven.com/hashbang
But I ain't no expert! :-)
No it's not related to Mojo. Yes the env version is OK, it's how I write Perl shebangs most of the time. But the important thing is that all shebangs should be the same in the entire Koha code base. That's why it needs to be fixed :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26658 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #4 from David Cook <dcook@prosentient.com.au> --- (In reply to Julian Maurice from comment #3)
No it's not related to Mojo. Yes the env version is OK, it's how I write Perl shebangs most of the time. But the important thing is that all shebangs should be the same in the entire Koha code base. That's why it needs to be fixed :)
Agreed. I think that the env version allows for more flexibility and power, but I think that we should keep the shebangs consistent in Koha. (Otherwise, we might start up some Perl code using /opt/perl-new/bin/perl, which then invokes other code using /usr/bin/perl.) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26658 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- That being said... I've finally decided to do a little search for existing '#!/usr/bin/env perl' usage in Koha... and it turns out we have more inconsistencies than I thought. root@kohadevbox:koha(bug26658)$ grep --exclude-dir=blib -R '#!/usr/bin/env perl' * api/v1/app.pl:#!/usr/bin/env perl bin/opac:#!/usr/bin/env perl bin/intranet:#!/usr/bin/env perl C4/TTParser.pm:#!/usr/bin/env perl misc/translator/po2json:#!/usr/bin/env perl misc/migration_tools/ifla/update.pl:#!/usr/bin/env perl t/db_dependent/Koha_ExternalContent_OverDrive.t:#!/usr/bin/env perl t/db_dependent/Koha/Objects/Mixin/AdditionalFields.t:#!/usr/bin/env perl t/db_dependent/Koha/Template/Plugin/Asset.t:#!/usr/bin/env perl t/db_dependent/Acquisition/close_reopen_basket.t:#!/usr/bin/env perl t/db_dependent/Acquisition/populate_order_with_prices.t:#!/usr/bin/env perl t/db_dependent/api/v1/auth.t:#!/usr/bin/env perl t/db_dependent/api/v1/auth_authenticate_api_request.t:#!/usr/bin/env perl t/db_dependent/api/v1/smtp_servers.t:#!/usr/bin/env perl t/db_dependent/api/v1/items.t:#!/usr/bin/env perl t/db_dependent/api/v1/return_claims.t:#!/usr/bin/env perl t/db_dependent/api/v1/holds.t:#!/usr/bin/env perl t/db_dependent/api/v1/checkouts.t:#!/usr/bin/env perl t/db_dependent/api/v1/acquisitions_vendors.t:#!/usr/bin/env perl t/db_dependent/api/v1/auth_basic.t:#!/usr/bin/env perl t/db_dependent/api/v1/advanced_editor_macros.t:#!/usr/bin/env perl t/db_dependent/api/v1/oauth.t:#!/usr/bin/env perl t/db_dependent/api/v1/cities.t:#!/usr/bin/env perl t/db_dependent/api/v1/libraries.t:#!/usr/bin/env perl t/db_dependent/api/v1/biblios.t:#!/usr/bin/env perl t/db_dependent/api/v1/acquisitions_funds.t:#!/usr/bin/env perl t/db_dependent/api/v1/stockrotationstage.t:#!/usr/bin/env perl t/db_dependent/api/v1/acquisitions_orders.t:#!/usr/bin/env perl t/db_dependent/api/v1/patrons.t:#!/usr/bin/env perl t/db_dependent/api/v1/clubs_holds.t:#!/usr/bin/env perl t/db_dependent/api/v1/illrequests.t:#!/usr/bin/env perl t/db_dependent/www/regressions.t:#!/usr/bin/env perl t/db_dependent/Search/History.t:#!/usr/bin/env perl t/Members/cardnumber.t:#!/usr/bin/env perl t/Search/History.t:#!/usr/bin/env perl t/00-testcritic.t:#!/usr/bin/env perl xt/author/podcorrectness.t:#!/usr/bin/env perl xt/author/icondirectories.t:#!/usr/bin/env perl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26658 --- Comment #6 from David Cook <dcook@prosentient.com.au> --- Looks like they come from a mix of authors. I might actually send a listserv email about this one... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26658 --- Comment #7 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #4)
Agreed. I think that the env version allows for more flexibility and power, but I think that we should keep the shebangs consistent in Koha. (Otherwise, we might start up some Perl code using /opt/perl-new/bin/perl, which then invokes other code using /usr/bin/perl.)
Actually, David, your concern might be unfounded. Based on the following: https://metacpan.org/release/Plack/source/lib/Plack/App/CGIBin.pm https://metacpan.org/release/Plack/source/lib/Plack/App/WrapCGI.pm You can see that Perl files aren't invoked by the exec() function, and instead are turned into anonymous functions via CGI::Compile. At a glance, it seems like the shebang in a CGI script is irrelevant for Plack... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26658 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |In Discussion -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26658 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |WONTFIX Status|In Discussion |RESOLVED --- Comment #8 from Julian Maurice <julian.maurice@biblibre.com> --- Closing this as WONTFIX. Feel free to reopen if needed -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org