Ticket #224 (closed bug: fixed)

Opened 13 years ago

Last modified 13 years ago

lib/Parrot/Pmc/Dumper.pm: Filename does not match package declaration inside

Reported by: jkeenan Owned by:
Priority: normal Milestone:
Component: configure Version:
Severity: medium Keywords:
Cc: infinoid Language:
Patch status: Platform:

Description

While studying TT #219 today, I had occasion to look into lib/Parrot/Pmc/Dumper.pm. I was surprised to see that the package declaration inside doesn't match the file's name.

$ head lib/Parrot/Pmc2c/Dumper.pm 
# Copyright (C) 2004-2006, The Perl Foundation.
# $Id: Dumper.pm 26349 2008-03-13 19:40:07Z infinoid $
package Parrot::Pmc2c::Pmc2cMain;
use strict;
use warnings;
use Parrot::Pmc2c::UtilFunctions qw(slurp spew filename);
use Parrot::Pmc2c::Parser qw(parse_pmc);
use Carp;

This is the same package declaration found in lib/Parrot/Pmc2c/Pmc2cMain.pm, which uses Parrot::Pmc2c::Dumper.

$ head lib/Parrot/Pmc2c/Pmc2cMain.pm 
# Copyright (C) 2004-2008, The Perl Foundation.
# $Id: Pmc2cMain.pm 35947 2009-01-24 06:35:14Z coke $
package Parrot::Pmc2c::Pmc2cMain;
use strict;
use warnings;

use Storable;
use Parrot::PMC ();
use Parrot::Pmc2c::VTable ();
use Parrot::Pmc2c::Dumper;

I don't yet understand how this manages to work. But when I substituted

package Parrot::Pmc2c::Dumper;

... in the file of the corresponding name, make failed quickly:

/usr/local/bin/perl tools/build/c2str.pl src/spf_vtable.c > src/spf_vtable.str
/usr/local/bin/perl tools/build/c2str.pl src/sub.c > src/sub.str
/usr/local/bin/perl tools/build/c2str.pl src/stacks.c > src/stacks.str
/usr/local/bin/perl tools/build/pmc2c.pl --vtable
/usr/local/bin/perl tools/build/pmc2c.pl --dump src/pmc/default.pmc
Can't locate object method "dump_pmc" via package "Parrot::Pmc2c::Pmc2cMain" at tools/build/pmc2c.pl line 50.
make: *** [src/pmc/default.dump] Error 255
Compiling with:
xx.c
/usr/bin/gcc -I./include -fno-common -no-cpp-precomp -pipe -I/opt/local/include -pipe -fno-common -Wno-long-double -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -falign-functions=16 -fvisibility=hidden -funit-at-a-time -W -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wdisabled-optimization -Wendif-labels -Wextra -Wformat -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wmissing-braces -Wmissing-field-initializers -Wno-missing-format-attribute -Wmissing-include-dirs -Wpacked -Wparentheses -Wpointer-arith -Wreturn-type -Wsequence-point -Wno-shadow -Wsign-compare -Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs -Wundef -Wunknown-pragmas -Wno-unused -Wvariadic-macros -Wwrite-strings -Wbad-function-cast -Wdeclaration-after-statement -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wnonnull -I/sw/include -DHAS_GETTEXT -g -Wno-shadow -DHAS_JIT -DPPC -DHAVE_COMPUTED_GOTO -I. -o xx.o -c xx.c
/usr/local/bin/perl tools/build/pmc2c.pl --dump src/pmc/default.pmc
Can't locate object method "dump_pmc" via package "Parrot::Pmc2c::Pmc2cMain" at tools/build/pmc2c.pl line 50.
make: *** [src/pmc/default.dump] Error 255

Thoughts on how we can remedy this anomaly?

Thank you very much.
kid51

Change History

Changed 13 years ago by chromatic

  • status changed from new to closed
  • resolution set to fixed

Exporting dump_pmc() should work. That's what I did in r35977. If that doesn't work, we can reopen this ticket.

Note: See TracTickets for help on using tickets.