Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.99k stars 557 forks source link

Perl 5.40.0 creates only version-suffixed binaries which prevents some packages from installing #22781

Closed vadimkantorov closed 1 week ago

vadimkantorov commented 1 week ago

It only installs into a prefix bin/perl5.40.0 and bin/enc2xs5.40.0, but some packages like Encode::EUCJPASCII expect a enx2xs binary to be discoverable. I worked around this by creating an unversioned symlink, but how to do this properly? Is there some switch for Configure to ask it to produce the symlinks or do not use any versions in the file names / path segments?

Thanks!

The following fails because enc2xs is not discoverable

name: buildperl

on: workflow_dispatch
env:
  PERLVER: "5.40.0"
  URLPERL: https://www.cpan.org/src/5.0/perl-5.40.0.tar.gz
  URL_Encode_EUCJPASCII: https://cpan.metacpan.org/authors/id/N/NE/NEZUMI/Encode-EUCJPASCII-0.03.tar.gz

jobs:
  buildperl:
    runs-on: ubuntu-20.04
    steps:
      - name: Install Perl static
        shell: bash
        run: |
          sudo rm -rf /usr/bin/perl /usr/bin/enc2xs
          mkdir perlsourcestatic && curl -L $URLPERL | tar -xzf - --strip-components=1 --directory=perlsourcestatic
          cd perlsourcestatic && sh +x ./Configure -sde -Dman1dir=none -Dman3dir=none -Dprefix="$PWD/perlprefix" -Aldflags="-lm -ldl" -Accflags="-lm -ldl" -Dusedevel -Dlibs="-lpthread -ldl -lm -lutil -lc" -Dstatic_ext="mro Devel/Peek File/DosGlob File/Glob Sys/Syslog Sys/Hostname PerlIO/via PerlIO/mmap PerlIO/encoding B attributes Unicode/Normalize Unicode/Collate threads threads/shared IPC/SysV re Digest/MD5 Digest/SHA SDBM_File Math/BigInt/FastCalc Data/Dumper I18N/Langinfo Time/HiRes Time/Piece IO Socket Hash/Util/FieldHash Hash/Util Filter/Util/Call POSIX Encode/Unicode Encode Encode/JP Encode/KR Encode/EBCDIC Encode/CN Encode/Symbol Encode/Byte Encode/TW Compress/Raw/Zlib Compress/Raw/Bzip2 MIME/Base64 Cwd Storable List/Util Fcntl Opcode" && cd -
          make -C perlsourcestatic
          make -C perlsourcestatic install
          PERLBIN=$PWD/perlsourcestatic/perlprefix/bin/perl5.40.0
          mkdir -p myext
          curl -L $URL_Encode_EUCJPASCII | tar -xzf - --strip-components=1 --directory myext
          cd myext
          $PERLBIN Makefile.PL LINKTYPE=static
          make && make instal
Grinnz commented 1 week ago

This is not standard behavior for a stable Perl, but you are passing -Dusedevel which might be enabling this behavior. Pass -Uversiononly to unset the versiononly parameter for devel perls.

vadimkantorov commented 1 week ago

Thank you! -Uversiononly worked. Not sure if I actually need -Dusedevel, thanks for the tips.

Is it possible to also ask the Perl to omit the versions/platforms from the installation paths? e.g. omit 5.40.0/x86_64-linux from $PREFIX/lib/perl5/site_perl/5.40.0/x86_64-linux/ and from $PREFIX/lib/perl5/5.40.0/x86_64-linux/auto/?

Grinnz commented 1 week ago

Those are the site and priv(core) arch lib dirs and is separate from the main privlib and sitelib dirs because files installed there are not portable between Perl versions/builds and system architectures. You can probably fiddle with INSTALLARCHLIB and INSTALLSITEARCH (https://perldoc.perl.org/ExtUtils::MakeMaker#make-install) at your own risk of course. Sitelib is intended for CPAN module installs and will be used by all installs after initial installation with the exception of certain dual-life modules on very old perls.

Leont commented 1 week ago

Is it possible to also ask the Perl to omit the versions/platforms from the installation paths? e.g. omit 5.40.0/x86_64-linux from $PREFIX/lib/perl5/site_perl/5.40.0/x86_64-linux/ and from $PREFIX/lib/perl5/5.40.0/x86_64-linux/auto/?

Yeah, this is described in the INSTALL file under Installation Directories