Ticket #692 (closed bug: fixed)

Opened 13 years ago

Last modified 11 years ago

PBC to PIR fallback fails.

Reported by: coke Owned by: jkeenan
Priority: normal Milestone:
Component: testing Version: 1.2.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:

Description

$ which parrot
/usr/local/bin/parrot
$ parrot --version
This is Parrot version 1.2.0 built for i386-linux.
Copyright (C) 2001-2009, Parrot Foundation.

This code is distributed under the terms of the Artistic License 2.0.
For more details, see the full text of the license in the LICENSE file
included in the Parrot source tree.

$ cat foo.pir
.sub main :main
  load_bytecode 'Tcl/Glob.pbc'
.end
$ parrot foo.pir
PackFile_unpack: This is not a valid Parrot bytecode file
Parrot VM: Can't unpack packfile /usr/local/lib/parrot/1.2.0/library/Tcl/Glob.pir.
Unable to append PBC to the current directory
current instr.: 'main' pc 0 (foo.pir:2)

NotFound++ suggests that it's falling back on the /filename/, but not the expected content type, and is then trying to load the .pir file as if it were a .pbc.

Change History

Changed 13 years ago by coke

This problem exists in PIR files that are installed that load other pir files:

$ cat foo.pir
.sub main :main
  .include "test_more.pir"
.end
$ parrot foo.pir
PackFile_unpack: This is not a valid Parrot bytecode file
Parrot VM: Can't unpack packfile /usr/local/lib/parrot/1.2.0/library/Test/More.pir.
Unable to append PBC to the current directory
current instr.: 'main' pc 0 (foo.pir:17)

(We really need to start testing the things we install.)

Changed 13 years ago by allison

I committed a fix for this in r39026. It passes this simple test case, if it also passes for Tcl, then this ticket can be closed.

Changed 13 years ago by allison

Here's my test case:

$ cat pbc_fallback.pir
.sub main :main
  load_bytecode 'loadtest.pbc'
.end

$ cat loadtest.pir
.sub 'loaded' :load
    say 'loaded'
.end

Running that before r39026 fails with the same error message as above, and after correctly prints 'loaded'.

Changed 13 years ago by coke

Verified, the bits of tcl that complained are happy again running against this version.

However, we can't close the ticket until allison's snippet is added as a test.

Changed 11 years ago by jkeenan

  • owner set to jkeenan
  • status changed from new to assigned
  • component changed from none to testing
Created commit d6ce563: Add test file and test sample file
 to address http://trac.parrot.org/parrot/ticket/692.
 5 files changed, 55 insertions(+), 0 deletions(-)
 create mode 100644 t/pir/pbc_fallback.t
 create mode 100644 t/pir/testlib/loadtest.pir

Created commit e3565e2: Improve POD.
 1 files changed, 1 insertions(+), 1 deletions(-)

This should satisfy the test requirement. Please review. I will close ticket within 3 days unless there are objections.

Thank you very much.

kid51

Changed 11 years ago by jkeenan

  • status changed from assigned to closed
  • resolution set to fixed

No objections heard. Closing ticket. Thank you very much.

Note: See TracTickets for help on using tickets.