Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

load_bytecode no longer loads PBCs from the CWD

0 views
Skip to first unread message

Bob Rogers

unread,
Dec 7, 2005, 9:13:29 PM12/7/05
to perl6-i...@perl.org
The change below means that the following code no longer works for
loading non-Parrot compiled libraries from the current directory:

load_bytecode "structures.pbc"

Must I specify an absolute pathname to get the original behavior?

-- Bob Rogers
http://rgrjr.dyndns.org/

------------------------------------------------------------------------
Index: src/packfile.c
===================================================================
--- src/packfile.c (revision 10372)
+++ src/packfile.c (revision 10373)
@@ -3388,7 +3388,9 @@

ext = strrchr(filename, '.');
if (ext && strcmp (ext, ".pbc") == 0) {
- pf = PackFile_append_pbc(interpreter, filename);
+ const char *fullname = Parrot_locate_runtime_file(interpreter,
+ filename, PARROT_RUNTIME_FT_PBC);
+ pf = PackFile_append_pbc(interpreter, fullname);
if (!pf) {
internal_exception(1, "Couldn't find PBC file");
return;

Leopold Toetsch

unread,
Dec 8, 2005, 4:19:39 AM12/8/05
to Bob Rogers, perl6-i...@perl.org

On Dec 8, 2005, at 3:13, Bob Rogers wrote:

> The change below means that the following code no longer works for
> loading non-Parrot compiled libraries from the current directory:
>
> load_bytecode "structures.pbc"

Works here w/o problems. The only issue was that it didn't fail for a
missing PBC, but tried to read from stdin, this is fixed in r10400.

leo

Leopold Toetsch

unread,
Dec 8, 2005, 6:11:25 PM12/8/05
to Bob Rogers, perl6-i...@perl.org

On Dec 8, 2005, at 3:13, Bob Rogers wrote:

> The change below means that the following code no longer works for
> loading non-Parrot compiled libraries from the current directory:
>
> load_bytecode "structures.pbc"

I've tested above-like file loading and it worked. OTOH bernhard today
mentioned on IRC that a similar .include "file" didn't work either.
Only a real world example or test revealed the problem, (which should
be fixed now (>= r10407).

A small test case is always a good thing, the more as it can live on
inside t/*/*.t

leo

Bob Rogers

unread,
Dec 8, 2005, 7:52:12 PM12/8/05
to Leopold Toetsch, perl6-i...@perl.org
From: Leopold Toetsch <l...@toetsch.at>
Date: Fri, 9 Dec 2005 00:11:25 +0100

On Dec 8, 2005, at 3:13, Bob Rogers wrote:

> The change below means that the following code no longer works for
> loading non-Parrot compiled libraries from the current directory:
>
> load_bytecode "structures.pbc"

I've tested above-like file loading and it worked. OTOH bernhard today
mentioned on IRC that a similar .include "file" didn't work either.
Only a real world example or test revealed the problem, (which should
be fixed now (>= r10407).

Sorry; I thought I had mentioned that it failed from outside the Parrot
build tree. It now works for me; thanks.

A small test case is always a good thing, the more as it can live on
inside t/*/*.t

leo

I was waiting to learn whether this was a new policy, especially since I
wasn't sure how to write a portable test that did a 'cd' to some
(writable, non-problematic) place outside the Parrot build tree. (Unix
has /tmp, but that has security drawbacks.) Next time, though, I'll try
to be more precise.

-- Bob

0 new messages