I just had errors like this: >>> Configuring source in /var/tmp/portage/dev-perl/TimeDate-2.300.0/work/TimeDate-2.30 ... * Using ExtUtils::MakeMaker * perl Makefile.PL PREFIX=/usr INSTALLDIRS=vendor INSTALLMAN3DIR=none DESTDIR=/var/tmp/portage/dev-perl/TimeDate-2.300.0/image/ Checking if your kit is complete... Looks good Only one of PREFIX or INSTALL_BASE can be given. Not both. turns out i had this set in my .bashrc: PERL_MB_OPT="--install_base \"/home/lordvan/perl5\""; export PERL_MB_OPT; PERL_MM_OPT="INSTALL_BASE=/home/lordvan/perl5"; export PERL_MM_OPT; (i had no idea this was set anymore) Would be nice to receive a warning that this is set in the user's env.
Given the propensity of this leakage causing installation failures, I would move to have this warning as early as possible, perhaps even pkg_pretend, and make it potentially fatal ( unsure if that is justified entirely though ) Its also worth mentioning the ENV flag is PERL_MM_OPT, and the bad flag is within that, so it possibly also needs some kind of CFLAGS-esque stripping/parsing logic done.
After a long discussion in #gentoo-perl, we've settled with displaying a warning when these 5 variables are already set by the user: PERL_MM_OPT, PERL5LIB, PERL5OPT, PERL_MB_OPT, PERL_CORE. Gotta get a patch out now...
Created attachment 398942 [details, diff] perl-module.eclass.patch Attached is my proposed solution. 1. It reports a general warning if any bad env vars, but only prints that general warning once. 2. It prints each bad ENV var and their value. 3. And only after doing all warnings, does it fatalise. This aims to make it clear from the start *all* bad env vars instead of requiring a fix/die loop for the user.
Created attachment 398944 [details] test failure logic script Attached is the test script I developed the logic with for isolated testing. ( die is intentionally known not supported here, because yolo ) > $ bash test.sh > > $ PERL_MB_OPT="Bad value" bash test.sh > Bad ENV values found. Please unset from ENV ( ~/.bashrc, package.env, etc ) or set I_KNOW_WHAT_IM_DOING=1 > PERL_MB_OPT="Bad value" > test.sh: line 27: die: command not found > > $ PERL_MB_OPT="Bad value" PERL5OPT="Evil" bash test.sh > Bad ENV values found. Please unset from ENV ( ~/.bashrc, package.env, etc ) or set I_KNOW_WHAT_IM_DOING=1 > PERL5OPT="Evil" > PERL_MB_OPT="Bad value" > test.sh: line 27: die: command not found > > $ PERL_MB_OPT="Bad value" PERL5OPT="Evil" I_KNOW_WHAT_IM_DOING=1 bash test.sh > Potentially bad ENV values found but I_KNOW_WHAT_IM_DOING=1 > PERL5OPT="Evil" > PERL_MB_OPT="Bad value" >
Created attachment 398946 [details, diff] perl-module.eclass.patch .... this time fixing tab/space difference.
Created attachment 398948 [details, diff] perl-module.eclass.patch 3rd revision linearising the logic better and reducing the variability of messages, and using die appropriately.
Created attachment 398956 [details, diff] perl-module.eclass.patch Fixed name of function being wrong and bad whitespace at EOL.
Created attachment 398972 [details, diff] updated patch * fix the variable name * make the log priority depend on the circumvention setting * better wording for non-natives * remove the variable name from the docs :)
Created attachment 398984 [details, diff] updated patch, also for bug 495044 * make the if conditionals actually work * improve error output * combine with patch for bug 495044
+ 15 Mar 2015; Andreas K. Huettel <dilfridge@gentoo.org> perl-module.eclass: + Detect dangerous environment variables, bug 543042; support + Module::Build::Tiny directly, bug 495044 +
*** Bug 454450 has been marked as a duplicate of this bug. ***