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

Precompilation and roles don't mix #2725

Closed
p6rt opened this issue Apr 26, 2012 · 6 comments
Closed

Precompilation and roles don't mix #2725

p6rt opened this issue Apr 26, 2012 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Apr 26, 2012

Migrated from rt.perl.org#112624 (status was 'resolved')

Searchable as RT112624$

@p6rt
Copy link
Author

p6rt commented Apr 26, 2012

From @moritz

Here is a bug which showed up in colomon++'s ABC module during
precompilation.

One needs three module files to reproduce this​:

# file ./lib/A/Role.pm
use v6;
role A​::Role { }

# file ./lib/A/Class1.pm
use v6;
use A​::Role;
class A​::Class1 does A​::Role { }

# file ./lib/A/Class2.pm
use v6;
use A​::Role;
use A​::Class1;

class A​::Classs2 does A​::Role { }

running 'ufo && make' to precompile those modules produces this error​:

mkdir -p `dirname 'blib/lib/A/Role.pir'`
env
PERL6LIB=/home/moritz/tmp/oddness/blib/lib​:/home/moritz/tmp/oddness/lib​:
perl6 --target=pir --output=blib/lib/A/Role.pir lib/A/Role.pm
mkdir -p `dirname 'blib/lib/A/Class1.pir'`
env
PERL6LIB=/home/moritz/tmp/oddness/blib/lib​:/home/moritz/tmp/oddness/lib​:
perl6 --target=pir --output=blib/lib/A/Class1.pir lib/A/Class1.pm
mkdir -p `dirname 'blib/lib/A/Class2.pir'`
env
PERL6LIB=/home/moritz/tmp/oddness/blib/lib​:/home/moritz/tmp/oddness/lib​:
perl6 --target=pir --output=blib/lib/A/Class2.pir lib/A/Class2.pm
===SORRY!===
None of the parametric role variants for 'A​::Role' matched the arguments
supplied.
Cannot call ''; none of these signatures match​:

make​: *** [blib/lib/A/Class2.pir] Error 1

The fact that the list of candidates is empty indicates that it is lost
somewhere during the precompilation.

@p6rt
Copy link
Author

p6rt commented Apr 26, 2012

From @moritz

This bug doesn't even need the 'A​::' part in all those namespaces, using
top-level namspaces gives the same result.

@p6rt
Copy link
Author

p6rt commented Apr 26, 2012

@moritz - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented May 9, 2012

From @jnthn

On Thu Apr 26 12​:20​:21 2012, moritz wrote​:

Here is a bug which showed up in colomon++'s ABC module during
precompilation.

One needs three module files to reproduce this​:

# file ./lib/A/Role.pm
use v6;
role A​::Role { }

# file ./lib/A/Class1.pm
use v6;
use A​::Role;
class A​::Class1 does A​::Role { }

# file ./lib/A/Class2.pm
use v6;
use A​::Role;
use A​::Class1;

class A​::Classs2 does A​::Role { }

running 'ufo && make' to precompile those modules produces this error​:

mkdir -p `dirname 'blib/lib/A/Role.pir'`
env
PERL6LIB=/home/moritz/tmp/oddness/blib/lib​:/home/moritz/tmp/oddness/lib​:
perl6 --target=pir --output=blib/lib/A/Role.pir lib/A/Role.pm
mkdir -p `dirname 'blib/lib/A/Class1.pir'`
env
PERL6LIB=/home/moritz/tmp/oddness/blib/lib​:/home/moritz/tmp/oddness/lib​:
perl6 --target=pir --output=blib/lib/A/Class1.pir lib/A/Class1.pm
mkdir -p `dirname 'blib/lib/A/Class2.pir'`
env
PERL6LIB=/home/moritz/tmp/oddness/blib/lib​:/home/moritz/tmp/oddness/lib​:
perl6 --target=pir --output=blib/lib/A/Class2.pir lib/A/Class2.pm
===SORRY!===
None of the parametric role variants for 'A​::Role' matched the arguments
supplied.
Cannot call ''; none of these signatures match​:

make​: *** [blib/lib/A/Class2.pir] Error 1

The fact that the list of candidates is empty indicates that it is lost
somewhere during the precompilation.

Tracked it down. It seems to just be that we need an OwnedRPA thingy,
just like OwnedHash, to make sure SC write barriers are tripped
appropriately. I figured we would need that at some point anyways...
Alternatively we could probably re-arrange some of the role code a bit,
but I'd rather solve the general issue.

Will try and get this in place soon (and leaving this here to remind me
what needs to be done :-)).

/jnthn

@p6rt
Copy link
Author

p6rt commented May 15, 2012

From @moritz

jnthn++ fixed this. I'm closing it without spectests because
precompilation isn't specced. I'm still feeling a bit queasy about not
testing it though.

@p6rt
Copy link
Author

p6rt commented May 15, 2012

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed May 15, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant