load_bytecode handling with(out) extensions
Reini Urban
rurban at x-ray.at
Sun Jan 4 22:41:07 UTC 2009
Reini Urban schrieb:
> I'm walking in a src/library.c minefield. There more tests I write the
> more bugs I find.
>
> I guess there once was a seperate codepath for finding .pir and .pbc.
> Parrot_load_bytecode() sets PARROT_RUNTIME_FT_PBC or
> PARROT_RUNTIME_FT_SOURCE. But it's lost now.
> The 3rd arg in Parrot_locate_runtime_file_str(interp, file_str,
> file_type); is ignored.
>
> I want to re-add the filetype check with TT #128, because other API's
> might want to use it also. Favor .pasm over .pir, find no .pbc.
>
> But we have a more severe problem:
>
> If we load_bytecode a file without extension, we favour .pbc,
> .pir or .pasm. So load_bytecode should always set PARROT_RUNTIME_FT_PBC.
>
> But when with load_bytecode "Date/Dumper" the .pbc is found, we
> currently try to compile the .pbc. Error! Because the file_type is wrong.
>
> Or should we do a timestamp check as in python?
> Only when no extension is given? Now we might find an older .pbc and
> load this instead.
> With .pir the file is automatically compiled but the compilation is not
> stored. (unlike python)
>
> I think I have to fix some code in Parrot_load_bytecode()
>
> The current logic is like this:
>
> When given an extension, load the file.
> If not found, append all other extensions in the order: .pbc, .pasm, .pir
>
> When given no extension, we might have a conflict with a directory which
> is solved in the pdd30install_stage3 branch.
> http://www.parrotvm.org/svn/parrot/revision?rev=34932
>
> The Parrot_load_bytecode() setting of PARROT_RUNTIME_FT_PBC or
> PARROT_RUNTIME_FT_SOURCE is ignored. So we always favor .pbc over .pir
>
> We might think of checking the timestamps when we find .pir and .pbc and
> no extension is given. Python does so and does even automatic
> re-compilation.
>
> This looks to be the first step, to get the extension handling right.
> Check the file_type after the library search found it.
r34941 | rurban++ | branches/pdd30install_stage3/src:
fix TT #129 load_bytecode without extension, do not recompile the found
.pbc.
review: http://www.parrotvm.org/svn/parrot/revision?rev=34941
--
Reini Urban
http://phpwiki.org/ http://murbreak.at/
More information about the parrot-dev
mailing list