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