perl5 icon indicating copy to clipboard operation
perl5 copied to clipboard

0351a629e7 led to build-time failure in Class-MethodCache

Open jkeenan opened this issue 1 year ago • 2 comments

The rather obscure and little tested CPAN distribution Class-MethodCache at some point began to experience build-time failures on CPANtesters. First failure report. Excerpt of failure output:

cp lib/Class/MethodCache.pm blib/lib/Class/MethodCache.pm
Running Mkbootstrap for MethodCache ()
chmod 644 "MethodCache.bs"
"/home/cpan/bin/perl/bin/perl5.40.0" -MExtUtils::Command::MM -e 'cp_nonempty' -- MethodCache.bs blib/arch/auto/Class/MethodCache/MethodCache.bs 644
"/home/cpan/bin/perl/bin/perl5.40.0" "/home/cpan/bin/perl/lib/5.40.0/ExtUtils/xsubpp"  -typemap '/home/cpan/bin/perl/lib/5.40.0/ExtUtils/typemap'  MethodCache.xs > MethodCache.xsc
Please specify prototyping behavior for MethodCache.xs (see perlxs manual)
mv MethodCache.xsc MethodCache.c
cc -c   -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O2   -DVERSION=\"0.05\" -DXS_VERSION=\"0.05\" -fPIC "-I/home/cpan/bin/perl/lib/5.40.0/x86_64-linux/CORE"   MethodCache.c
rm -f blib/arch/auto/Class/MethodCache/MethodCache.so
cc  -shared -O2 -L/usr/local/lib -fstack-protector-strong  MethodCache.o  -o blib/arch/auto/Class/MethodCache/MethodCache.so  \
      \
  
/usr/bin/ld: MethodCache.o: in function `XS_Class__MethodCache_mro_isa_changed_in':
MethodCache.c:(.text+0xd8): undefined reference to `Perl_mro_isa_changed_in'
/usr/bin/ld: blib/arch/auto/Class/MethodCache/MethodCache.so: hidden symbol `Perl_mro_isa_changed_in' isn't defined
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make: *** [Makefile:475: blib/arch/auto/Class/MethodCache/MethodCache.so] Error 1

Bisection pointed to 0351a629e71de127cbfd1.

0351a629e71de127cbfd1b142e9eaa6069deabf5 is the first bad commit
commit 0351a629e71de127cbfd1b142e9eaa6069deabf5
Author: Tomasz Konojacki <[email protected]>
Date:   Sat Jun 18 07:26:58 2022 +0200
Commit:     Tomasz Konojacki <[email protected]>
CommitDate: Sat Jun 18 08:51:14 2022 +0200

    hide private functions with __attribute__((visibility("hidden")))

    This allows us to enforce API boundaries and potentially enables
    compiler optimisations.

@xenu, can you take a look? Does anyone else recall seeing this kind of build-time failure?

jkeenan avatar Aug 20 '24 02:08 jkeenan

The rather obscure and little tested CPAN distribution Class-MethodCache at some point began to experience build-time failures on CPANtesters. First failure report. Excerpt of failure output:

cp lib/Class/MethodCache.pm blib/lib/Class/MethodCache.pm
Running Mkbootstrap for MethodCache ()
chmod 644 "MethodCache.bs"
"/home/cpan/bin/perl/bin/perl5.40.0" -MExtUtils::Command::MM -e 'cp_nonempty' -- MethodCache.bs blib/arch/auto/Class/MethodCache/MethodCache.bs 644
"/home/cpan/bin/perl/bin/perl5.40.0" "/home/cpan/bin/perl/lib/5.40.0/ExtUtils/xsubpp"  -typemap '/home/cpan/bin/perl/lib/5.40.0/ExtUtils/typemap'  MethodCache.xs > MethodCache.xsc
Please specify prototyping behavior for MethodCache.xs (see perlxs manual)
mv MethodCache.xsc MethodCache.c
cc -c   -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O2   -DVERSION=\"0.05\" -DXS_VERSION=\"0.05\" -fPIC "-I/home/cpan/bin/perl/lib/5.40.0/x86_64-linux/CORE"   MethodCache.c
rm -f blib/arch/auto/Class/MethodCache/MethodCache.so
cc  -shared -O2 -L/usr/local/lib -fstack-protector-strong  MethodCache.o  -o blib/arch/auto/Class/MethodCache/MethodCache.so  \
      \
  
/usr/bin/ld: MethodCache.o: in function `XS_Class__MethodCache_mro_isa_changed_in':
MethodCache.c:(.text+0xd8): undefined reference to `Perl_mro_isa_changed_in'
/usr/bin/ld: blib/arch/auto/Class/MethodCache/MethodCache.so: hidden symbol `Perl_mro_isa_changed_in' isn't defined
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make: *** [Makefile:475: blib/arch/auto/Class/MethodCache/MethodCache.so] Error 1

Bisection pointed to 0351a62.

0351a629e71de127cbfd1b142e9eaa6069deabf5 is the first bad commit
commit 0351a629e71de127cbfd1b142e9eaa6069deabf5
Author: Tomasz Konojacki <[email protected]>
Date:   Sat Jun 18 07:26:58 2022 +0200
Commit:     Tomasz Konojacki <[email protected]>
CommitDate: Sat Jun 18 08:51:14 2022 +0200

    hide private functions with __attribute__((visibility("hidden")))

    This allows us to enforce API boundaries and potentially enables
    compiler optimisations.

@xenu, can you take a look? Does anyone else recall seeing this kind of build-time failure?

@xenu ^^

jkeenan avatar Sep 17 '24 12:09 jkeenan

The module is using a function that is not part of the API. 0351a62 just enforced that but isn't the problem.

The real question is «Should that function become API?». I don't have the answer to that though, I'm not sure I see the use-case but I may well be mistaken.

Leont avatar Sep 17 '24 22:09 Leont

Still failing as of v5.41.9-77-g28aeb4ecd4 (Mar 12 2025).

jkeenan avatar Mar 13 '25 10:03 jkeenan

Reported upstream at https://rt.cpan.org/Ticket/Display.html?id=165058. This distribution is currently undermaintained, so I'm going to mark this ticket 'sendToCPAN' and close it in this queue.

jkeenan avatar May 09 '25 01:05 jkeenan