Skip to content

Dancer2 doesn't include the local ./lib directory by default #481

Closed
sukria opened this Issue Sep 26, 2013 · 16 comments

7 participants

@sukria
PerlDancer member
sukria commented Sep 26, 2013

With Dancer 1, it's possible to do that:

use Dancer;
use SomeApp;
dance;

Where lib/SomeApp.pm exists.

It doesn't work anymore (used to work) with Dancer2. Apparently, it's a deliberate choice: 7ae4eab

The commit message here is not very explicit about the reason why we break that. I'd like to understand the rationale behind.

Was it causing any hurt somewhere?

I think it was a good thing to have and would like to understand why we got rid of it.

Thanks for the clarification (and sorry if I missed an email/discussion about that).

@xsawyerx xsawyerx was assigned Sep 26, 2013
@xsawyerx
PerlDancer member

This is something we've set to revert. It was a mistake. We could push this to be out this weekend.

@azawawi
azawawi commented Sep 26, 2013

Is this related also to #478?

@ambs
PerlDancer member
ambs commented Sep 26, 2013

/me bangs his head.

@sdeseille
@sukria
PerlDancer member
sukria commented Sep 27, 2013

@xsawyerx okay, then let's put it back on stage when we can :)

@sukria
PerlDancer member
sukria commented Sep 28, 2013

Ok, I'll patch that one and release, we need it to be fixed, I just realized it also breaks with a scaffolded app.

@sukria sukria pushed a commit that referenced this issue Sep 28, 2013
Alexis Sukrieh Fix issue #481 - include local lib by default
When the worker starts, it will always add the local ./lib directory in Perl's
loading path.
05e3118
@shadowcat-mst

given app.pl is now doing the 'use lib' I can't see why Dancer2 should do that. Modifying @INC should be explicit - 05e3118 seems like a step back to me, since it means that if I do e.g.

use lib "/some/path/to/my/app";
use Dancer2;
use SomeApp;

in a script, the script could break depending on the current working directory, which seems utterly horrible.

@shumphrey

I concur with @shadowcat-mst seems to me like app.pl is enough. Whilst I realise this breaks existing apps with old app.pl scripts, it seems like 0560955 is the better solution.

@sukria
PerlDancer member
sukria commented Sep 30, 2013

Okay then, let's put that responsibility on the runner script.

Change to be reverted and documented.

@shadowcat-mst
@shumphrey

@sukria 👍

@shadowcat-mst
@sukria sukria pushed a commit that referenced this issue Oct 11, 2013
Alexis Sukrieh Revert "Fix issue #481 - include local lib by default"
This reverts commit 05e3118.
a005076
@xsawyerx
PerlDancer member

Can we now close this?

@shumphrey

👍

@xsawyerx
PerlDancer member
xsawyerx commented Dec 7, 2013

@sukria closable?

@xsawyerx
PerlDancer member

Time to close this.

@xsawyerx xsawyerx closed this Apr 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.