Skip to Content.
Sympa Menu

devel - Re: [sympa-developpers] painful warning about INIT block

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: Guillaume Rousse <address@concealed>
  • To: address@concealed
  • Subject: Re: [sympa-developpers] painful warning about INIT block
  • Date: Wed, 04 Jun 2014 17:51:18 +0200

Le 04/06/2014 17:18, IKEDA Soji a écrit :
Hi,

On Wed, 04 Jun 2014 15:22:29 +0200
Guillaume Rousse <address@concealed> wrote:

The usage of a INIT block in Sympa::Language triggers the following
warning as soon as this package is imported at runtime (directly ou
indirectly):

Too late to run INIT block at
/home/guillaume/work/sympa/trunk/t/../src/lib/Sympa/Language.pm line 56.

Wouldn't running the same code in an import method, as in the following
patch, be enough to achieve the same result, while fixing the issue ?

Typically, import() method is called during BEGIN phase (if I don't
misunderstand something).
Only if this module is loaded at compile-time through 'use' directive, not if the module is loaded at runtime through 'require' and 'import' directives.

I put it on INIT block so that ugry
traceback will not be generated during BEGIN nor CHECK pahse, i.e.
compilation failure.

However, thess warnings are irritating for me, too. Is there any
other solutions?
If you refer to stack traces generated from the __DIE__ signal handler, the simplest is just to avoid installing this handler at undetermined time through the import function of Sympa::Site module (or any other one, actually). That's what I already done in commit #10820, even if I should have kept the function definition in a single place toi avoid duplicating it.

This way you'll avoid the issue for this specific case, but also for any other similar case (compilation failure occuring in BEGIN phase).
--
Guillaume Rousse
INRIA, Direction des systèmes d'information
Domaine de Voluceau
Rocquencourt - BP 105
78153 Le Chesnay
Tel: 01 39 63 58 31

Attachment: smime.p7s
Description: Signature cryptographique S/MIME




Archive powered by MHonArc 2.6.19+.

Top of Page