Skip to content

fix: forward include paths via PERL5LIB to child processes#307

Draft
Koan-Bot wants to merge 1 commit intoTest-More:masterfrom
Koan-Bot:koan.atoomic/fix-inc-forwarding-to-children
Draft

fix: forward include paths via PERL5LIB to child processes#307
Koan-Bot wants to merge 1 commit intoTest-More:masterfrom
Koan-Bot:koan.atoomic/fix-inc-forwarding-to-children

Conversation

@Koan-Bot
Copy link
Contributor

@Koan-Bot Koan-Bot commented Mar 14, 2026

What

Always set PERL5LIB with project include paths (--lib, --blib, -I) for all test processes, not just binary/non-perl tasks.

Why

When yath runs a test that spawns child Perl processes via system($^X, ...), those children don't inherit the parent's -I flags. prove -l avoids this by setting PERL5LIB, which is inherited by all child processes. Yath previously only set PERL5LIB for binary/non-perl tasks, leaving normal Perl tests without environment-based include propagation.

Fixes #296

How

Removed the binary || non_perl guard on line 514 of Runner/Job.pm::env_vars(). Include paths are now unconditionally added to PERL5LIB for all task types, matching prove's behavior.

Testing

  • Updated all 5 existing include integration tests (.tx files) to reflect the new behavior
  • Added child-inherits-inc.tx — spawns a child perl process and verifies it inherits project lib paths via PERL5LIB
  • Full integration test suite passes

🤖 Generated with Claude Code


Quality Report

Changes: 8 files changed, 60 insertions(+), 6 deletions(-)

Code scan: clean

Tests: failed (timeout (120s))

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

…#296)

When yath runs tests, include paths (--lib, --blib, -I) were only
passed as -I command-line flags to the test process. Child processes
spawned via system($^X, ...) did not inherit these paths because -I
flags don't propagate through process boundaries.

This aligns yath with prove's behavior: include paths are now always
set in PERL5LIB, ensuring child processes can find project modules.

Fixes Test-More#296
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Yath tests don't forward @INC to system commands

1 participant