janet: Error when executing compiled executable

When I compile an executable with jpm’s declare-executable the resulting binary does not work and only produces:

janet top level signal - "funcdef has invalid bytecode"

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 36 (36 by maintainers)

Most upvoted comments

Thanks for all the help in diagnosing this @bakpakin @sogaiu !

libpath looks wrong to me, I would have expected /home/tionis/.local/lib instead of /home/tionis/.local/lib/janet

I think you mentioned elsewhere that you’d worked on an Arch Linux PKGBUILD that GrayJack was / is the maintainer of.

Is it possible there is some remnant from that or related AUR package?

I didn’t test it on this machine I think, I also could find any remnants of another janet installation when searching through /usr/include /usr/local/include /usr/lib and friends

I’m guessing the linker is picking up libjanet.a then from somewhere - what does jpm show-paths show for libpath? This is where the static and dynamic libraries will be linked to the executables created by jpm.

Perhaps try clearing jpm cache and rebuild all dependencies from scratch, the addition of new instructions would break existing compiled bytecode.

Given the bisected commit, without a repro I would have to guess this is user error - using one version of janet to build and different version of janet to execute somehow.