Ticket #1819 (new patch)

Opened 11 years ago

Last modified 11 years ago

mk_language_shell.pl generates broken PMC boilerplate

Reported by: ellefu Owned by: dukeleto
Priority: normal Milestone:
Component: tools Version: 2.8.0
Severity: medium Keywords:
Cc: Language:
Patch status: new Platform: unix


When one runs mk_language_shell.pl --with-pmc, the resulting boilerplate .pmc file doesn't even compile. There's a "property" variable that's used uninitialized, and a mysterious "shape" variable that's never defined. What's up with that?

Patch attached.


patch.txt Download (1.3 KB) - added by ellefu 11 years ago.
Patch for mk_language_shell.pl bug
updated_patch.txt Download (1.5 KB) - added by ellefu 11 years ago.

Change History

Changed 11 years ago by ellefu

Patch for mk_language_shell.pl bug

Changed 11 years ago by dukeleto

  • patch changed from new to obsolete

I tried mk_language_shell --with-pmc with parrot 49387 and it compiled and passed tests.

Can you attach the output of "parrot_config revision" and the complete error message that you get when compiling?

Changed 11 years ago by dukeleto

  • patch changed from obsolete to new

Changed 11 years ago by ellefu

Aha! I see the problem. In SVN, there's a separate bug which is masking this bug -- a missing C open-comment after init(). I'll attach a new patch. It may be compiling on your system, but it's not working -- it's just ignoring everything in the .pmc file after init()! pmc2c's almost complete lack of error reporting is becoming quite troublesome.

If I add this patch to my working copy:

--- tools/dev/mk_language_shell.in      (revision 49475)
+++ tools/dev/mk_language_shell.in      (working copy)
@@ -647,6 +647,8 @@

 =item C<PMC* get()>

 Returns a vector-like PMC.

...I get this output when I try to do parrot setup.pir build:

cc -c -o  src/pmc/yourmom.o [ten million gcc switches] src/pmc/yourmom.c
./src/pmc/yourmom.pmc: In function âParrot_YourMom_nci_getâ:
./src/pmc/yourmom.pmc:111: error: âshapeâ undeclared (first use in this function)
./src/pmc/yourmom.pmc:111: error: (Each undeclared identifier is reported only once
./src/pmc/yourmom.pmc:111: error: for each function it appears in.)
exit status: 256

...which is the bug my initial patch addressed. I'll update the attachment to contain both fixes. Thanks!

Changed 11 years ago by ellefu

Changed 11 years ago by cotto

ellefu, I applied (but didn't commit) your patch (updated_patch.txt), and while it does fix some obvious problems, the generated PMC still doesn't build. You're welcome to get the PMC to build properly (and I'll be glad to apply such a patch).

If you're feeling more ambitious, I think it'd be helpful if new HLL developers had a more user-friendly PMC as a template. Looking at the generated PMC, it's not entirely clear what it is or what it's supposed to do. When a new developer comes along, it'd be better to present a PMC with common semantics (i.e. Integer, Hash, etc) so that the developer won't have to spend as much time figuring out what the PMC does before moving on to figuring out how it does it. That said, I'm sure any new developer will spend lots of time looking at Parrot's core PMCs and any dynpmcs available, so there's no need for the template PMC to be anything more than a good clear starting point.

Note: See TracTickets for help on using tickets.