fix: preserve Perl arguments in MakeMaker script wrappers

Đang mở
#2,157 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
62/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
perl, shell
Lĩnh vực
build-system

Hướng nghiên cứu

Start in src/main/perl/lib/ExtUtils/MakeMaker.pm at _shell_fixin and read how the $(PERL) value is interpolated into the exec line of the generated blib/script wrapper. Reproduce by building a small distribution whose PERL is set to an interpreter path plus -Iinc (ideally with a space in the path), then check whether the staged wrapper under blib/script runs. Done means the wrapper invokes the interpreter and its arguments correctly, and a regression test covers both an argument-bearing command and a spaced path. The WWW-Search 2.519 run 20261120-195805-13340 and t/test.t lines 15 and 18 are the reference failure.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area:cpan-port bug

Summary

ExtUtils::MakeMaker::_shell_fixin generates unusable blib/script wrappers when the configured Perl command includes arguments. This caused the WWW-Search 2.519 CPAN test failure in run 20261120-195805-13340.

Reproduction evidence

The archived PerlOnJava Makefile had PERL set to:

PERL = <jperl-path> "-Iinc"

The generated blib/script/WebSearch wrapper contained the equivalent of:

exec "<jperl-path> "-Iinc"" -w "$dir/.WebSearch.perlonjava" "$@"

Because _shell_fixin wraps the entire $(PERL) string in double quotes, the shell treats <jperl-path> -Iinc as one executable name. The shell reports that this command cannot be found. AutoSearch receives the same malformed wrapper.

WWW::Search::Test::find_websearch() probes WebSearch --VERSION; the failed wrapper makes it return false. The first-time and memoized-result checks then fail at t/test.t lines 15 and 18. The failure is in generated command quoting; the test does not require a live search service.

Results

  • Distribution: WWW-Search 2.519.
  • PerlOnJava JVM backend: 149/151 subtests passed; t/test.t failed 2/5 checks because the generated WebSearch wrapper could not execute.
  • Standard Perl: the archived oracle run passed the complete distribution suite, including t/test.t (151 subtests in the PerlOnJava run; standard Perl harness reported all 10 test programs successful).
  • PerlOnJava interpreter backend: not tested.
  • The affected code is src/main/perl/lib/ExtUtils/MakeMaker.pm, helper _shell_fixin, which currently embeds the complete $(PERL) value as a quoted executable instead of preserving it as a command with arguments.

Expected behavior

Generated script wrappers must invoke the configured Perl command correctly when it contains interpreter arguments such as -Iinc. Add focused regression coverage for a path with spaces or command-line arguments, and verify the wrapper can execute a staged script from blib/script.

Verification context

The PerlOnJava failure is archived under CPAN random tester run 20261120-195805-13340, distribution WWW-Search 2.519, failing test t/test.t. The standard Perl oracle result for the same distribution is PASS.

Ngôn ngữ chính
Perl
Star
67
Fork
8
Merge trung bình
5 giờ 12 phút
Pull request đã merge (30 ngày)
131

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của fglock/PerlOnJava

Tất cả issue của fglock/PerlOnJava

Issue tương tự

Thêm issue về Perl

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.