tokuhirom / plenv

Perl binary manager
Other
512 stars 70 forks source link

cpanm invoked via plenv shim ignores local::lib env variables #154

Open mvgrimes opened 5 years ago

mvgrimes commented 5 years ago

The shim installed by plenv removes the environment variables set by local::lib (with some exceptions). A typical use case for local::lib such as the following doesn't work under plenv:

$ eval $( perl -Mlocal::lib=local )
$ cpanm Some::Module

cpanm now tries to install Some::Module under .plenv/... rather than the ./local directory. It seems this is intentional and was later updated to support perlbrew style libs.

This behavious is surprising and not documented. At a minimum, there should be a means of reverting to the expected behavior (maybe PLENV_RESPECT_LOCAL_LIB).

Thanks!

Grinnz commented 5 years ago

plenv is not compatible with a global local::lib, because these only work for the perl they were installed for. If you want to use a local::lib with plenv perls, try the lib command from plenv-contrib https://github.com/miyagawa/plenv-contrib

krautcat commented 5 years ago

@mvgrimes, could you please say, if changes introduced by me has broken something?

I have tried to fix the things you talk about. I was unsatisfied that shims created by plenv ignore environment variable set by shell for system-wide perl. And while I tried to achieve this I was trying not to break integration with local::lib provided by integration.

If we have some issues with all the cases let's figure out which testcases should be built for non-conflicting combining both system-wide local::lib integration and plenv-esque local::lib integration.