Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 642426 - app-text/po4a-0.47-r1: uspicious environment values found. PERL5LIB="/home/xvilka/.opam/system/lib/perl5
Summary: app-text/po4a-0.47-r1: uspicious environment values found. PERL5LIB="/home/x...
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Perl team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-27 17:59 UTC by Anton Kochkov
Modified: 2019-04-21 19:13 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Kochkov 2017-12-27 17:59:58 UTC
With OCaml and opam installed:

>>> Source prepared.
>>> Configuring source in /var/tmp/portage/app-text/po4a-0.47-r1/work/po4a-0.47 ...
 [31;01m*[0m perl-module.eclass: Suspicious environment values found.
 [31;01m*[0m     PERL5LIB="/home/xvilka/.opam/system/lib/perl5:"
 [31;01m*[0m Your environment settings may lead to undefined behavior and/or build failures.
 [31;01m*[0m ERROR: app-text/po4a-0.47-r1::gentoo failed (configure phase):
 [31;01m*[0m   Please fix your environment ( ~/.bashrc, package.env, ... ), see above for details.
 [31;01m*[0m 
 [31;01m*[0m Call stack:
 [31;01m*[0m     ebuild.sh, line  124:  Called src_configure
 [31;01m*[0m   environment, line 1060:  Called perl-module_src_configure
 [31;01m*[0m   environment, line  583:  Called perl_check_env
 [31;01m*[0m   environment, line  765:  Called die
 [31;01m*[0m The specific snippet of code:
 [31;01m*[0m       die "Please fix your environment ( ~/.bashrc, package.env, ... ), see above for details."
 [31;01m*[0m 
 [31;01m*[0m If you need support, post the output of `emerge --info '=app-text/po4a-0.47-r1::gentoo'`,
 [31;01m*[0m the complete build log and the output of `emerge -pqv '=app-text/po4a-0.47-r1::gentoo'`.
 [31;01m*[0m The complete build log is located at '/var/tmp/portage/app-text/po4a-0.47-r1/temp/build.log'.
 [31;01m*[0m The ebuild environment file is located at '/var/tmp/portage/app-text/po4a-0.47-r1/temp/environment'.
 [31;01m*[0m Working directory: '/var/tmp/portage/app-text/po4a-0.47-r1/work/po4a-0.47'
 [31;01m*[0m S: '/var/tmp/portage/app-text/po4a-0.47-r1/work/po4a-0.47'
Comment 1 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2017-12-27 22:34:11 UTC
This is perl-module.eclass telling you that your environement (aka: user configuration) is broken such that it will break Perl module installation.

> Please fix your environment ( ~/.bashrc, package.env, ... ), see above for details.


This should not be visible to emerge:

> PERL5LIB="/home/xvilka/.opam/system/lib/perl5

There is likely nothing a gentoo maintainer can do here.
Comment 2 Anton Kochkov 2017-12-29 14:26:24 UTC
(In reply to Kent Fredric (IRC: kent\n) from comment #1)
> This is perl-module.eclass telling you that your environement (aka: user
> configuration) is broken such that it will break Perl module installation.
> 
> > Please fix your environment ( ~/.bashrc, package.env, ... ), see above for details.
> 
> 
> This should not be visible to emerge:
> 
> > PERL5LIB="/home/xvilka/.opam/system/lib/perl5
> 
> There is likely nothing a gentoo maintainer can do here.

The thing is, it's 'opam' who adds this variable in $HOME/.opam/opam-init/variables.sh:

PERL5LIB="/home/xvilka/.opam/system/lib/perl5:$PERL5LIB"; export PERL5LIB;

which is called from $HOME/.opam/opam-init/init.sh
which opam adds in $HOME/.bash_profile when installing.

So this bug should happen on any configuration where opam is installed
Comment 3 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2017-12-30 03:05:09 UTC
(In reply to Anton Kochkov from comment #2)

> The thing is, it's 'opam' who adds this variable in
> $HOME/.opam/opam-init/variables.sh:

"$HOME" and the environment of a given user is "User configuration"

> PERL5LIB="/home/xvilka/.opam/system/lib/perl5:$PERL5LIB"; export PERL5LIB;
> 
> which is called from $HOME/.opam/opam-init/init.sh
> which opam adds in $HOME/.bash_profile when installing.
> 
> So this bug should happen on any configuration where opam is installed

This specific configuration is frequent with people who use dev-perl/local-lib and dev-perl/App-perlbrew, and it is *useful* for specific applications[1], however, the problem is not that end users have this in their user configuration.

The problem is that the way the user invokes emerge allows the variable PERL5LIB to leak from user="THEM" to user=portage

So the question is, how are you invoking emerge? Are you running it as a non-privileged user, etc?

Are you using "sudo emerge", and if so, why is sudo permitting arbitrary ENV pass-through?



1: the intent of this feature is to allow applications, such as opam, or users, to install and manage perl libraries independent from the system Perl, within $HOME. The problem occurs when this mechanism becomes visible in a scope where "work with the system perl" is the intended result, and subsequently, this variable would have otherwise told portage to install PO4A components in $HOME, which would have broken your system.
Comment 4 Anton Kochkov 2018-01-01 15:38:54 UTC
It appears in both su and sudo. Strange. But anyway, worked around with unset.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-01-03 23:14:10 UTC
@perl, I presume you'll deal with this. Feel free to reassign if you believe the package maintainer should do anything here.
Comment 6 Andreas K. Hüttel gentoo-dev 2019-04-21 19:13:40 UTC
(In reply to Michał Górny from comment #5)
> @perl, I presume you'll deal with this. Feel free to reassign if you believe
> the package maintainer should do anything here.

Things are working as intended here.