fix: honour $LIBRARY_PATH in _unix_os2_ext() library search#483
Draft
Koan-Bot wants to merge 1 commit intoPerl-Toolchain-Gang:masterfrom
Draft
fix: honour $LIBRARY_PATH in _unix_os2_ext() library search#483Koan-Bot wants to merge 1 commit intoPerl-Toolchain-Gang:masterfrom
Koan-Bot wants to merge 1 commit intoPerl-Toolchain-Gang:masterfrom
Conversation
ExtUtils::Liblist::ext() on Unix/OS2 only searched Config{libpth}
(set at Perl build time) plus explicit -L flags, ignoring
$LIBRARY_PATH and similar environment variables that GCC and other
build tools respect. This caused modules like Term::Readline::Gnu
to pick up old system libraries instead of a newer version installed
to a custom prefix.
* Prepend $LIBRARY_PATH (colon-separated) to @libpath in
_unix_os2_ext() so user-configured paths take priority over
Config{libpth}. Explicit -L flags in LIBS still rank highest.
* Add two tests covering single-path and multi-path LIBRARY_PATH.
* Document the LIBRARY_PATH environment variable in Liblist.pm pod.
Win32 already handled $ENV{LIBRARY_PATH} when gcc was in use; this
change brings the Unix/OS2 code path to the same level.
Fixes Perl-Toolchain-Gang#471
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ExtUtils::Liblist::ext()on Unix/OS2 only searchedConfig{libpth}(set at Perl build time) plus explicit-Lflags, ignoring$LIBRARY_PATHand similar environment variables that GCC and other build tools respect. This caused modules likeTerm::Readline::Gnuto pick up old system libraries instead of a newer version installed to a custom prefix.Fixes #471
Changes
$LIBRARY_PATH(colon-separated) to@libpathin_unix_os2_ext()so user-configured paths take priority overConfig{libpth}. Explicit-Lflags inLIBSstill rank highest.LIBRARY_PATHentries.LIBRARY_PATHenvironment variable inLiblist.pmpod under a newENVIRONMENTsection.Note: Win32 already honoured
$ENV{LIBRARY_PATH}when GCC was in use; this change brings the Unix/OS2 code path to the same level.Test plan
perl -Ilib t/Liblist_Kid.t— all 21 tests pass including the two new onesperl -Ilib t/Liblist.t— all 6 tests passperl -Ilib t/MM_Unix.t— no regressions (118 tests pass)Generated by Kōan /fix
Quality Report
Changes: 3 files changed, 43 insertions(+)
Code scan: clean
Tests: skipped
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline