nysus has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to get Perl::LanguageServer installed on an Alpine docker container. It installs file fine with Debian. The problem is the IO::AIO module. Smoke testing shows the same errors I'm getting:

t/00_load.t ..... ok t/01_stat.t ..... ok t/02_read.t ..... ok t/03_errors.t ... ok t/04_fork.t ..... ok # Test 2 got: "0" (t/05_readdir.t at line 26) # Expected: "1" (Bad file descriptor) # t/05_readdir.t line 26 is: ok (0,1,"$!"); # Failed test 5 in t/05_readdir.t at line 42 # t/05_readdir.t line 42 is: ok (!keys %x); # Failed test 6 in t/05_readdir.t at line 54 # t/05_readdir.t line 54 is: ok (! ! $entries1); # Failed test 7 in t/05_readdir.t at line 61 # t/05_readdir.t line 61 is: ok (! ! $entries2); t/05_readdir.t .. Failed 6/12 subtests t/06_group.t .... ok t/07_feeder.t ... ok
The failing test file with line numbers:
1 #!/usr/bin/perl 2 3 use Test; 4 use IO::AIO; 5 6 # this is a lame test, but.... 7 8 BEGIN { plan tests => 12 } 9 10 my %f; 11 ok ((opendir my $dir, "."), 1, "$!"); 12 $f{$_}++ for readdir $dir; 13 14 my %x = %f; 15 16 aio_readdir ".", sub { 17 delete $x{"."}; 18 delete $x{".."}; 19 if ($_[0]) { 20 ok (1); 21 my $ok = 1; 22 $ok &&= delete $x{$_} for @{$_[0]}; 23 ok ($ok); 24 ok (!scalar keys %x); 25 } else { 26 ok (0,1,"$!"); 27 } 28 }; 29 30 IO::AIO::poll; 31 32 %x = %f; 33 34 aio_scandir ".", 0, sub { 35 delete $x{"."}; 36 delete $x{".."}; 37 if (@_) { 38 ok (1); 39 my $ok = 1; 40 $ok &&= delete $x{$_} for (@{$_[0]}, @{$_[1]}); 41 ok ($ok); 42 ok (!keys %x); 43 } else { 44 ok (0,1,"$!"); 45 } 46 }; 47 48 IO::AIO::poll while IO::AIO::nreqs; 49 50 my $entries1; 51 52 aio_readdirx ".", IO::AIO::READDIR_STAT_ORDER, sub { 53 $entries1 = shift; 54 ok (! ! $entries1); 55 }; 56 57 IO::AIO::poll while IO::AIO::nreqs; 58 59 aio_readdirx ".", IO::AIO::READDIR_STAT_ORDER | IO::AIO::READDI +R_DENTS, sub { 60 my $entries2 = shift; 61 ok (! ! $entries2); 62 63 ok (!grep $entries2->[$_ - 1][2] > $entries2->[$_][2], 1 .. +$#$entries2); 64 65 if ($^O eq "cygwin") { 66 # sigh... 67 $entries1 = [ sort @$entries1 ]; 68 $entries2 = [ sort { $a->[0] cmp $b->[0] } @$entries2 ]; 69 } 70 71 ok ((join "\x00", @$entries1) eq (join "\x00", map $_->[0], +@$entries2)); 72 }; 73 74 IO::AIO::poll while IO::AIO::nreqs; 75 76 ok (1);

Update: I also tried Alpine version 3.19.1 on a virtual box instead of a docker container and I get the exact same results.

$PM = "Perl Monk's";
$MC = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar Parson";
$nysus = $PM . ' ' . $MC;
Click here if you love Perl Monks

Replies are listed 'Best First'.
Re: Trying to figure out why IO::AIO won't build on alpine distro
by kevbot (Vicar) on Feb 16, 2024 at 06:59 UTC
    Which version of perl is installed? I just installed this module on macOS Sonoma using perl 5.38. All the tests passed, but there were warnings during installation. I've included them below. Perhaps there will be some clues in the information provided.
    Configuring IO-AIO-4.8 ... *** *** Canary::Stability COMPATIBILITY AND SUPPORT CHECK *** ================================================= *** *** Hi! *** *** I do my best to provide predictable and reliable software. *** *** However, in recent releases, P5P (who maintain perl) have been *** introducing regressions that are sometimes subtle and at other tim +es *** catastrophic, often for personal preferences with little or no con +cern *** for existing code, most notably CPAN. *** *** For this reason, it has become very hard for me to maintain the le +vel *** of reliability and support I have committed myself to in the past, + at *** least with some perl versions: I simply can't keep up working arou +nd new *** bugs or gratituous incompatibilities, and in turn you might suffer + from *** unanticipated problems. *** *** Therefore I have introduced a support and compatibility check, the + results *** of which follow below, together with a FAQ and some recommendation +s. *** *** This check is just to let you know that there might be a risk, so +you can *** make judgement calls on how to proceed - it will not keep the modu +le from *** installing or working. *** *** The stability canary says: (nothing, it was driven away by harsh w +eather) *** *** It seems you are running perl version 5.038000, likely the "offici +al" or *** "standard" version. While there is nothing wrong with doing that, *** standard perl versions 5.022 and up are not supported by IO::AIO. *** While this might be fatal, it might also be all right - if you run + into *** problems, you might want to downgrade your perl or switch to the *** stability branch. *** *** If everything works fine, you can ignore this message. *** *** *** Stability canary mini-FAQ: *** *** Do I need to do anything? *** With luck, no. While some distributions are known to fail *** already, most should probably work. This message is here *** to alert you that your perl is not supported by IO::AIO, *** and if things go wrong, you either need to downgrade, or *** sidegrade to the stability variant of your perl version, *** or simply live with the consequences. *** *** What is this canary thing? *** It's purpose is to check support status of IO::AIO with *** respect to your perl version. *** *** What is this "stability branch"? *** It's a branch or fork of the official perl, by schmorp, to *** improve stability and compatibility with existing modules. *** *** How can I skip this prompt on automated installs? *** Set PERL_CANARY_STABILITY_NOPROMPT=1 in your environment. *** More info is in the Canary::Stability manpage. *** *** Long version of this FAQ: http://stableperl.schmorp.de/faq.html *** Stability Branch homepage: http://stableperl.schmorp.de/ ***
      5.38.3

      $PM = "Perl Monk's";
      $MC = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate Priest Vicar Parson";
      $nysus = $PM . ' ' . $MC;
      Click here if you love Perl Monks