Skip Menu |
Report information
Id: 122792
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: carlin <cb [at] viennan.net>
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Date: Wed, 17 Sep 2014 08:58:35 +1200
To: rakudobug [...] perl.org
From: Carlin Bingham <cb [...] viennan.net>
Subject: [BUG] .^add_fallback in module used by module causes precompilation to fail
Download (untitled) / with headers
text/plain 739b
If you have a file, Boom.pm6, that contains: class Boom; Boom.^add_fallback(-> $, $ { True }, method ($name) { } ); And another file, First.pm6, that `use`s that module: use Boom; class First { } And finally, a file that uses First.pm6: use First; class Second { } And then precompile these files, in dependency order (Boom.pm6 -> First.pm6 -> Second.pm6), compiling Second.pm6 fails with: ===SORRY!=== STable conflict detected during deserialization. (Probable attempt to load two modules that cannot be loaded together). A real world example of this is Inline::Perl5; this bug makes it impossible to precompile any module that `use`s a module that `use`s Inline::Perl5. -- Carlin
Download (untitled) / with headers
text/plain 808b
On Tue Sep 16 13:58:54 2014, carlin wrote: Show quoted text
> If you have a file, Boom.pm6, that contains: > > class Boom; > > Boom.^add_fallback(-> $, $ { True }, > method ($name) { } > ); >
This should be done in a BEGIN block, so the effects are pre-compiled. Doing the modification on every module load will quickly lead to two competing versions of the same modification being serialized, and... Show quoted text
> ===SORRY!=== > STable conflict detected during deserialization. > (Probable attempt to load two modules that cannot be loaded together). >
...that is exactly what happens. While the error might use some work to explain it better, it happens when a type is modified and then serialized in two different ways. That was never the intent here, and the BEGIN should take care of it nicely. /jnthn


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org