Restore pre-Path::Tiny HasLocation upward traversal semantics#1782
Restore pre-Path::Tiny HasLocation upward traversal semantics#1782
Conversation
A regression in app root detection was introduced by the `Path::Tiny` migration in `Dancer2::Core::Role::HasLocation`. When walking up parent directories to find an app root (`lib`+`bin` or `.dancer`), switching to `$subdir->parent` changed behavior for relative paths (notably `.`), which could stop effective upward traversal and lead to incorrect root selection on some systems. Fix by restoring pre-migration traversal behavior: * advance with `Path::Tiny::path($subdir, '..')` each iteration * stop at filesystem root via absolute-path comparison This keeps existing caller semantics intact while fixing template/public/config resolution failures caused by misdetected app location.
|
On my machine this fails a lot of tests still, seems to be the same failures as reported in the CI |
|
Hmm... Okay. I need to figure out how to reproduce it. |
PR Review — Restore pre-Path::Tiny HasLocation upward traversal semanticsThe diagnosis is correct: 🔴 Blocking1. CI test failures reported and unresolved ( Specifically, the blib guard Recommend: run the full test suite, capture the failures, and verify whether the 🟡 Important1. Unexplained switch from realpath to absolute (
If the intent is to avoid a potential Checklist
SummaryThe diagnosis is correct: Automated review by Kōan |
The test failures may be related to how This matters because the blib guard on line 72 ( A potential fix: resolve $subdir = Path::Tiny::path( $subdir, '..' )->realpath;This preserves the upward-walking fix while keeping |
To reproduce, try running the test suite with the patch applied — @Grinnz confirms the failures match CI. A likely culprit is the blib regex on line 72 and possibly the $subdir = Path::Tiny::path( $subdir, '..' )->realpath;This would fix the |
A regression in app root detection was introduced by the
Path::Tinymigration inDancer2::Core::Role::HasLocation.When walking up parent directories to find an app root (
lib+binor.dancer), switching to$subdir->parentchanged behavior for relative paths (notably.), which could stop effective upward traversal and lead to incorrect root selection on some systems.Fix by restoring pre-migration traversal behavior:
Path::Tiny::path($subdir, '..')each iterationThis keeps existing caller semantics intact while fixing template/public/config resolution failures caused by misdetected app location.