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

Rakudo precompilation bug on all backends #3589

Closed
p6rt opened this issue Nov 22, 2014 · 8 comments
Closed

Rakudo precompilation bug on all backends #3589

p6rt opened this issue Nov 22, 2014 · 8 comments

Comments

@p6rt
Copy link

@p6rt p6rt commented Nov 22, 2014

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

Searchable as RT123276$

@p6rt
Copy link
Author

@p6rt p6rt commented Nov 22, 2014

From @dwarring

Consider three simple classes​:

lib/A.pm​:
class A {}

lib/A/B/C1.pm​:
class A​::B​::C1 { use A; method foo(){} }

lib/A/B/C2.pm​:
class A​::B​::C2 { use A; method foo(){} }

% perl6-m --version
This is perl6 version 2014.11-9-g3bbf7bc built on MoarVM version 2014.11-17-g972d95b
% perl6-m --target=mbc --output=blib/lib/A.pm.moarvm lib/A.pm
% perl6-m --target=mbc --output=blib/lib/A/B/C1.pm.moarvm lib/A/B/C1.pm
% perl6-m --target=mbc --output=blib/lib/A/B/C2.pm.moarvm lib/A/B/C2.pm
% perl6-m -I blib/lib -e'use A​::B​::C1; use A​::B​::C2; say A​::B​::C1.^methods'
Could not find symbol '&C1'
  in method <anon> at src/gen/m-CORE.setting​:13777
  in any find_method_fallback at src/gen/m-Metamodel.nqp​:2725
  in any find_method at src/gen/m-Metamodel.nqp​:988
  in block <unit> at -e​:1

With parrot​:

% perl6-p -I blib/lib --target=pir --output=blib/lib/A.pm.pir lib/A.pm
% perl6-p -I blib/lib --target=pir --output=blib/lib/A/B/C1.pm.pir lib/A/B/C1.pm
% perl6-p -I blib/lib --target=pir --output=blib/lib/A/B/C2.pm.pir lib/A/B/C2.pm
% perl6-p -I blib/lib -e'use A​::B​::C1; use A​::B​::C2; say A​::B​::C1.^methods'
Could not find symbol '&C1'
  in method <anon> at gen/parrot/CORE.setting​:13717
  in any find_method_fallback at gen/parrot/Metamodel.nqp​:2795
  in any find_method at gen/parrot/Metamodel.nqp​:989
  in any at gen/parrot/BOOTSTRAP.nqp​:1708
  in block <unit> at -e​:1

and with JVM backend.

% perl6-j --target=jar --output=blib/lib/A.pm.jar lib/A.pm
% perl6-j --target=jar --output=blib/lib/A/B/C1.pm.jar lib/A/B/C1.pm
% perl6-j --target=jar --output=blib/lib/A/B/C2.pm.jar lib/A/B/C2.pm
% perl6-j -I blib/lib -e'use A​::B​::C1; use A​::B​::C2; say A​::B​::C1.^methods'
Could not find symbol '&C1'
  in method <anon> at gen/jvm/CORE.setting​:13700
  in any find_method_fallback at gen/jvm/Metamodel.nqp​:2714
  in any find_method at gen/jvm/Metamodel.nqp​:988
  in any at gen/jvm/BOOTSTRAP.nqp​:1700
  in block <unit> at -e​:1

Loading

@p6rt
Copy link
Author

@p6rt p6rt commented Nov 22, 2014

Loading

@p6rt
Copy link
Author

@p6rt p6rt commented Nov 22, 2014

From @dwarring

Tests added to S10-packages/precompilation.t

On Sat Nov 22 10​:17​:51 2014, david.warring wrote​:

Consider three simple classes​:

lib/A.pm​:
class A {}

lib/A/B/C1.pm​:
class A​::B​::C1 { use A; method foo(){} }

lib/A/B/C2.pm​:
class A​::B​::C2 { use A; method foo(){} }

