You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Resolved by merged PR #1879 (merge commit 57b8c18). The new jperl_nested_launch_clean_env.t regression test reproduces the critical EnvDir -clean condition by dropping inherited launcher variables and restricting PATH to a directory without Java, then verifies a nested $^X launch succeeds. The PR CI passed on Windows and Ubuntu.
Activity
fglock commentedon Oct 12, 2026
Additional CPAN verification evidence:
EnvDir-0.08t/10_envdir_pl.t20261011-174632-64969$^Xlaunch failed afterPATHwas restricted to/env/bin, withjava was not found in PATH.Please include
t/10_envdir_pl.tfrom this run in verification after the nested launcher fix.fglock commentedon Oct 24, 2026
Resolved by merged PR #1879 (merge commit 57b8c18). The new jperl_nested_launch_clean_env.t regression test reproduces the critical EnvDir -clean condition by dropping inherited launcher variables and restricting PATH to a directory without Java, then verifies a nested $^X launch succeeds. The PR CI passed on Windows and Ubuntu.