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
Test #11 in t/Plack/Util/load.t fails in one of my environments.
That environment uses a sitecustomize.pl file that happens to load FindBin. Beyond loading FindBin, in this particular situation the sitecustomize.pl file is a no-op.
The problem seems to be that _load_sandbox, which is called by load_psgi tries to fake out "FindBin etc." by locally setting $0.
If FindBin's init sub has already been called (e.g. by a call to use elsewhere) then this fakery is insufficient. (See the known issues section of the FindBin man page).
The test can be made to pass in my environment changing t/Plack-Util/bin/findbin.psgi to include a call to FindBin::again() after the use FindBin statement.
This behavior of load_psgi, resetting $0 and @ARGV, does not seem to be documented in the Plack::Util::load_psgi documentation. If it is supported behavior then perhaps it should be described in the documentation and a warning included about this failure mode.
The text was updated successfully, but these errors were encountered:
# app.psgiuse FindBin;
FindBin::again();
use lib "$FindBin::Bin/lib";
use MyApp;
MyApp->psgi_app;
This follows the advice given in the KNOWN-ISSUES section of the FindBin docs.
In particular, it would be great if the Plack test case followed this practice so that automated tools (e.g. Carton, Pinto) can be installed without intervention.
Test #11 in
t/Plack/Util/load.t
fails in one of my environments.That environment uses a
sitecustomize.pl
file that happens to load FindBin. Beyond loading FindBin, in this particular situation thesitecustomize.pl
file is a no-op.The problem seems to be that
_load_sandbox
, which is called byload_psgi
tries to fake out "FindBin etc." by locally setting$0
.If FindBin's init sub has already been called (e.g. by a call to
use
elsewhere) then this fakery is insufficient. (See the known issues section of the FindBin man page).The test can be made to pass in my environment changing
t/Plack-Util/bin/findbin.psgi
to include a call toFindBin::again()
after theuse FindBin
statement.This behavior of
load_psgi
, resetting$0
and@ARGV
, does not seem to be documented in thePlack::Util::load_psgi
documentation. If it is supported behavior then perhaps it should be described in the documentation and a warning included about this failure mode.The text was updated successfully, but these errors were encountered: