Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.^add_fallback in module used by module causes precompilation to fail #3525

Open
p6rt opened this issue Sep 16, 2014 · 3 comments
Open

.^add_fallback in module used by module causes precompilation to fail #3525

p6rt opened this issue Sep 16, 2014 · 3 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Sep 16, 2014

Migrated from rt.perl.org#122792 (status was 'open')

Searchable as RT122792$

@p6rt
Copy link
Author

p6rt commented Sep 16, 2014

From @carbin

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

@p6rt
Copy link
Author

p6rt commented Sep 21, 2014

From @jnthn

On Tue Sep 16 13​:58​:54 2014, carlin wrote​:

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...

===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

@p6rt
Copy link
Author

p6rt commented Sep 21, 2014

The RT System itself - Status changed from 'new' to 'open'

@p6rt p6rt added the precomp label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant