Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perl 5.40.0 hangs forever during building when certain extras packages are specified #22786

Open
vadimkantorov opened this issue Nov 26, 2024 · 7 comments

Comments

@vadimkantorov
Copy link

vadimkantorov commented Nov 26, 2024

Hangs forever in an infinite loop:

name: buildperl

on: workflow_dispatch
env:
  PERLVER: "5.40.0"
  URLPERL: https://www.cpan.org/src/5.0/perl-5.40.0.tar.gz

jobs:
  buildperl:
    runs-on: ubuntu-20.04
    steps:
      - name: Install Perl static
        shell: bash
        run: |
          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 -Uversiononly -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" -Dextras="Mozilla::CA XML::SAX::Exception LWP::Protocol::https" && cd -
          make -C perlsourcestatic
          make -C perlsourcestatic install

In the log the following segment is repeated:


2024-11-26T16:06:28.7994239Z ---- Unsatisfied dependencies detected during ----                                                                 
2024-11-26T16:06:28.7994444Z ----     SULLR/IO-Socket-SSL-2.089.tar.gz     ----                                                                 
2024-11-26T16:06:28.7994595Z     Mozilla::CA [requires]                                                                                         
2024-11-26T16:06:28.8023264Z Running make for module 'Mozilla::CA'                                                                              
2024-11-26T16:06:28.8023686Z   LWP/Mozilla-CA-20240924.tar.gz                                                                                   
2024-11-26T16:06:28.8024259Z   Has already been unwrapped into directory /home/runner/.cpan/build/Mozilla-CA-20240924-0                         
2024-11-26T16:06:28.8024422Z   LWP/Mozilla-CA-20240924.tar.gz                                                                                   
2024-11-26T16:06:28.8024582Z   Has already been prepared                                                                                        
2024-11-26T16:06:28.8024747Z   LWP/Mozilla-CA-20240924.tar.gz                                                                                   
2024-11-26T16:06:28.8024888Z   Has already been made                                                                                            
2024-11-26T16:06:28.8025240Z   SULLR/IO-Socket-SSL-2.089.tar.gz                                                                                 
2024-11-26T16:06:28.8025719Z   Has already been unwrapped into directory /home/runner/.cpan/build/IO-Socket-SSL-2.089-0                         
2024-11-26T16:06:28.8025882Z   SULLR/IO-Socket-SSL-2.089.tar.gz                                                                                 2024-11-
26T16:06:28.8026036Z   Has already been prepared                                                                                        
2024-11-26T16:06:28.8026287Z Running make for S/SU/SULLR/IO-Socket-SSL-2.089.tar.gz                                                             
2024-11-26T16:06:28.8052677Z Warning: Prerequisite 'Net::SSLeay => 1.46' for 'SULLR/IO-Socket-SSL-2.089.tar.gz' failed when processing 'CHRISN/Net-SSLeay-1.94.tar.gz' with 'writemakefile => NO '/home/runner/work/busybiber/busybiber/perlsourcestatic/perl Makefile.PL' returned status 512'. Continuing, but chances to succeed are limited.

Works fine when installing with CPAN binary immediately after the build:

name: buildperl

on: workflow_dispatch
env:
  PERLVER: "5.40.0"
  URLPERL: https://www.cpan.org/src/5.0/perl-5.40.0.tar.gz

jobs:
  buildperl:
    runs-on: ubuntu-20.04
    steps:
      - name: Install Perl static
        shell: bash
        run: |
          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 -Uversiononly -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
          ./perlsourcestatic/perlprefix/bin/perl ./perlsourcestatic/perlprefix/bin/cpan -T Mozilla::CA XML::SAX::Exception LWP::Protocol::https

Hung log (with the repeated segment's many occurrences deleted):
job-logs-hung.txt

How can I add correctly install of certain packages to the build command?
It'd also be awesome if I could somehow produce a versioned list of all dependencies and bake in to the max everything in the Configure command

@jkeenan
Copy link
Contributor

jkeenan commented Nov 27, 2024

I once calculated that the number of different combinations of ./Configure switches for building Perl was greater than the number of atoms in the universe. Hence it is not surprising that some of those combinations do not build cleanly right out of the box.

In particular, I can't recall previous inquiries about the combination of the -Dstatic_ext=...' and -Dextras=.... I would recommend that you fully explore the challenges of working with each of these switches on their own first. That is, make sure that all the modules listed for -Dstatic_ext DWIM before adding extras, and vice versa.

Also, is there a particular objective you have for this kind of Perl configuration? Would that objective be better served by first getting the static_ext module working first and installing the extras in a separate process?

@vadimkantorov
Copy link
Author

vadimkantorov commented Nov 27, 2024

It's surely not the incompat of static_ext with extras as -Dextras="Mozilla::CA" works just fine. It's something about detection of dependencies of some packages being satisfied or processing installation of dependencies of packages requested in extras... What's strange that it all works fine with the same list of packages immediately after with cpan binary...

I have a workaround with installing these packages with cpan just after the perl build, so I am not blocked. The reason I'm looking into this is to simplify the build script and maybe then having a cross-compilation setup of Perl with various packages installation for WebAssembly (Perl/PPCs#61).

@vadimkantorov
Copy link
Author

vadimkantorov commented Nov 27, 2024

I would say, at the very least Perl build should rather fail after a hardcoded reasonable number of attempts rather than continue retrying indefinitely (and eat up CI resources)

@Leont
Copy link
Contributor

Leont commented Nov 27, 2024

I think this would build those modules are dynamic extensions, and I suspect you want static ones. That said, -Dextras is documented in INSTALL as «This will only work if those modules are to be built as dynamic extensions.» so the point may be moot.

@vadimkantorov
Copy link
Author

I still need some of these as dynamic extensions as they are build-time prerequisites for some further manual module builds...

@Leont
Copy link
Contributor

Leont commented Nov 27, 2024

I still need some of these as dynamic extensions as they are build-time prerequisites for some further manual module builds...

I'm not sure that makes sense. Why would you need them to be dynamic, and why would the further ones need to be built manual?

@jkeenan jkeenan changed the title Perl 5.40.0 hangs forever duing building when certain extras packages are specified Perl 5.40.0 hangs forever during building when certain extras packages are specified Nov 27, 2024
@tonycoz
Copy link
Contributor

tonycoz commented Dec 18, 2024

All the hard bits of -Dextras are handled by CPAN.pm and ExtUtils::MakeMaker, I expect they will need to be fixed there. I do know that trying -Dextras=Imager seemed to confuse EU::MM.

If you want to build a dynamic perl with all the core extensions static, you can build with -Ddynamic_ext=none.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants