Ticket #1656 (closed bug: invalid)

Opened 4 years ago

Last modified 4 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

Description

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);
    imcc_init(interp);

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

}

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.

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 4 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


-- 
Salu2

Changed 4 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.