Skip to content

Make NetAddr::IP pure-Perl build work under synthetic MakeMaker #1126

Description

@fglock

Summary

NetAddr-IP 4.079 has a documented pure-Perl implementation, but jcpan -t NetAddr::IP::Util does not install it correctly. PerlOnJava rejects the distribution's Util_IS.pm generator and then copies that Makefile.PL source into NetAddr/IP/Util_IS.pm, leaving every top-level test unable to load NetAddr::IP.

This should not require an XS port: the upstream -noxs build is complete and passes under system Perl.

CPAN tester result

Archived run: 20260825-173204-22576

Distribution: MIKER/NetAddr-IP-4.079.tar.gz

Requested module: NetAddr::IP::Util

PerlOnJava result:

syntax error at Makefile.PL line 103, near "(sh)"
PerlOnJava MakeMaker: subdir Util configure failed
...
syntax error at blib/lib/NetAddr/IP/Util_IS.pm line 103, near "(sh)"
Files=32, Tests=116
Result: FAIL
Failed 32/32 test programs. 18/116 subtests failed.

The synthetic MakeMaker output shows the incorrect mapping directly:

Lite/Util/Makefile.PL -> .../NetAddr/IP/Util_IS.pm

The failed subdirectory configuration is not treated as fatal, so the parent build and tests continue with a malformed runtime module.

System Perl baseline

The documented pure-Perl configuration succeeds:

perl Makefile.PL -noxs
make test

All three nested suites pass:

NetAddr::IP::Util: Files=39, Tests=1528, Result: PASS
NetAddr::IP::Lite: Files=73, Tests=3651, Result: PASS
NetAddr::IP: Files=32, Tests=9538, Result: PASS

Total: 144 test programs and 14,717 tests passing under system Perl.

Diagnosis

Lite/Util/Makefile.PL generates Util_IS.pm and contains this syntax in its compiler-detection fallback:

system$Config(sh), 'configure.cc';

System Perl accepts the file (perl -c reports syntax OK), while PerlOnJava rejects it at compile time. In a correctly propagated -noxs build, the branch is not executed, but the source must still parse so that the generator can create a valid Util_IS.pm reporting pure-Perl mode.

There are therefore two related failure modes to address:

  1. The pure-Perl -noxs configuration must be selected and propagated through the nested distribution, and the generator must compile under PerlOnJava (or receive a targeted compatibility patch).
  2. Synthetic MakeMaker must not install a generator source as its generated .pm output or continue successfully after the generator's subdirectory configuration failed.

Ecosystem impact

The targeted MetaCPAN dependency lookup reports:

  • NetAddr::IP: 43 unique reverse dependants, 11 recent dependants. Examples include App-Netdisco, SNMP-Info, Mail-SPF, Mail-SpamAssassin, and Data-Validate-IP.
  • NetAddr::IP::Util: 5 direct reverse dependants. Examples include Net-Nmsg, NetAddr-IP-FastNew, NetAddr-IP-LazyInit, IP-Decimal, and Net-DNS-ToolKit.

Suggested acceptance criteria

  • jcpan -t NetAddr::IP::Util uses the distribution's pure-Perl implementation without compiling XS.
  • Util_IS.pm is generated as a module and reports pure-Perl mode; Makefile.PL is never copied in its place.
  • A failed nested generator/configuration step fails the overall configure phase instead of producing a broken installation.
  • Add focused regression coverage for the accepted generator syntax and/or the synthetic MakeMaker generated-file behavior.
  • The NetAddr-IP 4.079 test suites pass under PerlOnJava in -noxs mode.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions