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
"duplicate definition of symbol grammar" using Grammar::Tracer in .pm6 file #4971
Comments
From @ShimmerFairy$ cat Foo.pm6 It appears that, for whatever reason, using Grammar::Tracer from within a module file causes that strange low-level error. Note that attempting 'use Grammar::Tracer' in a non-module file or directly in one-liners doesn't seem to be an issue: $ perl6 Foo.pm6 |
From @MARTIMMOn 12/31/2015 01:47 PM, Faye (via RT) wrote:
summarized here... (p.s. the test file is from my own project and the I get the following error; perl6 t/070-run-command.t Searching for the symbol gave me exactly one location where it was |
The RT System itself - Status changed from 'new' to 'open' |
From @lizmat
This appears to be happening *inside* an nqp::loadbytecode of CompUnit::Loader.load-precompilation-file . Which would lead me to think that some dynamic variable is not set up correctly. Liz |
From @ninerReverting commit b384d8f777f6169052c25e5cc37353f01b8f5f1a is "fixing" this so the bug is in Perl6::ModuleLoader. Before that commit, resolve_reposession_conflicts was utterly broken (and has been so since at least summer) causing for example failures when precompiling (even manually) HTTP::UserAgent. The fix simply re-used the same logic for merging globals that we also use during compilation for fixing up conflicts when loading precomp files. And that's where it becomes really puzzling. If it works during compilation, it ought to work after loading a precompiled version, as it's the same code for the same job. The difference between Grammar::Tracer and more mundane modules is EXPORTHOW instead of EXPORT. So maybe merge_globals is just missing some HOW handling. The smalles test case is this: nine@sphinx:~/test/lib> cat Demo.pm |
From @ninerAdding some debug output to merge_globals makes this riddle even more puzzling: nine@sphinx:~/test/lib> perl6 --ll-exception -I. -e 'use Demo;' # with precompilation After "Checking symbol" there's this comparison: |
From @ninerFixed in rakudo commit 2d91f08585bcd75aabcd2513103a7eb985df5689 When an EXPORT or EXPORTHOW routine assigns a symbol as in: |
@niner - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#127107 (status was 'resolved')
Searchable as RT127107$
The text was updated successfully, but these errors were encountered: