perl-toolchain-gang / local-lib Goto Github PK
View Code? Open in Web Editor NEWlocal::lib - create and use a local lib/ for perl modules with PERL5LIB
License: Other
local::lib - create and use a local lib/ for perl modules with PERL5LIB
License: Other
I am looking for an import option that could be used to activate a given directory only if it exists. The option name could be --activate-if-exists
. A message could be printed if the activation was not done. This message could be suppressed, if the --quiet
option is set too. If this is a reasonable feature, could this be implemented please.
guess_shell will warn with unassigned variable warnings if $SHELL is not set.
Also, if $SHELL is 'tcsh', you get 'sh' style output instead of 'csh' style
Suggested fix:
my $shellbin
= defined $ENV{SHELL}
? ($ENV{SHELL} =~ /([\w.]+)$/)[-1]
: ( ( $^O eq 'MSWin32' && exists $ENV{'!EXITCODE'} )
? 'bash'
: ( ( $^O eq 'MSWin32' && $ENV{PROMPT} && $ENV{COMSPEC} )
? ($ENV{COMSPEC} =~ /([\w.]+)$/)[-1]
: ( ( $^O eq 'MSWin32' && !$ENV{PROMPT} )
? 'powershell.exe'
: 'sh' )));
for ($shellbin) {
return
/t?csh$/ ? 'csh'
: /fish$/ ? 'fish'
: /command(?:\.com)?$/i ? 'cmd'
: /cmd(?:\.exe)?$/i ? 'cmd'
: /4nt(?:\.exe)?$/i ? 'cmd'
: /powershell(?:\.exe)?$/i ? 'powershell'
: 'bourne';
}
}
Hello,
I am working on a system where I do not have root privileges. I am trying to install local::lib so that I can then install other perl modules locally.
I was following the bootstrap instructions and tried the 2 following commands:
perl Makefile.PL --bootstrap
perl Makefile.PL --bootstrap=~/perl5
Both fail with:
Can't locate local/lib.pm in @INC (@INC contains: lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 110.
I am confused as it seems it is then asking for local::lib, which is is precisely what I am trying to install?
Thanks in advance for the help.
When installing local::lib over our suite of perl versions, the latest version of local::lib is failing for perl-5.8.9.
Output from the tests is attached.
local_lib_fail.txt
inc/CPANBootstrapper.pm
uses CPAN::HandleConfig::require_myconfig_or_config()
which did not exist until CPAN v1.86_52.
Please bump the prereq for CPAN
to a slightly higher version.
Powershell has existed on Linux and Mac for a while now, but guess_shelltype
will only give powershell if $^O
is windows.
Powershell can be detected by exists $ENV{PSModulePath}
.
+ cd local-lib-2.000024
+ /usr/bin/make -O -j48 V=1 VERBOSE=1 test
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/bad_variables.t ...... ok
t/carp-mismatch.t ...... ok
t/classmethod.t ........ ok
t/de-dup.t ............. ok
t/lib-core-only.t ...... ok
t/pipeline.t ........... ok
# Failed test 'fish: activate PATH'
# at t/shell.t line 200.
# got: '/tmp/local-lib-shell-NO6umh/bin:/:^/dev/null'
# expected: '/tmp/local-lib-shell-NO6umh/bin:/'
# Failed test 'fish: deactivate PATH'
# at t/shell.t line 208.
# got: '/:^/dev/null:^/dev/null'
# expected: '/'
# Looks like you failed 2 tests of 192.
t/shell.t ..............
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/192 subtests
t/stackable.t .......... ok
t/subroutine-in-inc.t .. ok
t/taint-mode.t ......... ok
Test Summary Report
-------------------
t/shell.t (Wstat: 512 Tests: 192 Failed: 2)
Failed tests: 169, 174
Non-zero exit status: 2
Files=10, Tests=244, 8 wallclock secs ( 0.15 usr 0.04 sys + 4.38 cusr 3.26 csys = 7.83 CPU)
Result: FAIL
Failed 1/10 test programs. 2/244 subtests failed.
make: *** [Makefile:825: test_dynamic] Error 255
If make
(or equivalent) isn't installed, bootstrapping will fail mysteriously. I just beat my head into the wall trying to figure out the problem until I remembered that build-essential wasn't installed.
local::lib should check that $Config{make}
is in PATH
and abort with a helpful error.
(Filed on https://rt.cpan.org/Public/Bug/Display.html?id=86120 ages ago, under Module::Install by mistake I don't know why. Re-filing here)
When you setup local::lib on the shell, you'll get environment variables such as:
export PERL5LIB="/Users/miyagawa/perl5/lib/perl5:$PERL5LIB";
suppose you don't have the ~/perl5/lib/perl5 directory yet, and run
perl with that PERL5LIB, your @inc looks like:
@inc:
/Users/miyagawa/perl5/lib/perl5
/Users/miyagawa/.plenv/versions/5.18.0/lib/perl5/site_perl/5.18.0/darwin-2level
...
Once you have installed at least one arch-dependent (XS) module, your
@inc becomes:
@inc:
/Users/miyagawa/perl5/lib/perl5/darwin-2level
/Users/miyagawa/perl5/lib/perl5
/Users/miyagawa/.plenv/versions/5.18.0/lib/perl5/site_perl/5.18.0/darwin-2level
...
If you 'use local::lib' in your code, this isn't an issue since local::lib puts archlib in @inc explicitly. With PERL5LIB, perl doesn't put archlib unless the directory exists :/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.