Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

activating lib root writes full PATH etc into init file #216

Closed
haarg opened this issue Jul 12, 2012 · 9 comments
Closed

activating lib root writes full PATH etc into init file #216

haarg opened this issue Jul 12, 2012 · 9 comments

Comments

@haarg
Copy link
Contributor

haarg commented Jul 12, 2012

If a lib directory is activated, the PATH and other environment variables are written into the .perlbrew/init file. When starting a new shell, these then overwrite any set prior in the shell's rc file.

@gugod
Copy link
Owner

gugod commented Jul 13, 2012

@Haar, Sorry I don't understand the point you're making here. Can you maybe provide me some steps that demonstrate the issue ?

@Haar
Copy link

Haar commented Jul 13, 2012

Typo there, wrong person :).

@haarg
Copy link
Contributor Author

haarg commented Jul 13, 2012

If you install and switch to a normal perl version, the init file, which is sourced by the bashrc file, looks like this:
export PERLBREW_MANPATH="/Users/gknop/perl5/perlbrew/perls/perl-5.16.0/man"
export PERLBREW_PERL="perl-5.16.0"
export PERLBREW_VERSION="0.44"
export PERLBREW_PATH="/Users/gknop/perl5/perlbrew/bin:/Users/gknop/perl5/perlbrew/perls/perl-5.16.0/bin"
export PERLBREW_ROOT="/Users/gknop/perl5/perlbrew"

If you activate a local::lib path, as created with the perlbrew lib command, it looks like this:
export PERLBREW_PERL="perl-5.16.0"
export PERLBREW_VERSION="0.44"
export PERL_MB_OPT="--install_base /Users/gknop/.perlbrew/libs/perl-5.16.0@base"
export PERL_LOCAL_LIB_ROOT="/Users/gknop/.perlbrew/libs/perl-5.16.0@base"
export PERL_MM_OPT="INSTALL_BASE=/Users/gknop/.perlbrew/libs/perl-5.16.0@base"
export PERL5LIB="/Users/gknop/.perlbrew/libs/perl-5.16.0@base/lib/perl5/darwin-thread-multi-2level:/Users/gknop/.perlbrew/libs/perl-5.16.0@base/lib/perl5:/Users/gknop/.local-lib/lib/perl5/darwin-thread-multi-2level:/Users/gknop/.local-lib/lib/perl5"
export PATH="/Users/gknop/perl5/perlbrew/bin:/Users/gknop/perl5/perlbrew/perls/perl-5.16.0/bin:/Users/gknop/bin:/Users/gknop/Library/Python/2.7/bin:/Users/gknop/.gem/ruby/1.8/bin:/usr/local/mysql/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin"
export PERLBREW_MANPATH="/Users/gknop/.perlbrew/libs/perl-5.16.0@base/man:/Users/gknop/perl5/perlbrew/perls/perl-5.16.0/man"
export PERLBREW_LIB="base"
export PERLBREW_PATH="/Users/gknop/.perlbrew/libs/perl-5.16.0@base/bin:/Users/gknop/perl5/perlbrew/bin:/Users/gknop/perl5/perlbrew/perls/perl-5.16.0/bin"
export PERLBREW_ROOT="/Users/gknop/perl5/perlbrew"

This file is sourced during the bashrc file, which means any changes prior to sourcing it are wiped out.

@gugod
Copy link
Owner

gugod commented Jul 13, 2012

On 2012/7/13, at 下午4:07, Graham Knop wrote:

If you activate a local::lib path, as created with the perlbrew lib command, it looks like this:
export PERLBREW_PERL="perl-5.16.0"
export PERLBREW_VERSION="0.44"
export PERL_MB_OPT="--install_base /Users/gknop/.perlbrew/libs/perl-5.16.0@base"
export PERL_LOCAL_LIB_ROOT="/Users/gknop/.perlbrew/libs/perl-5.16.0@base"
export PERL_MM_OPT="INSTALL_BASE=/Users/gknop/.perlbrew/libs/perl-5.16.0@base"
export PERL5LIB="/Users/gknop/.perlbrew/libs/perl-5.16.0@base/lib/perl5/darwin-thread-multi-2level:/Users/gknop/.perlbrew/libs/perl-5.16.0@base/lib/perl5:/Users/gknop/.local-lib/lib/perl5/darwin-thread-multi-2level:/Users/gknop/.local-lib/lib/perl5"
export PATH="/Users/gknop/perl5/perlbrew/bin:/Users/gknop/perl5/perlbrew/perls/perl-5.16.0/bin:/Users/gknop/bin:/Users/gknop/Library/Python/2.7/bin:/Users/gknop/.gem/ruby/1.8/bin:/usr/local/mysql/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin"
export PERLBREW_MANPATH="/Users/gknop/.perlbrew/libs/perl-5.16.0@base/man:/Users/gknop/perl5/perlbrew/perls/perl-5.16.0/man"
export PERLBREW_LIB="base"
export PERLBREW_PATH="/Users/gknop/.perlbrew/libs/perl-5.16.0@base/bin:/Users/gknop/perl5/perlbrew/bin:/Users/gknop/perl5/perlbrew/perls/perl-5.16.0/bin"
export PERLBREW_ROOT="/Users/gknop/perl5/perlbrew"

This file is sourced during the bashrc file, which means any changes prior to sourcing it are wiped out.

True. But that's the coded and intended behavior. What trouble or issue are you exactly dealing with ?

Cheers,
Kang-min Liu

@haarg
Copy link
Contributor Author

haarg commented Jul 16, 2012

It's a problem because it is overwriting the PATH instead of adding to it.

If your bashrc makes any changes to PATH before sourcing the perlbrew rc file, they are overwritten. Additions to PATH after sourcing the rc file get written to the init file, so the next time they are added they add duplicate entries.

The direct case I ran into was a bug in my bashrc file, and after fixing it I couldn't get the fix to apply until after I tracked it down to perlbrew overwriting my changes.

@gugod
Copy link
Owner

gugod commented Jul 17, 2012

@haarg,

Ah, right. I see the problem now. It looks like PATH, PERL5LIB, and PERL_* should all be removed from there.

@rjbs
Copy link
Contributor

rjbs commented Jul 31, 2012

I just hit this bug. I updated my $PATH in .zshrc and it kept getting re-ordered the old way. I was so confused until I started tracing everything. I am excited to see that it's already been identified as a problem!

@haarg
Copy link
Contributor Author

haarg commented Apr 3, 2013

It looks to me like this has been fixed.

@gugod
Copy link
Owner

gugod commented Apr 6, 2013

@haarg Thanks for the write up. Closing this issue.

@gugod gugod closed this as completed Apr 6, 2013
jperkin pushed a commit to TritonDataCenter/pkgsrc-legacy that referenced this issue Dec 9, 2013
Upstream changes:
0.54: # 2012-10-24T21:21:25+0200
- Now requires perl 5.8.8
- Fix an issue with list-module command listing extra modules See GH #245
- Tweak default Configure options for pre-5.6 versions
- Fix an issue with warning messagse in 'upgrade-perl' command.

0.53: # 2012-10-14T17:41:17+0200
- New command: `info`.
- requires CPAN::Perl::Releases 0.76 for 5.14.3 info.
- Skip "." in @inc to deal with a `list-module` issue. GH #245.
- Environment variable cleanups and minor bashrc rewrite.

0.52: # 2012-10-04T21:30:40+0200
- userelocatableinc is no longer default. Meanwhile PERLBREW_CONFIGURE_FLAGS can still be used.
- Fix GH #197 again. Also make sure perlbrew-unrelated PERL5LIB values are preserved.
- Fix an issue that MANPATH contains unwanted values even after switch/use/off.

0.51: # 2012-09-29T09:17:14+0200
- Fix a start-up warning message from bashrc when perlbrew is not active
- Fix a breakage on CentOS due to the use of `manpath` command.

0.50: # 2012-09-01T11:25:41+0200
- properly remove perlbrew-related PERL5LIB entries. GH #197
- minor documentation tweak.

0.49: # 2012-08-25T22:32:22+0200
- Fix the build for perl-5.12 and 5.14 -- userelocatableinc are not working properly. gugod/App-perlbrew#232

0.48: # 2012-08-24T07:07:52+0200
- The build log output "build.log" is now named after the installation name for eaiser reference.
- Fix the invokation configure command to actually contains -Duserelocatableinc
- Experimental: bash/zsh users may put this to shell init instead: eval "$(~/perl5/perlbrew/bin/perlbrew init -)"
- A few output message updates

0.47: # 2012-08-23T07:59:53+0200
- New command: download.
- New env var: PERLBREW_CONFIGURE_FLAGS
- userelocatableinc is enabled by default when the installing perl version is greater than or equals to 5.8.9. It should make some use cases eaiser. In particular, you can move PERLBREW_ROOT directory to another place.
- fix gugod/App-perlbrew#216 for bash users and zsh users

0.46:
- fix: The deprecation warning when running `self-upgrde`
- fix: system MANPATH detection
- improvement: Specifying multiple perl: `exec --with perl-5.14.2,perl-5.16.0`

0.45:
- New command: install-ack . This install the standalone version of ack under $PERLBREW_ROOT/bin
- New command: list-modules
- `exec` command now also iterates thourgh all the libs
- Documented the `--with` argument of exec command. See `perlbrew help exec`

0.44:
- Notice: "self-install" command now alters the shebang to use system perl
- Notice: "install-patchperl" command now alters the shebang to use system perl.
- some documentation tweaks
- fix: `perlbrew use` to/from a lib has not been working properly.

0.43:
- cpantester-error fixes
- csh support. Big thanks to matzsoft.
- support 'fetch' command on FreeBSD.
- Fix a bug that perlbrew failed to resolve version number when dist path contain "perl5"

0.42:
- Improvement: die when running perlbrew (use|switch) with unknown installation name.
- clean 'build.log' on install. ref: RT #69168.
jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Oct 11, 2014
Upstream changes:
0.54: # 2012-10-24T21:21:25+0200
- Now requires perl 5.8.8
- Fix an issue with list-module command listing extra modules See GH #245
- Tweak default Configure options for pre-5.6 versions
- Fix an issue with warning messagse in 'upgrade-perl' command.

0.53: # 2012-10-14T17:41:17+0200
- New command: `info`.
- requires CPAN::Perl::Releases 0.76 for 5.14.3 info.
- Skip "." in @inc to deal with a `list-module` issue. GH #245.
- Environment variable cleanups and minor bashrc rewrite.

0.52: # 2012-10-04T21:30:40+0200
- userelocatableinc is no longer default. Meanwhile PERLBREW_CONFIGURE_FLAGS can still be used.
- Fix GH #197 again. Also make sure perlbrew-unrelated PERL5LIB values are preserved.
- Fix an issue that MANPATH contains unwanted values even after switch/use/off.

0.51: # 2012-09-29T09:17:14+0200
- Fix a start-up warning message from bashrc when perlbrew is not active
- Fix a breakage on CentOS due to the use of `manpath` command.

0.50: # 2012-09-01T11:25:41+0200
- properly remove perlbrew-related PERL5LIB entries. GH #197
- minor documentation tweak.

0.49: # 2012-08-25T22:32:22+0200
- Fix the build for perl-5.12 and 5.14 -- userelocatableinc are not working properly. gugod/App-perlbrew#232

0.48: # 2012-08-24T07:07:52+0200
- The build log output "build.log" is now named after the installation name for eaiser reference.
- Fix the invokation configure command to actually contains -Duserelocatableinc
- Experimental: bash/zsh users may put this to shell init instead: eval "$(~/perl5/perlbrew/bin/perlbrew init -)"
- A few output message updates

0.47: # 2012-08-23T07:59:53+0200
- New command: download.
- New env var: PERLBREW_CONFIGURE_FLAGS
- userelocatableinc is enabled by default when the installing perl version is greater than or equals to 5.8.9. It should make some use cases eaiser. In particular, you can move PERLBREW_ROOT directory to another place.
- fix gugod/App-perlbrew#216 for bash users and zsh users

0.46:
- fix: The deprecation warning when running `self-upgrde`
- fix: system MANPATH detection
- improvement: Specifying multiple perl: `exec --with perl-5.14.2,perl-5.16.0`

0.45:
- New command: install-ack . This install the standalone version of ack under $PERLBREW_ROOT/bin
- New command: list-modules
- `exec` command now also iterates thourgh all the libs
- Documented the `--with` argument of exec command. See `perlbrew help exec`

0.44:
- Notice: "self-install" command now alters the shebang to use system perl
- Notice: "install-patchperl" command now alters the shebang to use system perl.
- some documentation tweaks
- fix: `perlbrew use` to/from a lib has not been working properly.

0.43:
- cpantester-error fixes
- csh support. Big thanks to matzsoft.
- support 'fetch' command on FreeBSD.
- Fix a bug that perlbrew failed to resolve version number when dist path contain "perl5"

0.42:
- Improvement: die when running perlbrew (use|switch) with unknown installation name.
- clean 'build.log' on install. ref: RT #69168.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants