Comments (16)
Would it be a problem to add the arch directory to @INC
before it exists?
from local-lib.
Not a problem at all for regular perl programs, since non-existent directories will be just skipped.
But the issue here is that local::lib only sets PERL5LIB
. Adding an arch directory to @INC
is completely up to perl itself.
> mkdir /tmp/perl5
> PERL5LIB=/tmp/perl5 perl -V
...
@INC:
/tmp/perl5
/Users/miyagawa/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/darwin-2level
/Users/miyagawa/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1
/Users/miyagawa/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level
/Users/miyagawa/.plenv/versions/5.20.1/lib/perl5/5.20.1
.
> mkdir /tmp/perl5/darwin-2level
> PERL5LIB=/tmp/perl5 perl -V
...
@INC:
/tmp/perl5/darwin-2level
/tmp/perl5
/Users/miyagawa/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1/darwin-2level
/Users/miyagawa/.plenv/versions/5.20.1/lib/perl5/site_perl/5.20.1
/Users/miyagawa/.plenv/versions/5.20.1/lib/perl5/5.20.1/darwin-2level
/Users/miyagawa/.plenv/versions/5.20.1/lib/perl5/5.20.1
.
from local-lib.
Note that this is only an issue when modules are loaded mid way through a perl process running. I think just creating the directory is reasonable though.
from local-lib.
Correct - cpanm is a very special use case for this because it installs modules in the middle of the same perl process :) And so cpanm has a workaround for it.
from local-lib.
this is why local::lib used to put the arch dir in PERL5LIB explicitly; I think somebody insisted on removing that to "clean things up".
We should either revert the behaviour or create the directory.
from local-lib.
this is why local::lib used to put the arch dir in PERL5LIB explicitly; I think somebody insisted on removing that to "clean things up".
Sounds right. cdd450c fixes RT 67871
We should either revert the behaviour or create the directory.
+1 either would be fine for me.
from local-lib.
+1 to either one from me too.
from local-lib.
As the requestor of RT 67871, I'm in favor of creating the directories.
If creating the directories fails because of filesystem permissions (for example if a readonly local::lib dir is used), just ignore the failure, because CPAN clients will not be more able to write there.
from local-lib.
we used to scaffold a bunch of stuff anyway, mostly so we had somewhere to write .modulebuildrc - but when PERL_MB_OPT came around, we stopped doing that.
the thing is, people can setup a local::lib with intent to -use- it but no expectation that the filesystem will be modified until they ask for it
cpanminus knows it's planning to write though - so maybe we need a --scaffold-directories option to the local::lib import that it can pass to explicitly ask for that?
from local-lib.
the thing is, people can setup a local::lib with intent to -use- it but no expectation that the filesystem will be modified until they ask for it
I don't understand -- if I do perl -Mlocal::lib=foo -e1
the foo
directory is created. But you're saying the intent is that it should not be?
from local-lib.
if we're creating the 'foo' directory, we might as well create foo/lib/perl5 and foo/lib/perl5/$arch
I'm sort of wondering if we should have a 'create everything' -and- a 'create nothing' mode, but maybe the latter is just 'use lib'
from local-lib.
@miyagawa you mean reverting that commit fixes it?
@dolmen heh, I note you're the one who removed the arch dir in the first place
@haarg thoughts on maybe creating lib/perl5, arch and version dirs (if we're doing version dirs), and maybe bin as well? given we're already creating the root, producing a skeleton tree in there might actually be more DWIM
from local-lib.
I think we should create the appropriate directories under the local lib dir. I have some code in progress for this. We already have a --no-create option to prevent creating the local lib directory.
from local-lib.
I think we should create the appropriate directories under the local lib dir.
+1
from local-lib.
if we're creating the 'foo' directory, we might as well create foo/lib/perl5 and foo/lib/perl5/$arch
That's what I meant with the original ticket here, yes.
from local-lib.
Fixed with 2f7bd47 I think.
from local-lib.
Related Issues (9)
- Install local::lib with --bootstrap requires local::lib? HOT 6
- [FEATURE] additional import option
- Check for make program before bootstrapping HOT 1
- Precedence issue with $SHELL, no 'tcsh' love HOT 1
- Prereq for CPAN needs version bump HOT 1
- 2.000022 failing tests for perl-5.8.9 HOT 1
- Detect powershell on Unix
- 2.000024: test suite is failing HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from local-lib.