Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Long time reader, first time poster. Big, appreciative thanks for everyone's collective questioning and answering here and at stackoverflow, it's helped me quite a lot over the time I've been learning answers through these sites! Apologies in advance if I didn't search hard enough on posts already up on this site to find out what I could do about this issue, but I thought I'd just reach out for the sake of trying at least once.

I've experienced this issue while starting up my macports-installed version of irssi:

13:25 -!- Irssi: Error in script dispatch:
13:25 Can't locate lib.pm in @INC (@INC contains: 
      /opt/local/lib/perl5/site_perl/5.12.4/darwin-multi-2level 
      /opt/local/lib/perl5/site_perl/5.12.4 
      /opt/local/lib/perl5/vendor_perl/5.12.4/darwin-multi-2level 
      /opt/local/lib/perl5/vendor_perl/5.12.4 
      /opt/local/lib/perl5/5.12.4/darwin-multi-2level 
      /opt/local/lib/perl5/5.12.4 
      /opt/local/lib/perl5/site_perl/5.12.3/darwin-multi-2level 
      /opt/local/lib/perl5/site_perl/5.12.3 /opt/local/lib/perl5/site_perl 
      /opt/local/lib/perl5/vendor_perl .) at (eval 18) line 1.
13:25 BEGIN failed--compilation aborted at (eval 18) line 1.
13:25 

Huh, strange. I looked into it a bit:

╭─@Ds-MacBook.local /opt/local/lib/perl5  
╰─ find . -name "lib.pm" -ls
14673887           16 -r--r--r--    1 root     admin        6853 25 Jun 23:39 ./5.12.4/darwin-thread-multi-    2level/lib.pm

╭─@Ds-MacBook.local /opt/local/lib/perl5  
╰─ l 5.12.4/darwin-thread-multi-2level 
total 1864
drwxr-xr-x   55 root  admin    1870 28 Jun 19:28 .
drwxr-xr-x  158 root  admin    5372 28 Jun 19:28 ..
-rw-r--r--    1 root  admin  177814 25 Jun 23:39 .packlist
drwxr-xr-x    6 root  admin     204 28 Jun 19:28 B
-r--r--r--    1 root  admin   25714 25 Jun 23:39 B.pm
drwxr-xr-x   64 root  admin    2176 28 Jun 19:28 CORE
drwxr-xr-x    3 root  admin     102 28 Jun 19:28 Compress
-r--r--r--    1 root  admin    3000 25 Jun 23:39 Config.pm
-r--r--r--    1 root  admin  228094 25 Jun 23:39 Config.pod
-r--r--r--    1 root  admin     409 25 Jun 23:39 Config_git.pl
-r--r--r--    1 root  admin   38759 25 Jun 23:39 Config_heavy.pl
-r--r--r--    1 root  admin   21174 25 Jun 23:39 Cwd.pm
-r--r--r--    1 root  admin   63535 25 Jun 23:39 DB_File.pm
drwxr-xr-x    3 root  admin     102 28 Jun 19:28 Data
drwxr-xr-x    5 root  admin     170 28 Jun 19:28 Devel
drwxr-xr-x    4 root  admin     136 28 Jun 19:28 Digest
-r--r--r--    1 root  admin   25185 25 Jun 23:39 DynaLoader.pm
drwxr-xr-x   22 root  admin     748 28 Jun 19:28 Encode
-r--r--r--    1 root  admin   29731 25 Jun 23:39 Encode.pm
-r--r--r--    1 root  admin    6736 25 Jun 23:39 Errno.pm
-r--r--r--    1 root  admin    5445 25 Jun 23:39 Fcntl.pm
drwxr-xr-x    5 root  admin     170 28 Jun 19:28 File
drwxr-xr-x    3 root  admin     102 28 Jun 19:28 Filter
-r--r--r--    1 root  admin    1819 25 Jun 23:39 GDBM_File.pm
drwxr-xr-x    4 root  admin     136 28 Jun 19:28 Hash
drwxr-xr-x    3 root  admin     102 28 Jun 19:28 I18N
drwxr-xr-x   11 root  admin     374 28 Jun 19:28 IO
-r--r--r--    1 root  admin    1404 25 Jun 23:39 IO.pm
drwxr-xr-x    6 root  admin     204 28 Jun 19:28 IPC
drwxr-xr-x    4 root  admin     136 28 Jun 19:28 List
drwxr-xr-x    4 root  admin     136 28 Jun 19:28 MIME
drwxr-xr-x    3 root  admin     102 28 Jun 19:28 Math
-r--r--r--    1 root  admin    2519 25 Jun 23:39 NDBM_File.pm
-r--r--r--    1 root  admin    4208 25 Jun 23:39 O.pm
-r--r--r--    1 root  admin   15563 25 Jun 23:39 Opcode.pm
-r--r--r--    1 root  admin   21011 25 Jun 23:39 POSIX.pm
-r--r--r--    1 root  admin   58962 25 Jun 23:39 POSIX.pod
drwxr-xr-x    5 root  admin     170 28 Jun 19:28 PerlIO
-r--r--r--    1 root  admin    2515 25 Jun 23:39 SDBM_File.pm
drwxr-xr-x    4 root  admin     136 28 Jun 19:28 Scalar
-r--r--r--    1 root  admin   10837 25 Jun 23:39 Socket.pm
-r--r--r--    1 root  admin   41003 25 Jun 23:39 Storable.pm
drwxr-xr-x    4 root  admin     136 28 Jun 19:28 Sys
drwxr-xr-x    3 root  admin     102 28 Jun 19:28 Text
drwxr-xr-x    5 root  admin     170 28 Jun 19:28 Time
drwxr-xr-x    3 root  admin     102 28 Jun 19:28 Unicode
-r--r--r--    1 root  admin   14462 25 Jun 23:39 attributes.pm
drwxr-xr-x   38 root  admin    1292 28 Jun 19:28 auto
-r--r--r--    1 root  admin   19892 25 Jun 23:39 encoding.pm
-r--r--r--    1 root  admin    6853 25 Jun 23:39 lib.pm
-r--r--r--    1 root  admin   11044 25 Jun 23:39 mro.pm
-r--r--r--    1 root  admin     997 25 Jun 23:39 ops.pm
-r--r--r--    1 root  admin   13945 25 Jun 23:39 re.pm
drwxr-xr-x    3 root  admin     102 28 Jun 19:28 threads
-r--r--r--    1 root  admin   33283 25 Jun 23:39 threads.pm

So, it sort of seems to me that the permissions which perl5 got installed with for these modules has gotten mixed up somehow? I'm not really a perl user beyond enjoying it for massive directory-recursive find/replace operations within text files, so I haven't much of an idea what the permissions here are supposed to look like, and I'm not really sure how to go about determining how macports has gone and installed perl this way when it's otherwise worked without failure for years now. Does anyone have any recommendations for the sanest path towards rectifying this issue? Also, is there any interesting reason as to why the macports default for the perl5 port installs 5.12.4, and not 5.16.0, which has to be explicitly installed via the perl5.16 port?

Thanks again!

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

The problem is that the Perl ports were all recently changed to always build with what used to be the +threads variant, because otherwise there were severe problems with Perl module packages: they install in different paths depending on threaded or non-threaded Perl, but there is no variant information available to the module packages to say which to use. So installing from packages, or a few weird cases from source, would replace working modules with modules installed in the wrong path. This usually manifested, for those who were building with +threads (as some dependent ports forced), as things like XML::Parser going missing (I usually saw this in the context of something trying to use gettext from its configure).

So, the ports were changed, +threads is always on now, modules no longer vanish randomly. But not every Perl dependent was marked as needing to be rebuilt, so now some of those are — as a one-time failure, instead of one that keeps happening repeatedly — pointing at bad paths instead. The fix is to rebuild them manually:

sudo port -n -f upgrade irssi

will rebuild irssi so it's pointing at the right perl modules now.

(irssi has been revbumped so that the next port selfupdate; port upgrade outdated will rebuild it automatically.)

As for the other: there are a lot of things that depend on Perl, and haven't been tested with anything more recent than 5.12 yet. As stuff gets tested, the default Perl version will get moved ahead. In the meantime, you can request a newer one using a variant such as

sudo port upgrade --enforce-variants perl5 -perl5_12 +perl5_16

Note that some things that depend on Perl specify the exact version they've been tested with; either they will force the known working Perl version to be installed, or if you're lucky they'll provide a variant as above so you can force the Perl version it will use. (irssi appears to use whatever Perl has been selected by variant of the perl5 port.)

share|improve this answer
    
I've done 'sudo port -n -f upgrade irssi' (and a few other variants I've found around the Web) several times, but I'm still not getting irssi to use the -thread- paths in @INC. –  Brad Beyenhof Jul 11 '12 at 16:01
    
I can add the -thread- directories to the PERL5LIB environment variable, but then irssi segfaults (sorry, it looks like line breaks aren't preserved in comments): dyld: lazy symbol binding failed: Symbol not found: _Perl_Gthr_key_ptr Referenced from: /opt/local/lib/perl5/5.12.4/darwin-thread-multi-2level/auto/Fcntl/Fcntl.bundle Expected in: flat namespace dyld: Symbol not found: _Perl_Gthr_key_ptr Referenced from: /opt/local/lib/perl5/5.12.4/darwin-thread-multi-2level/auto/Fcntl/Fcntl.bundle Expected in: flat namespace Segmentation fault –  Brad Beyenhof Jul 11 '12 at 16:08
    
sigh... I just needed a 'port selfupdate.' This was fixed in a revbump within the last 24 hours, apparently, and I was using a ports tree from right before the change. –  Brad Beyenhof Jul 11 '12 at 18:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.