% perl6-m --version
This is perl6 version 2014.11-9-g3bbf7bc built on MoarVM version
2014.11-17-g972d95b
% perl6-m --target=mbc --output=blib/lib/A.pm.moarvm lib/A.pm
% perl6-m --target=mbc --output=blib/lib/A/B/C1.pm.moarvm
lib/A/B/C1.pm
% perl6-m --target=mbc --output=blib/lib/A/B/C2.pm.moarvm
lib/A/B/C2.pm
% perl6-m -I blib/lib -e'use A​::B​::C1; use A​::B​::C2; say
A​::B​::C1.^methods'
Could not find symbol '&C1'
in method <anon> at src/gen/m-CORE.setting​:13777
in any find_method_fallback at src/gen/m-Metamodel.nqp​:2725
in any find_method at src/gen/m-Metamodel.nqp​:988
in block <unit> at -e​:1

With parrot​:

% perl6-p -I blib/lib --target=pir --output=blib/lib/A.pm.pir lib/A.pm
% perl6-p -I blib/lib --target=pir --output=blib/lib/A/B/C1.pm.pir
lib/A/B/C1.pm
% perl6-p -I blib/lib --target=pir --output=blib/lib/A/B/C2.pm.pir
lib/A/B/C2.pm
% perl6-p -I blib/lib -e'use A​::B​::C1; use A​::B​::C2; say
A​::B​::C1.^methods'
Could not find symbol '&C1'
in method <anon> at gen/parrot/CORE.setting​:13717
in any find_method_fallback at gen/parrot/Metamodel.nqp​:2795
in any find_method at gen/parrot/Metamodel.nqp​:989
in any at gen/parrot/BOOTSTRAP.nqp​:1708
in block <unit> at -e​:1

and with JVM backend.

% perl6-j --target=jar --output=blib/lib/A.pm.jar lib/A.pm
% perl6-j --target=jar --output=blib/lib/A/B/C1.pm.jar lib/A/B/C1.pm
% perl6-j --target=jar --output=blib/lib/A/B/C2.pm.jar lib/A/B/C2.pm
% perl6-j -I blib/lib -e'use A​::B​::C1; use A​::B​::C2; say
A​::B​::C1.^methods'
Could not find symbol '&C1'
in method <anon> at gen/jvm/CORE.setting​:13700
in any find_method_fallback at gen/jvm/Metamodel.nqp​:2714
in any find_method at gen/jvm/Metamodel.nqp​:988
in any at gen/jvm/BOOTSTRAP.nqp​:1700
in block <unit> at -e​:1

Loading

@p6rt
Copy link
Author

@p6rt p6rt commented Jan 2, 2016

From @dwarring

This could be a bit of a non-issue in Perl 6.c, which handles precompilation and gets this right​:

$ perl6 --version
This is Rakudo version 2015.12-72-g3ea4dff built on MoarVM version 2015.12
implementing Perl 6.c.
$ $ perl6-m -I lib -e'use A​::B​::C1; use A​::B​::C2; say A​::B​::C1.^methods'
(foo)

On Sat Nov 22 12​:00​:26 2014, david.warring wrote​:

Tests added to S10-packages/precompilation.t

On Sat Nov 22 10​:17​:51 2014, david.warring wrote​:

Consider three simple classes​:

lib/A.pm​:
class A {}

lib/A/B/C1.pm​:
class A​::B​::C1 { use A; method foo(){} }

lib/A/B/C2.pm​:
class A​::B​::C2 { use A; method foo(){} }

% perl6-m --version
This is perl6 version 2014.11-9-g3bbf7bc built on MoarVM version
2014.11-17-g972d95b
% perl6-m --target=mbc --output=blib/lib/A.pm.moarvm lib/A.pm
% perl6-m --target=mbc --output=blib/lib/A/B/C1.pm.moarvm
lib/A/B/C1.pm
% perl6-m --target=mbc --output=blib/lib/A/B/C2.pm.moarvm
lib/A/B/C2.pm
% perl6-m -I blib/lib -e'use A​::B​::C1; use A​::B​::C2; say
A​::B​::C1.^methods'
Could not find symbol '&C1'
in method <anon> at src/gen/m-CORE.setting​:13777
in any find_method_fallback at src/gen/m-Metamodel.nqp​:2725
in any find_method at src/gen/m-Metamodel.nqp​:988
in block <unit> at -e​:1

