Skip Menu |
 

This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id: 121665
Status: resolved
Priority: 0/
Queue: CPAN

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.18-TRIAL
Fixed in: (no value)



Subject: PERL_USE_UNSAFE_INC=1 hack does not work for sudo installs
Download (untitled) / with headers
text/plain 659b
The PERL_USE_UNSAFE_INC=1 hack needed for perl 5.26 does not work in some situations: * the "sudo" install option is used (i.e. 'make_install_make_command' => q[sudo make], 'mbuild_install_build_command' => q[sudo ./Build], is set) * sudo is configured with env_reset, which seems to be the default on most (or all?) systems (tried FreeBSD, various Debians, Cent OS 7). To check, one can try: env PERL_USE_UNSAFE_INC=1 sudo env | grep -sq PERL_USE_UNSAFE_INC || echo 'Problems!' * the distribution to be installed requires "." in @INC during the installation phase (e.g. KAZEBURO/WWW-Form-UrlEncoded-0.24.tar.gz, a Plack dependency)
Download (untitled) / with headers
text/plain 895b
On 2017-05-13 12:09:17, SREZIC wrote: Show quoted text
> The PERL_USE_UNSAFE_INC=1 hack needed for perl 5.26 does not work in > some situations: > > * the "sudo" install option is used (i.e. > 'make_install_make_command' => q[sudo make], > 'mbuild_install_build_command' => q[sudo ./Build], > is set) > > * sudo is configured with env_reset, which seems to be the default on > most (or all?) systems (tried FreeBSD, various Debians, Cent OS 7). > To check, one can try: > > env PERL_USE_UNSAFE_INC=1 sudo env | grep -sq PERL_USE_UNSAFE_INC || > echo 'Problems!' > > * the distribution to be installed requires "." in @INC during the > installation phase (e.g. KAZEBURO/WWW-Form-UrlEncoded-0.24.tar.gz, > a Plack dependency)
Possible workaround: set the environment variable inside the sudo call, like this: 'mbuild_install_build_command' => q[sudo env PERL_USE_UNSAFE_INC=1 ./Build]
On 2017-05-13 12:28:55, SREZIC wrote: Show quoted text
> On 2017-05-13 12:09:17, SREZIC wrote:
> > The PERL_USE_UNSAFE_INC=1 hack needed for perl 5.26 does not work in > > some situations: > > > > * the "sudo" install option is used (i.e. > > 'make_install_make_command' => q[sudo make], > > 'mbuild_install_build_command' => q[sudo ./Build], > > is set) > > > > * sudo is configured with env_reset, which seems to be the default on > > most (or all?) systems (tried FreeBSD, various Debians, Cent OS 7). > > To check, one can try: > > > > env PERL_USE_UNSAFE_INC=1 sudo env | grep -sq PERL_USE_UNSAFE_INC || > > echo 'Problems!' > > > > * the distribution to be installed requires "." in @INC during the > > installation phase (e.g. KAZEBURO/WWW-Form-UrlEncoded-0.24.tar.gz, > > a Plack dependency)
> > > Possible workaround: set the environment variable inside the sudo > call, like this: > > 'mbuild_install_build_command' => q[sudo env PERL_USE_UNSAFE_INC=1 > ./Build]
Another victim: Mouse-v2.4.9. Here's the end of a CPAN.pm log with the problem happening: ... CPAN::Reporter: Test result is 'pass', All tests successful. CPAN::Reporter: preparing a CPAN Testers report for Mouse-v2.4.9 CPAN::Reporter: sending test report with 'pass' via File SYOHEX/Mouse-v2.4.9.tar.gz ./Build test -- OK Running Build install Can't locate builder/MyBuilder.pm in @INC (you may need to install the builder::MyBuilder module) (@INC contains: /Users/eserte/.cpan/build/2017051321/Mouse-v2.4.9-0/_build/lib /o pt/perl-5.26.0-RC1/lib/site_perl/5.26.0/darwin-2level /opt/perl-5.26.0-RC1/lib/site_perl/5.26.0 /opt/perl-5.26.0-RC1/lib/5.26.0/darwin-2level /opt/perl-5.26.0-RC1/lib/5.26.0) at / Users/eserte/.cpan/build/2017051321/Mouse-v2.4.9-0/_build/lib/MyBuilder.pm line 2. BEGIN failed--compilation aborted at /Users/eserte/.cpan/build/2017051321/Mouse-v2.4.9-0/_build/lib/MyBuilder.pm line 2. Compilation failed in require at ./Build line 40. BEGIN failed--compilation aborted at ./Build line 40. SYOHEX/Mouse-v2.4.9.tar.gz sudo ./Build install -- NOT OK
RT-Send-CC: LEONT [...] cpan.org
Download (untitled) / with headers
text/plain 2.5k
On 2017-05-13 17:18:57, SREZIC wrote: Show quoted text
> On 2017-05-13 12:28:55, SREZIC wrote:
> > On 2017-05-13 12:09:17, SREZIC wrote:
> > > The PERL_USE_UNSAFE_INC=1 hack needed for perl 5.26 does not work > > > in > > > some situations: > > > > > > * the "sudo" install option is used (i.e. > > > 'make_install_make_command' => q[sudo make], > > > 'mbuild_install_build_command' => q[sudo ./Build], > > > is set) > > > > > > * sudo is configured with env_reset, which seems to be the default > > > on > > > most (or all?) systems (tried FreeBSD, various Debians, Cent OS > > > 7). > > > To check, one can try: > > > > > > env PERL_USE_UNSAFE_INC=1 sudo env | grep -sq PERL_USE_UNSAFE_INC > > > || > > > echo 'Problems!' > > > > > > * the distribution to be installed requires "." in @INC during the > > > installation phase (e.g. KAZEBURO/WWW-Form-UrlEncoded- > > > 0.24.tar.gz, > > > a Plack dependency)
> > > > > > Possible workaround: set the environment variable inside the sudo > > call, like this: > > > > 'mbuild_install_build_command' => q[sudo env PERL_USE_UNSAFE_INC=1 > > ./Build]
> > Another victim: Mouse-v2.4.9. Here's the end of a CPAN.pm log with the > problem happening: > > ... > CPAN::Reporter: Test result is 'pass', All tests successful. > CPAN::Reporter: preparing a CPAN Testers report for Mouse-v2.4.9 > CPAN::Reporter: sending test report with 'pass' via File > SYOHEX/Mouse-v2.4.9.tar.gz > ./Build test -- OK > Running Build install > Can't locate builder/MyBuilder.pm in @INC (you may need to install the > builder::MyBuilder module) (@INC contains: > /Users/eserte/.cpan/build/2017051321/Mouse-v2.4.9-0/_build/lib /o > pt/perl-5.26.0-RC1/lib/site_perl/5.26.0/darwin-2level /opt/perl- > 5.26.0-RC1/lib/site_perl/5.26.0 /opt/perl-5.26.0- > RC1/lib/5.26.0/darwin-2level /opt/perl-5.26.0-RC1/lib/5.26.0) at / > Users/eserte/.cpan/build/2017051321/Mouse-v2.4.9- > 0/_build/lib/MyBuilder.pm line 2. > BEGIN failed--compilation aborted at > /Users/eserte/.cpan/build/2017051321/Mouse-v2.4.9- > 0/_build/lib/MyBuilder.pm line 2. > Compilation failed in require at ./Build line 40. > BEGIN failed--compilation aborted at ./Build line 40. > SYOHEX/Mouse-v2.4.9.tar.gz > sudo ./Build install -- NOT OK
The problem is supposed to be fixed for Module::Build-based distributions with https://metacpan.org/release/LEONT/Module-Build-0.42_23 and I can confirm that all the listed problematic distributions now install using "sudo ./Build". Probably it's still possible that distributions construct problematic install functions (even with ExtUtils::MakeMaker), but hopefully nothing like this exists in the CPAN.
Download (untitled) / with headers
text/plain 119b
I'll declare this ticket resolved by already mentioned Module::Build release. Please reopen when new evidence comes in.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.