Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the DateTime-TimeZone CPAN distribution.

Report information
The Basics
Id: 97227
Status: resolved
Priority: 0/
Queue: DateTime-TimeZone

People
Owner: Nobody in particular
Requestors: beastie [...] tardisi.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 1.70
  • 1.71
Fixed in: 1.69



Subject: Get "Cannot determine local time zone" when called by irssi script
After restarting my irssi today (to update from 9.1-FreeBSD-p9 to 9.1-FreeBSD-p10), I found that twirssi wouldn't load in irssi. It would report "Cannot determine local time zone". Using: my $tz = DateTime::TimeZone-> new( name => 'local' ); in simple test script, worked. But, not when the same is done inside of irssi. Though it used to work.... I threw in a lot of prints...and saw that from my simple script, it finds /etc/localtime, a sym link. And, works through: DateTime::TimeZone::Chicago DateTime::TimeZone::America::Chicago And, suceeds. But, when called from irssi....it continues on with DateTime::TimeZone::zoneinfo::America::Chicago etc. before die'ng. Eventually, I noted that irssi had been running since its last update and at that time 1.69 was installed. Working back gradually from: p5-DateTime-TimeZone-1.71_1 p5-DateTime-TimeZone-1.71 p5-DateTime-TimeZone-1.70 to p5-DateTime-TimeZone-1.69 Puts 1.69 as the version where things do start working again. Comparing 1.69 and 1.71_1, the only changes I see are the TimeZone files (2014c -> 2014e)....so I'm lost on what's different to account for this problem. Some other versions are: irssi-0.8.16_1 perl5-5.16.3_11 twirssi.pl v2.6.3
On Mon Jul 14 19:26:52 2014, beastie@tardisi.com wrote: Show quoted text
> After restarting my irssi today (to update from 9.1-FreeBSD-p9 to 9.1- > FreeBSD-p10), I found that twirssi wouldn't load in irssi. > > It would report "Cannot determine local time zone". > > Using: > > my $tz = DateTime::TimeZone-> new( name => 'local' ); > > in simple test script, worked. But, not when the same is done inside > of irssi. Though it used to work.... > > I threw in a lot of prints...and saw that from my simple script, it > finds /etc/localtime, a sym link. And, works through: > > DateTime::TimeZone::Chicago > DateTime::TimeZone::America::Chicago > > And, suceeds. > > But, when called from irssi....it continues on with > > DateTime::TimeZone::zoneinfo::America::Chicago > etc. > > before die'ng. > > Eventually, I noted that irssi had been running since its last update > and at that time 1.69 was installed. > > Working back gradually from: > > p5-DateTime-TimeZone-1.71_1 > p5-DateTime-TimeZone-1.71 > p5-DateTime-TimeZone-1.70 > > to > > p5-DateTime-TimeZone-1.69 > > Puts 1.69 as the version where things do start working again. > > Comparing 1.69 and 1.71_1, the only changes I see are the TimeZone > files (2014c -> 2014e)....so I'm lost on what's different to account > for this problem. > > Some other versions are: > > irssi-0.8.16_1 > perl5-5.16.3_11 > > twirssi.pl v2.6.3
This is pretty odd, since there are really no changes of substance in the local time zone finding code in the past few releases. The last changes were in 1.64. I strongly suspect that this has nothing to do with this distro and something to do with how irssi sets up the Perl environment. For example, maybe the @INC dirs are not what you expect? When two identical pieces of code operate differently in two environments I find it's best to start by examining the environment in great detail.
From: beastie [...] tardisi.com
On Tue Jul 15 16:57:01 2014, DROLSKY wrote: Show quoted text
> On Mon Jul 14 19:26:52 2014, beastie@tardisi.com wrote:
> > After restarting my irssi today (to update from 9.1-FreeBSD-p9 to > > 9.1- > > FreeBSD-p10), I found that twirssi wouldn't load in irssi. > > > > It would report "Cannot determine local time zone". > > > > Using: > > > > my $tz = DateTime::TimeZone-> new( name => 'local' ); > > > > in simple test script, worked. But, not when the same is done inside > > of irssi. Though it used to work.... > > > > I threw in a lot of prints...and saw that from my simple script, it > > finds /etc/localtime, a sym link. And, works through: > > > > DateTime::TimeZone::Chicago > > DateTime::TimeZone::America::Chicago > > > > And, suceeds. > > > > But, when called from irssi....it continues on with > > > > DateTime::TimeZone::zoneinfo::America::Chicago > > etc. > > > > before die'ng. > > > > Eventually, I noted that irssi had been running since its last update > > and at that time 1.69 was installed. > > > > Working back gradually from: > > > > p5-DateTime-TimeZone-1.71_1 > > p5-DateTime-TimeZone-1.71 > > p5-DateTime-TimeZone-1.70 > > > > to > > > > p5-DateTime-TimeZone-1.69 > > > > Puts 1.69 as the version where things do start working again. > > > > Comparing 1.69 and 1.71_1, the only changes I see are the TimeZone > > files (2014c -> 2014e)....so I'm lost on what's different to account > > for this problem. > > > > Some other versions are: > > > > irssi-0.8.16_1 > > perl5-5.16.3_11 > > > > twirssi.pl v2.6.3
> > This is pretty odd, since there are really no changes of substance in > the local time zone finding code in the past few releases. The last > changes were in 1.64. > > I strongly suspect that this has nothing to do with this distro and > something to do with how irssi sets up the Perl environment. For > example, maybe the @INC dirs are not what you expect? > > When two identical pieces of code operate differently in two > environments I find it's best to start by examining the environment in > great detail.
Well, after some thought on how I might see what Perl is like in irssi... I settled on this q&d script #!/usr/bin/perl use Irssi; use Config qw(myconfig); use Data::Dumper; Irssi::print myconfig(); Irssi::print Dumper(@INC); Irssi::print Dumper(%ENV); loading this and comparing to a similar command line version. The main difference was @INC inside of irssi is: $VAR1 = '/home/lchen/.irssi/scripts'; $VAR2 = '/usr/local/share/irssi/scripts'; $VAR3 = '/usr/local/lib/perl5/5.16/mach'; $VAR4 = '/usr/local/lib/perl5/5.16/BSDPAN'; $VAR5 = '/usr/local/lib/perl5/site_perl/5.16/mach'; $VAR6 = '/usr/local/lib/perl5/site_perl/5.16'; $VAR7 = '/usr/local/lib/perl5/5.16'; $VAR8 = '.'; While from command line, its: $VAR1 = '/usr/local/lib/perl5/5.16/BSDPAN'; $VAR2 = '/usr/local/lib/perl5/site_perl/5.16/mach'; $VAR3 = '/usr/local/lib/perl5/site_perl/5.16'; $VAR4 = '/usr/local/lib/perl5/5.16/mach'; $VAR5 = '/usr/local/lib/perl5/5.16'; $VAR6 = '.'; Just a slight difference in ordering, but Forcing an update locatedb with 1.69 and then 1.71_1, yields only one result: Show quoted text
> locate Chicago.pm
/usr/local/lib/perl5/site_perl/5.16/DateTime/TimeZone/America/Chicago.pm There were slight environment differences....just 3 insignificant ones -- REMOTE_HOST, SHLVL and WINDOW.
Subject: Re: [rt.cpan.org #97227] Get "Cannot determine local time zone" when called by irssi script
Date: Tue, 15 Jul 2014 17:56:51 -0500 (CDT)
To: "beastie [...] tardisi.com via RT" <bug-DateTime-TimeZone [...] rt.cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Tue, 15 Jul 2014, beastie@tardisi.com via RT wrote: Show quoted text
> Forcing an update locatedb with 1.69 and then 1.71_1, yields only one result: >
>> locate Chicago.pm
> /usr/local/lib/perl5/site_perl/5.16/DateTime/TimeZone/America/Chicago.pm > > There were slight environment differences....just 3 insignificant ones -- REMOTE_HOST, SHLVL and WINDOW.
I'm a bit stumped. I can't see how any code changes from 1.69 to 1.71 made a difference. I took a look at the FreeBSD ports CVS but they're not applying any patches on top of my code so it's not that either. You might try writing to the datetime@perl.org list and asking if anyone there has any ideas. -dave /*============================================================ http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) ============================================================*/
From: beastie [...] tardisi.com
On Tue Jul 15 18:57:01 2014, autarch@urth.org wrote: Show quoted text
> On Tue, 15 Jul 2014, beastie@tardisi.com via RT wrote: >
> > Forcing an update locatedb with 1.69 and then 1.71_1, yields only one > > result: > >
> >> locate Chicago.pm
> > /usr/local/lib/perl5/site_perl/5.16/DateTime/TimeZone/America/Chicago.pm > > > > There were slight environment differences....just 3 insignificant > > ones -- REMOTE_HOST, SHLVL and WINDOW.
> > I'm a bit stumped. I can't see how any code changes from 1.69 to 1.71 > made > a difference. I took a look at the FreeBSD ports CVS but they're not > applying any patches on top of my code so it's not that either. > > You might try writing to the datetime@perl.org list and asking if > anyone > there has any ideas. > > > -dave > >
Fiddling around some more.... I updated to 1.71_1 again....still broke. Tried copying Chicago.pm from 1.69 in....still broke. Put it back to 1.71. Didn't see how changing the order of DST rules would make a difference.... Thinking about other files that differed between 1.69 and 1.71... DateTime::TimeZone::OlsonDB::Observance seems to be the culprit? When I copied in Observance.pm from 1.69, twirssi loads and works again.
Subject: Re: [rt.cpan.org #97227] Get "Cannot determine local time zone" when called by irssi script
Date: Wed, 16 Jul 2014 10:07:34 -0500 (CDT)
To: "beastie [...] tardisi.com via RT" <bug-DateTime-TimeZone [...] rt.cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Wed, 16 Jul 2014, beastie@tardisi.com via RT wrote: Show quoted text
> I updated to 1.71_1 again....still broke. > > Tried copying Chicago.pm from 1.69 in....still broke. Put it back to 1.71. > > Didn't see how changing the order of DST rules would make a difference.... > > Thinking about other files that differed between 1.69 and 1.71... > > DateTime::TimeZone::OlsonDB::Observance seems to be the culprit? > > When I copied in Observance.pm from 1.69, twirssi loads and works again.
That has nothing to do with _finding_ the local time zone, which is where things seem to go wrong for you. The Observance code only kicks in when (some) time zones are being loaded. I do wonder whether you actually have the List::AllUtils prereq installed, but I thought bsdpan took care of that for you. -dave /*============================================================ http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) ============================================================*/
Subject: Re: [rt.cpan.org #97227] Get "Cannot determine local time zone" when called by irssi script
Date: Wed, 16 Jul 2014 11:03:32 -0500
To: bug-DateTime-TimeZone [...] rt.cpan.org
From: The BSD Dreamer <beastie [...] tardisi.com>
On 2014-07-16 10:07, autarch@urth.org via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=97227 > > > On Wed, 16 Jul 2014, beastie@tardisi.com via RT wrote: >
>> I updated to 1.71_1 again....still broke. >> >> Tried copying Chicago.pm from 1.69 in....still broke. Put it back to 1.71. >> >> Didn't see how changing the order of DST rules would make a difference.... >> >> Thinking about other files that differed between 1.69 and 1.71... >> >> DateTime::TimeZone::OlsonDB::Observance seems to be the culprit? >> >> When I copied in Observance.pm from 1.69, twirssi loads and works again.
> > That has nothing to do with _finding_ the local time zone, which is where > things seem to go wrong for you. The Observance code only kicks in when > (some) time zones are being loaded. > > I do wonder whether you actually have the List::AllUtils prereq installed, > but I thought bsdpan took care of that for you. >
Its installed, because its a BUILD/RUN depend for the port. I don't use BSDPAN because it doesn't support pkgng, which I may need to dig into as well someday....
Subject: Re: [rt.cpan.org #97227] Get "Cannot determine local time zone" when called by irssi script
Date: Fri, 22 Aug 2014 18:38:07 -0500
To: bug-DateTime-TimeZone [...] rt.cpan.org
From: The BSD Dreamer <beastie [...] tardisi.com>
On 2014-07-16 11:03, The BSD Dreamer wrote: Show quoted text
> On 2014-07-16 10:07, autarch@urth.org via RT wrote:
>> <URL: https://rt.cpan.org/Ticket/Display.html?id=97227 > >> >> On Wed, 16 Jul 2014, beastie@tardisi.com via RT wrote: >>
>>> I updated to 1.71_1 again....still broke. >>> >>> Tried copying Chicago.pm from 1.69 in....still broke. Put it back to >>> 1.71. >>> >>> Didn't see how changing the order of DST rules would make a difference.... >>> >>> Thinking about other files that differed between 1.69 and 1.71... >>> >>> DateTime::TimeZone::OlsonDB::Observance seems to be the culprit? >>> >>> When I copied in Observance.pm from 1.69, twirssi loads and works again.
>> >> That has nothing to do with _finding_ the local time zone, which is where >> things seem to go wrong for you. The Observance code only kicks in when >> (some) time zones are being loaded. >> >> I do wonder whether you actually have the List::AllUtils prereq installed, >> but I thought bsdpan took care of that for you. >>
> > Its installed, because its a BUILD/RUN depend for the port. > > I don't use BSDPAN because it doesn't support pkgng, which I may need to dig > into as well someday....
Well, I finally decided to really dig into this problem today...and turns out the previously noted differences in @INC were the culprit. irssi is inserting "$HOME/.irssi/scripts", "$PREFIX/share/issi/scripts" and "/usr/local/lib/perl5/5.16/mach" for INC (which perl then fills in with its built in).... '/usr/local/lib/perl5/5.16/BSDPAN'; '/usr/local/lib/perl5/site_perl/5.16/mach'; '/usr/local/lib/perl5/site_perl/5.16'; '/usr/local/lib/perl5/5.16'; '.'; Thus causing "/usr/local/lib/perl5/5.16/mach" to get looked in before "/usr/local/lib/perl5/site_perl/5.16/mach". And, the problem is where Observance.pm switched from using List::Util to List::AllUtils after 1.69.... List::AllUtils requires List::Util > 1.31, which is handled by v1.35 being installed in '/usr/local/lib/perl5/site_perl/5.16/mach', to override the version that is included with Perl (1.25). So, irssi is causing things to fail by causing the base version to get found and loaded first instead. And, the bad thing is that reading through the logs on what its doing....is that its trying to determine where Irssi.pm is going to be installed to move that directory ahead of the others. But, Irssi.pm is installed in '/usr/local/lib/perl5/site_perl/5.16/mach'. Fortunately, there's a configuration variable to change this....so I did a /set perl_use_lib /usr/local/lib/perl5/site_perl/5.16/mach /save and restarted irssi, and after a false start (reinstall perl modules to clear the debugging I had thrown in) everything started working again. Now to decide where the irssi bug goes.