With parrot​:

% perl6-p -I blib/lib --target=pir --output=blib/lib/A.pm.pir lib/A.pm
% perl6-p -I blib/lib --target=pir --output=blib/lib/A/B/C1.pm.pir
lib/A/B/C1.pm
% perl6-p -I blib/lib --target=pir --output=blib/lib/A/B/C2.pm.pir
lib/A/B/C2.pm
% perl6-p -I blib/lib -e'use A​::B​::C1; use A​::B​::C2; say
A​::B​::C1.^methods'
Could not find symbol '&C1'
in method <anon> at gen/parrot/CORE.setting​:13717
in any find_method_fallback at gen/parrot/Metamodel.nqp​:2795
in any find_method at gen/parrot/Metamodel.nqp​:989
in any at gen/parrot/BOOTSTRAP.nqp​:1708
in block <unit> at -e​:1

and with JVM backend.

% perl6-j --target=jar --output=blib/lib/A.pm.jar lib/A.pm
% perl6-j --target=jar --output=blib/lib/A/B/C1.pm.jar lib/A/B/C1.pm
% perl6-j --target=jar --output=blib/lib/A/B/C2.pm.jar lib/A/B/C2.pm
% perl6-j -I blib/lib -e'use A​::B​::C1; use A​::B​::C2; say
A​::B​::C1.^methods'
Could not find symbol '&C1'
in method <anon> at gen/jvm/CORE.setting​:13700
in any find_method_fallback at gen/jvm/Metamodel.nqp​:2714
in any find_method at gen/jvm/Metamodel.nqp​:988
in any at gen/jvm/BOOTSTRAP.nqp​:1700
in block <unit> at -e​:1

Loading

@p6rt
Copy link
Author

@p6rt p6rt commented Apr 10, 2016

From @usev6

On Sat Jan 02 13​:14​:43 2016, david.warring wrote​:

This could be a bit of a non-issue in Perl 6.c, which handles
precompilation and gets this right​:

$ perl6 --version
This is Rakudo version 2015.12-72-g3ea4dff built on MoarVM version
2015.12
implementing Perl 6.c.
$ $ perl6-m -I lib -e'use A​::B​::C1; use A​::B​::C2; say
A​::B​::C1.^methods'
(foo)

This still looks good. The test in S10-packages/precompilation.t doesn't pass, though​:

not ok 31 - RT123276# TODO RT \#​123276

# Failed test 'RT123276'
# at t/spec/S10-packages/precompilation.rakudo.moar line 120
# expected​: $["foo"]
# got​: $["(foo)"]

The output $["(foo)"] looks right to me, so IMHO the test should be adjusted, probably in 6.c-errata as well.

Loading

@p6rt
Copy link
Author

@p6rt p6rt commented Apr 10, 2016

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

Loading

@p6rt
Copy link
Author

@p6rt p6rt commented Apr 12, 2016

From @dwarring

Thanks @​Christian
Have fixed/unfudged the roas test in master. Closing this ticket.
- David
On Sun Apr 10 08​:35​:16 2016, bartolin@​gmx.de wrote​:

On Sat Jan 02 13​:14​:43 2016, david.warring wrote​:

This could be a bit of a non-issue in Perl 6.c, which handles
precompilation and gets this right​:

$ perl6 --version
This is Rakudo version 2015.12-72-g3ea4dff built on MoarVM version
2015.12
implementing Perl 6.c.
$ $ perl6-m -I lib -e'use A​::B​::C1; use A​::B​::C2; say
A​::B​::C1.^methods'
(foo)

This still looks good. The test in S10-packages/precompilation.t
doesn't pass, though​:

not ok 31 - RT123276# TODO RT \#​123276

# Failed test 'RT123276'
# at t/spec/S10-packages/precompilation.rakudo.moar line 120
# expected​: $["foo"]
# got​: $["(foo)"]

The output $["(foo)"] looks right to me, so IMHO the test should be
adjusted, probably in 6.c-errata as well.

Loading

@p6rt
Copy link
Author

@p6rt p6rt commented Apr 12, 2016

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

Loading

@p6rt p6rt closed this Apr 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant