Ticket #1656 (closed bug: invalid)

Opened 12 years ago

Last modified 12 years ago

Embed API cannot find core PBC or PIR files

Reported by: dukeleto Owned by:
Priority: critical Milestone:
Component: embed/extend Version: 2.4.0
Severity: high Keywords:
Cc: Language:
Patch status: Platform: all


This test program:

#include "parrot/embed.h"
#include "parrot/extend.h"

Parrot_Interp interp;

int main(int argc, char *argv[])
    Parrot_PMC func_pmc;
    Parrot_String err, filename;

    interp = Parrot_new(NULL);

    filename = Parrot_str_new(interp, "P6object.pbc");
    //filename = Parrot_str_new(interp, "P6object.pir");


Compiled with

$ cc embed2.c -o embed2 `pkg-config --cflags --libs parrot`; ./embed2


"load_bytecode" couldn't find file 'P6object.pbc'

The same thing happens when trying to load the PIR file.

This makes loading test_more.pir or any core PBC from the Embedding API very cumbersome, since the full path needs to be figured out via many parrot_config keys. This specifically effects PL/Parrot, which needs to load P6object.pbc to work correctly.

Core PBC and PIR files should be loadable without jumping through these hoops.

Change History

Changed 12 years ago by julian.notfound@…

>  Compiled with
>  {{{
>  $ cc embed2.c -o embed2 `pkg-config --cflags --libs parrot`; ./embed2
>  }}}
>  gives:
>  {{{
>  "load_bytecode" couldn't find file 'P6object.pbc'
>  }}}
>  The same thing happens when trying to load the PIR file.

You need to link the parrot_config object file and call Parrot_set_config_hash

See examples/embed


Changed 12 years ago by dukeleto

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

Thanks to Notfound++, I realize this isn't so much a bug, as a lack of documentation in docs/embed.pod describing this. I am closing this ticket.

Note: See TracTickets for help on using tickets.