fix(jcpan URI::Find): silence spurious eunicefix and Wide-character warnings#578
Merged
fix(jcpan URI::Find): silence spurious eunicefix and Wide-character warnings#578
Conversation
Two unrelated warnings appeared during `jcpan -t URI::Find`:
1) "Use of uninitialized value in join or string at Module/Build/Base.pm
line 301" during `Build`. Module::Build's fix_shebang_line guards a
call with `... ne ':'`, expecting %Config{eunicefix} to be ':' on
non-EUNICE systems. PerlOnJava's Config.pm was missing the key, so
the guard failed and `do_system(undef, $file)` ran, interpolating
undef. Added `eunicefix => ':'` to Config.pm.
2) "Wide character in print at Test2/Formatter/TAP.pm line 125" while
running tests that print non-ASCII URLs. Two combined causes:
a) open.pm was a no-op stub, so `use open ':std', ':encoding(utf8)'`
did not actually apply layers to STDIN/STDOUT/STDERR. Implemented
a minimal `:std` + layer-spec import that calls binmode().
b) duplicateFileHandle (used by `open $fh, '>&FILENO'`, which
Test2::Util::clone_io invokes) replaced a LayeredIOHandle on the
original handle with a bare DupIOHandle, dropping the layers.
PerlIO::get_layers then returned empty, and clone_io produced a
cloned handle without an :encoding/:utf8 layer. Fixed by
detecting LayeredIOHandle, dup'ing its inner delegate, and
re-wrapping both sides in fresh LayeredIOHandles that share the
same active layers.
After the fixes `jcpan -t URI::Find` is clean (619 tests, PASS, no
warnings) and `make` passes.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
5db0e7c to
1ae187b
Compare
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
jcpan -t URI::Findsucceeds (619 tests pass) but emits two spurious warnings during build and test. This PR removes both.1.
Use of uninitialized value in join or string at Module/Build/Base.pm line 301Module::Build'sfix_shebang_lineends with:On real Perl
$Config{eunicefix}is':'(no-op), so the call is skipped. PerlOnJava's%Configwas missing the key, so the guard evaluatedundef ne ':'(true) anddo_system(undef, $file)was invoked —log_verbose("@cmd\n")then interpolatedundef.Fix: add
eunicefix => ':'tosrc/main/perl/lib/Config.pm.(Side note: PerlOnJava attributed the warning to line 301 of
Base.pm, which was misleading — the actual interpolation is indo_system/log_verbose. That's a pre-existing line-attribution issue, not addressed here.)2.
Wide character in print at Test2/Formatter/TAP.pm line 125(×5)t/Find.t prints non-ASCII URLs (Arabic, Russian, Chinese). Two combined causes:
open.pmwas a no-op stub, souse open ':std', ':encoding(utf8)'didn't actually apply layers to STDIN/STDOUT/STDERR.binmode,duplicateFileHandle(used byopen $fh, '>&FILENO', whichTest2::Util::clone_ioinvokes) replaced the original'sLayeredIOHandlewith a bareDupIOHandle, dropping the layers.PerlIO::get_layers(\*STDOUT)then reported an empty list, andclone_ioproduced a cloned handle without an:encoding/:utf8layer, which then warned on every wide-characterprint.Fixes:
open.pm: parse:std+ layer specs and apply viabinmodetoSTDIN/STDOUT/STDERR.IOOperator.duplicateFileHandle: when the source is aLayeredIOHandle, dup the inner delegate and re-wrap each side in its ownLayeredIOHandlecarrying the same active layers.Test plan
jcpan -t URI::Findis clean (All tests successful. Result: PASS, no warnings, 619 tests).make(full unit-test suite) passes.Generated with Devin