Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#1,465 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java, perl

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Perl
Stelle
64
Fork
7
Merge medio
4h 34m
PR unite (30g)
181

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fglock/PerlOnJava

Tutte le issue di fglock/PerlOnJava

Issue simili

Altre issue su Perl

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.