Skip to content

fix: restore perllibs in Win32 ext(); use :nodefault for multi-LIBS probe#482

Draft
Koan-Bot wants to merge 1 commit intoPerl-Toolchain-Gang:masterfrom
Koan-Bot:koan.atoobot/fix-issue-478
Draft

fix: restore perllibs in Win32 ext(); use :nodefault for multi-LIBS probe#482
Koan-Bot wants to merge 1 commit intoPerl-Toolchain-Gang:masterfrom
Koan-Bot:koan.atoobot/fix-issue-478

Conversation

@Koan-Bot
Copy link

Summary

Commit e04e45f removed perllibs injection from _win32_make_lib_search_list() to fix false positives in multi-LIBS scenarios (RT-53676), moving perllibs handling to MM_Win32::init_others(). This broke all direct callers of ExtUtils::Liblist->ext() — including ExtUtils::Embed::ldopts(), mod_perl2, and PAR::Packer — which no longer receive perllibs in the returned lib list, causing link failures on Windows with perl 5.42.

Fixes #478

Changes

  • lib/ExtUtils/Liblist/Kid.pm: Restore perllibs injection in _win32_make_lib_search_list(), respecting the existing :nodefault flag. This restores the public API contract of ext().
  • lib/ExtUtils/MM_Win32.pm: Wrap the SUPER::init_others call (which runs the multi-LIBS selection loop) with a localized $self->{LIBS} that has :nodefault appended to each entry. This prevents perllibs from making a failing LIBS probe appear to succeed, so fallback to later LIBS entries still works (RT-53676 preserved). Also add :nodefault to the perllibs extliblist() call to prevent self-referential duplication.
  • t/Liblist_Kid.t: Update the test added by e04e45f that incorrectly asserted _ext() should not add perllibs; the correct behavior is that it does (subject to :nodefault).

Test plan

  • perl -Ilib t/Liblist_Kid.t — all 17 tests pass, including multi-LIBS selection and :nodefault behavior
  • perl -Ilib t/Liblist.t — all 6 tests pass
  • perl -Ilib t/basic.t — passes

Generated by Kōan /fix

…S probe

e04e45f removed perllibs injection from _win32_make_lib_search_list() to
fix false positives in multi-LIBS scenarios (RT-53676), moving the perllibs
injection to MM_Win32::init_others(). This broke all direct callers of
ExtUtils::Liblist->ext() (e.g. ExtUtils::Embed::ldopts(), mod_perl2,
PAR::Packer) which no longer received perllibs in the returned lib list,
causing link failures on Windows.

Fix: restore perllibs injection in _win32_make_lib_search_list() (respecting
the existing :nodefault flag), preserving the public API contract of ext().

To keep RT-53676 fixed, MM_Win32::init_others() now wraps the SUPER::init_others
call (which does the multi-LIBS selection loop) with a localized LIBS that has
':nodefault' appended to each entry. This prevents perllibs from making a
failing LIBS probe appear to succeed, so fallback to later LIBS entries still
works correctly. The perllibs extliblist() call in init_others also uses
':nodefault' to avoid perllibs referencing themselves.

Fixes Perl-Toolchain-Gang#478
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

Successfully merging this pull request may close these issues.

ExtUtils::Liblist->ext() is broken on Windows in EU::MM 7.76

1 participant