Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#43148 closed defect (fixed)

p5.10-version: tries to modify Perl's version.pm during destroot

Reported by: mojca (Mojca Miklavec) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: john.peacock@…, neverpanic (Clemens Lang), cooljeanius (Eric Gallager)
Port: p5.10-version

Description

Installation of p5.10-version fails when trying to modify file /opt/local/lib/perl5/5.10.1/version.pm owned by perl5.10. It works for all other version of Perl: 5.8, 5.12, 5.14, 5.16, 5.18, but fails for 5.10.

--->  Staging p5.10-version into destroot
DEBUG: Run destroot without sudo to avoid root privileges.
DEBUG: Going to escalate privileges back to root.
DEBUG: euid changed to: 0. egid changed to: 0.
...
DEBUG: Executing org.macports.destroot (p5.10-version)
DEBUG: Environment: CPATH='/opt/local/include' CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_mports_dports_perl_p5-version/p5.10-version/work/.CC_PRINT_OPTIONS' LIBRARY_PATH='/opt/local/lib' CC_PRINT_OPTIONS='YES' MACOSX_DEPLOYMENT_TARGET='10.9'
DEBUG: Assembled command: 'cd "/opt/local/var/macports/build/_opt_mports_dports_perl_p5-version/p5.10-version/work/version-0.9908" && /usr/bin/make -w pure_install DESTDIR=/opt/local/var/macports/build/_opt_mports_dports_perl_p5-version/p5.10-version/work/destroot'
DEBUG: Executing command line:  cd "/opt/local/var/macports/build/_opt_mports_dports_perl_p5-version/p5.10-version/work/version-0.9908" && /usr/bin/make -w pure_install DESTDIR=/opt/local/var/macports/build/_opt_mports_dports_perl_p5-version/p5.10-version/work/destroot 
make: Entering directory `/opt/local/var/macports/build/_opt_mports_dports_perl_p5-version/p5.10-version/work/version-0.9908'
make[1]: Entering directory `/opt/local/var/macports/build/_opt_mports_dports_perl_p5-version/p5.10-version/work/version-0.9908/vutil'
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_mports_dports_perl_p5-version/p5.10-version/work/version-0.9908/vutil'
Manifying blib/man3/version::Internals.3pm
Manifying blib/man3/version.3pm
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
WARNING: WARNING: Failed chmod(0666, /opt/local/lib/perl5/5.10.1/version.pm): Operation not permitted

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ERROR: Cannot unlink '/opt/local/lib/perl5/5.10.1/version.pm': Operation not permitted
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 at -e line 1

Installing /opt/local/var/macports/build/_opt_mports_dports_perl_p5-version/p5.10-version/work/destroot/opt/local/lib/perl5/vendor_perl/5.10.1/darwin-thread-multi-2level/auto/version/vxs/vxs.bs
Installing /opt/local/var/macports/build/_opt_mports_dports_perl_p5-version/p5.10-version/work/destroot/opt/local/lib/perl5/vendor_perl/5.10.1/darwin-thread-multi-2level/auto/version/vxs/vxs.bundle
Installing /opt/local/var/macports/build/_opt_mports_dports_perl_p5-version/p5.10-version/work/destroot/opt/local/lib/perl5/vendor_perl/5.10.1/darwin-thread-multi-2level/version.pm
make: *** [pure_vendor_install] Error 1
make: Leaving directory `/opt/local/var/macports/build/_opt_mports_dports_perl_p5-version/p5.10-version/work/version-0.9908'
Command failed:  cd "/opt/local/var/macports/build/_opt_mports_dports_perl_p5-version/p5.10-version/work/version-0.9908" && /usr/bin/make -w pure_install DESTDIR=/opt/local/var/macports/build/_opt_mports_dports_perl_p5-version/p5.10-version/work/destroot 
Exit code: 2
Error: org.macports.destroot for port p5.10-version returned: command execution failed

See https://build.macports.org/builders/buildports-mavericks-x86_64/builds/2462

Change History (10)

comment:1 Changed 10 years ago by mojca (Mojca Miklavec)

The behaviour might be related to https://rt.cpan.org/Public/Bug/Display.html?id=88909 (but that's pure speculation).

comment:2 Changed 10 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:3 Changed 10 years ago by cooljeanius (Eric Gallager)

Thanks for filing this, I had been meaning to file it myself...

comment:4 Changed 10 years ago by mojca (Mojca Miklavec)

In fact this looks like a duplicate of #42146.

comment:5 Changed 10 years ago by dbevans (David B. Evans)

Resolution: fixed
Status: newclosed

The solution is, indeed, contained in bug referenced by Mojca in comment:1.

version.pm was added to perl core in 5.10 which installs it here:

${prefix}/lib/perl5/5.10.1/version.pm

p5.10-version installs version.pm here:

${prefix}/lib/perl5/vendor_perl/5.10.1/darwin-thread-multi-2level/version.pm

The default behavior of this port (see Makefile.PL) is to unlink the core version in favor of its own. This is applied only for perl versions < 5.12. Since perl 5.8 doesn't include version.pm in core, this is the reason that only p5.10-version is effected.

It's not clear to me why, historically, this is the default behavior but it is unnecessary since the two versions are installed in different paths and due to the structure of @INC, p5-version will always override the core version.pm.

You can use

perl5.10 -Mversion -e'print $_ . " => " . $INC{$_} . "\n" for keys %INC'

both with and without p5.10-version active to prove this.

In any case, as per the cited bug report, Makefile.PL now includes a check for env var PERL_NO_HIGHLANDER which, if present, will disable the attempt to unlink the core version of version.pm.

Fix committed in r122719 which appends PERL_NO_HIGHLANDER to configure.env if perl5.major is 5.10.

comment:6 in reply to:  5 ; Changed 10 years ago by cooljeanius (Eric Gallager)

Replying to devans@…:

Since perl 5.8 doesn't include version.pm in core, this is the reason that only p5.10-version is affected.

Really? Then why do I see this error with perl5.8 as well? Output:

make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_perl_p5-version/p5.8-version/work/version-0.9908'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
WARNING: WARNING: Failed chmod(0666, /opt/local/lib/perl5/vendor_perl/5.8.9/version.pm): Operation not permitted

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ERROR: Cannot unlink '/opt/local/lib/perl5/vendor_perl/5.8.9/version.pm': Operation not permitted
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 at -e line 1

Installing /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_perl_p5-version/p5.8-version/work/destroot/opt/local/lib/perl5/vendor_perl/5.8.9/version.pm
make: *** [pure_vendor_install] Error 1
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_perl_p5-version/p5.8-version/work/version-0.9908'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_perl_p5-version/p5.8-version/work/version-0.9908" && /usr/bin/make -w pure_install DESTDIR=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_perl_p5-version/p5.8-version/work/destroot 
Exit code: 2
Error: org.macports.destroot for port p5.8-version returned: command execution failed

I think it is trying to do this because I am upgrading from a previous installation of p5.8-version:

$ stat /opt/local/lib/perl5/vendor_perl/5.8.9/version.pm
234881026 819365 -r--r--r-- 1 root admin 0 2923 "Jul 27 12:53:23 2014" "Jan 15 07:12:27 2014" "Feb 24 16:48:40 2014" "Jan 15 07:12:27 2014" 4096 8 0 /opt/local/lib/perl5/vendor_perl/5.8.9/version.pm
$ port provides /opt/local/lib/perl5/vendor_perl/5.8.9/version.pm
/opt/local/lib/perl5/vendor_perl/5.8.9/version.pm is provided by: p5.8-version
$ port installed p5.8-version
The following ports are currently installed:
  p5.8-version @0.990.700_0+universal (active)

comment:7 in reply to:  6 Changed 10 years ago by dbevans (David B. Evans)

Replying to egall@…:

Replying to devans@…:

Since perl 5.8 doesn't include version.pm in core, this is the reason that only p5.10-version is affected.

Really? Then why do I see this error with perl5.8 as well? Output:

I can't reproduce this result whether doing a clean install or forcing a rebuild with p5.8-version already installed. In addition, all versions built correctly on the buildbots. This seems to be consistent with the original report.

So the question should be what's unique about your installation?

comment:8 Changed 10 years ago by dbevans (David B. Evans)

Does changing

if {[vercmp ${perl5.major} 5.10] == 0} {
    configure.env-append \
                    PERL_NO_HIGHLANDER=1
}

to

if {[vercmp ${perl5.major} 5.12] < 0} {
    configure.env-append \
                    PERL_NO_HIGHLANDER=1
}

make any difference for you

comment:9 Changed 10 years ago by cooljeanius (Eric Gallager)

r122720 worked for me, thanks

comment:10 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

The file p5.8-version is trying to unlink, /opt/local/lib/perl5/vendor_perl/5.8.9/version.pm, is provided by p5.8-version, not by perl5.8. The error occurs when trying to upgrade a previous version of the port; the buildbots never do that so they're not affected. I committed the same fix to p5-cpan-meta and p5-cpan-meta-requirements in r123701 and r123700 respectively.

Note: See TracTickets for help on using tickets.