Perl-LanguageServer icon indicating copy to clipboard operation
Perl-LanguageServer copied to clipboard

minimum version of perl 5.16 not 5.18

Open willt opened this issue 3 years ago • 2 comments

I believe this works with perl 5.16 just fine. Just change 5.18 to 5.16 and remove the no experiential warnings. This will help people forced to be stuck in old perl (redhat/company policy/etc) Thoughts?

willt avatar Sep 03 '21 18:09 willt

I've created a fork of this module with Perl v5.16 compatibility, if anyone unsure how to edit it for themselves:

https://github.com/finwarman/perl-5.16-Perl-LanguageServer/releases/tag/V2.3.0

finwarman avatar Apr 27 '22 10:04 finwarman

I thought for a second this would work with 5.16 as well. Got it installed with @finwarman's fork. While it mostly works, I found that the debugger didn't actually work. It would claim that the DB::DB subroutine was not defined.

The earliest version of perl I got working with the debugger was 5.26.3 ( earlier versions may work, haven't tested many but 5.18 had the same issue as 5.16 ).

What I ended up doing for working on an old el7 system with 5.16 that seems to have worked is...

Development Server Setup

  • setup plenv
  • plenv install-cpanminus
  • cd /tmp/
  • plenv local 5.26.3
  • cpanm Perl::LanguageServer
  • cpanm URI::Escape
    • installed this b/c the version available on el7 contains breaking changes when run under the 5.26.3 interpreter / if you're not using it you can skip this

VSCode / Client Setup

Now in the Settings for the VSCode Perl Extension...

  • Change Perl Cmd to /home/$USER/.plenv/versions/5.26.3/bin/perl
    • change $USER to your literal username; can't use VSCode variables at the moment; see 128
  • Change perl.perlInc to the following...
    • again changing $USER to your literal username due to 128
    "perl.perlInc": [
        "/home/$USER/path-to-project/lib/",
        "/home/$USER/.plenv/versions/5.26.3/lib/perl5/site_perl/5.26.3/x86_64-linux",
        "/home/$USER/.plenv/versions/5.26.3/lib/perl5/site_perl/5.26.3",
        "/home/$USER/.plenv/versions/5.26.3/lib/perl5/5.26.3/x86_64-linux",
        "/home/$USER/.plenv/versions/5.26.3/lib/perl5/5.26.3",
        "/usr/local/lib64/perl5",
        "/usr/local/share/perl5",
        "/usr/lib64/perl5/vendor_perl",
        "/usr/share/perl5/vendor_perl",
        "/usr/lib64/perl5",
        "/usr/share/perl5"
    ],
  • 1st line causes perl to prefer libs found in the project's lib dir
  • 2nd-5th lines causes perl to prefer libs found in the plenv environment after searching for them in the project's lib dir ( this will be your core libs, Perl::Language, and any other modules you need to install here b/c older versions can't run under the 5.16 interpretter.
  • 6th-11th lines are what @INC is by default ( on an el7 system at least ); so then any modules not found in the project's lib dir or the plenv environment will use the system libs

That seems to have gotten things working. Obviously this means that you're debugging with a different perl interpreter than the project would be using in production which could lead to interesting surprises.

bgeels avatar Sep 10 '22 17:09 bgeels

Fixed in 2.5.0

richterger avatar Feb 07 '23 21:02 richterger