Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Nested $^X launch fails after EnvDir -clean clears Java launcher environment

Đang mở
#1,465 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 2 ngày

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java, perl
Lĩnh vực
operating-systems

Hướng nghiên cứu

Start with t/10_envdir_pl.t and bin/envdir.pl, then trace how the nested $^X launcher selects Java when EnvDir -clean changes PATH. Add a regression case for nested $^X after environment cleanup, preserving the requested child environment while ensuring the launcher can find Java; the test should pass on PerlOnJava and standard Perl.

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

Mô tả

Summary

The EnvDir distribution fails t/10_envdir_pl.t on PerlOnJava when envdir.pl runs a child $^X after loading EnvDir -clean.

Evidence

  • Distribution: EnvDir-0.08
  • Failing test: t/10_envdir_pl.t
  • CPAN run: 20260921-102914-97159
  • Source: CPAN random tester run 20260921-102914-97159
  • PerlOnJava result: 25/26 tests passed; 1/7 test programs failed
  • Standard Perl oracle: all 26 tests passed

The failing test expects:

FOO=foo
PATH=/env/bin

but the child produces no output and reports:

ERROR: PerlOnJava requires Java 24 or later; java was not found in PATH.

Reproduction

bin/envdir.pl uses:

use EnvDir 'envdir', -clean;

EnvDir -clean clears %ENV and sets PATH=/bin:/usr/bin; the test environment then overrides PATH with /env/bin. This removes the inherited PERLONJAVA_JAVA_BIN value. The child $^X is PerlOnJava's launcher shim, which then cannot locate Java and exits before running the requested child code.

The parent launcher works when PERLONJAVA_JAVA_BIN=/usr/bin/java is explicitly preserved, confirming that the failure is in launching a nested PerlOnJava process from a cleaned/restricted environment rather than in EnvDir's normal variable update behavior.

Expected behavior

A PerlOnJava program should be able to invoke $^X after deliberately modifying or cleaning %ENV, as standard Perl does. The nested launcher should retain or otherwise reliably locate the Java executable without requiring java to remain on the child process's modified PATH.

Suggested direction

Make the nested $^X launcher self-contained with respect to Java selection, or arrange for the selected Java path to survive launcher recursion without violating EnvDir -clean's requested child environment semantics. Add a regression test covering a nested $^X invocation after environment cleanup.

Ngôn ngữ chính
Perl
Star
64
Fork
6
Merge trung bình
5 giờ 33 phút
Pull request đã merge (30 ngày)
170

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.