Opened 15 years ago

Closed 14 years ago

Last modified 14 years ago

#12950 closed defect (fixed)

perl5.8 @INC path should be reversed to be able to include vendorlib first.

Reported by: nox@… Owned by: ghosthound
Priority: Normal Milestone:
Component: ports Version: 1.5.0
Keywords: Cc: nox@…, danielluke (Daniel J. Luke), sal@…, pguyot (Paul Guyot), MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Port:

Description

There's currently some ports which need to overwrite perl5.8 core modules (see #12710 for a short list of them). I think this is a bad practice and that we should instead patch perl5.8 to set @INC in a different order.

Here is a patch which do this and that update the other ports to correctly install in vendorlib.

I'm adding those ports maintainers to the Cc field.

Attachments (8)

perl5.8_1.diff (8.5 KB) - added by nox@… 15 years ago.
path-Portfile.diff (683 bytes) - added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) 14 years ago.
patch-perl.c.diff (2.0 KB) - added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) 14 years ago.
patch-p5-test-simple.diff (1.3 KB) - added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez) 14 years ago.
Portfile.20090310.1655.patch (1.2 KB) - added by ghosthound 14 years ago.
perl5.8 Portfile patch to alter @INC
patch-perl.c.2.diff (3.2 KB) - added by ghosthound 14 years ago.
patch for perl5.8 perl.c to alter @INC
p5-test-simple.Portfile.patch (1.1 KB) - added by ghosthound 14 years ago.
patch for p5-test-simple to go with perl5.8 @INC inversion
p5-scalar-list-utils.Portfile.patch (1.0 KB) - added by ghosthound 14 years ago.
patch for p5-scalar-list-utils to go with perl5.8 @INC change

Download all attachments as: .zip

Change History (25)

Changed 15 years ago by nox@…

Attachment: perl5.8_1.diff added

comment:1 Changed 15 years ago by nox@…

I see I've forgot a lot of those ports in my patch. I'll add a new one in short time.

comment:2 Changed 15 years ago by nox@…

In fact, I've not forgotten any port. Those ports already install in vendorlib, which renders them useless for the time being.

comment:3 Changed 15 years ago by danielluke (Daniel J. Luke)

Note that this has been discussed before and it was eventually decided that the current method (requiring install with -f) is the lesser of many potentially evil options.

See discussion in #11043 and #11175

comment:4 Changed 15 years ago by nox@…

I don't know about other ports management, but I know this is the solution chosen by Portage and I've not experienced any problem using Gentoo. As I have written in #12710, there's a lot of ports which are rendered useless by the current @INC order.

Maybe we should reconsider this policy?

comment:5 Changed 15 years ago by danielluke (Daniel J. Luke)

The ports aren't rendered useless as "use MODULE version;" will still load the newer one. It's just that scripts that had "use MODULE;" will get the perl-dist one (unless the port overwrites it and is installed with -f) and not the newer one (which may or may not be what the end-user expects to have happen).

I personally would rather have perl search site, vendor, and then private (in that order) everywhere, but I think it does make sense to have macports-provided perl match a normal perl install as much as possible.

comment:6 Changed 15 years ago by nox@…

Then why don't we patch other ports to explicitely request a specific version?

comment:7 Changed 15 years ago by danielluke (Daniel J. Luke)

The perl community generally updates modules that are distributed with perl by overwriting those modules, we're simply replicating this "standard" behavior within macports.

comment:8 Changed 15 years ago by nox@…

This "standard" behavior is often called a "bug" on -users@, the whole '-f' thing scare them.

comment:9 Changed 15 years ago by danielluke (Daniel J. Luke)

That's because base/ doesn't allow a portfile to say that it's going to overwrite files that belong to the perl5.8 port, and that it's OK (and to not require -f from the user, and not enable all of the other stuff that -f enables).

comment:10 Changed 15 years ago by nox@…

There's another shortcoming with the force policy: Every port which depends on a perl core module (e.g. Getopt::Long) will failed to build with trace mode enabled if it does not explicitely depends on the port which overwrites this core module.

As Getopt::Long is used by perl5.8 own's core module, every p5-* port will fail in trace mode.

comment:11 Changed 14 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Cc: mcalhoun@… added

Cc Me!

Changed 14 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Attachment: path-Portfile.diff added

Changed 14 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Attachment: patch-perl.c.diff added

Changed 14 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

Attachment: patch-p5-test-simple.diff added

comment:12 Changed 14 years ago by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)

path-Portfile.diff patch-perl.c.diff change the order of @INC.

patch-p5-test-simple.diff patches p5-test-simple to install into the site_perl directory.
The manpages are renamed to avoid conflict.

p5-test-simple is newer than the one provided by perl5.8, so

${prefix}/bin/perl -e 'use Test::Builder 0.86'

should test if the reordering is working.

comment:13 Changed 14 years ago by ghosthound

Owner: changed from nox@… to ricci@…

Changed 14 years ago by ghosthound

perl5.8 Portfile patch to alter @INC

Changed 14 years ago by ghosthound

Attachment: patch-perl.c.2.diff added

patch for perl5.8 perl.c to alter @INC

Changed 14 years ago by ghosthound

patch for p5-test-simple to go with perl5.8 @INC inversion

Changed 14 years ago by ghosthound

patch for p5-scalar-list-utils to go with perl5.8 @INC change

comment:14 Changed 14 years ago by ghosthound

Status: newassigned

I've added several patch files to this ticket to do what I've tested for altering the perl5.8 @INC array - making perl search for modules in site_perl, vendor_perl, and then the base perl5.8, as well as changes to the Portfile to avoid man page collisions when p5-* modules are installed. There are also patches for two perl modules that required -f before this change, p5-test-simple and p5-scalar-list-utils - they now do not require -f to install and their modules are picked up by perl5.8 if installed. So far I've tested for man page collision with the above and known items like p5-cgi, no problems with collisions. p5-* man pages are detected before the mac-ports installed ones and before the system installed p5-* man pages. The only problem is that the system installed p5-* man pages are found before the perl5.8 man pages, I'm not seeing a clean solution for that without requiring alteration of /etc/man.conf or the like. I've also tested installing ~75 modules and using them, no (detected) problems there either.

The patches to test are:

Portfile.20090310.1655.patch

patch-perl.c.2.diff

p5-test-simple.Portfile.patch

p5-scalar-list-utils.Portfile.patch

Please report any success/failure shortly, I'd like to commit this by the end of the week.

As well, I figure on making the same @INC and man page changes for perl5.10 so there are no issues with some p5-* ports working with perl5.8 and not with perl5.10.

comment:15 Changed 14 years ago by ghosthound

perl5.8 @INC change committed in r48955, please test

comment:16 Changed 14 years ago by ghosthound

Resolution: fixed
Status: assignedclosed

closing due to test timeout, please re-open if you find problems.

comment:17 Changed 14 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

Note: See TracTickets for help on using tickets.