Editor Build & Bob Build scriptc output

When building with bob I am unable to get the output of my script files to match what is produced in the editor, and as a result, error messages reported at runtime with projects built with bob have line numbers that do not align with the source code, while the projects built in the editor report the correct line numbers.

When building in the Edtior it appears that the output protobuf for a resulting .scriptc file that is generated in build/default has the following structure…
Source code (optional) > filename > bytecode

When building with bob:
filename > bytecode

When building with bob I am using the following command:
/Applications/Defold.app/Contents/Resources/packages/jdk11.0.1-p1/bin/java -cp /Applications/Defold.app/Contents/Resources/packages/defold-03b14982258f69eb8a06d28810ae879e16bd63d7.jar com.dynamo.bob.Bob --input "/Users/thejustinwalsh/Projects/tiny-stg/app" --root "/Users/thejustinwalsh/Projects/tiny-stg/app" --variant debug build

*Note: I have tried with and without --variant debug and get the same results

The output matching is desired so that I can build proper integration with vs code.

Additional context: I am working on problem matches for vs code and noticed it pointing to the wrong line of code, as well as source maps failing to resolve.

I’ve attached the two file outputs below for reference.
scriptc-deffs.zip (8.1 KB)

1 Like

Even when compiled to LuaJIT bytecode, it should be tagged with info so that callstack can be properly generated.

It would be helpful to see the original source to compare/test with.

1 Like

Working on a minimal repro, and have not isolated what is causing it yet.
Going to spend some time trying things 1 by 1 until I can get a good minimal repro going.

1 Like

I still can’t determine exactly what breaks this, I have several projects that map the debug output correctly, and 1 that doesn’t… haha

1 Like

Ouff, how annoying!
Thanks for trying to pinpoint it!

Same here, our callstacks in Google Analytics don’t line up with reality. One of those things that I need to investigate but never quite have time for.

Are you talking about the Lua callstacks here? Or the C++ ones?

Lua.

Same, Lua.
Comfort in knowing it is not just me. :laughing:

I will get to the bottom of this, but so far it seems that you must have multiple requires in your script for this to happen. Not sure if you are seeing the same thing @AarrrBee.

1 Like

We use modules quite extensively, typically a script will require 1-2 external modules (cursor, monarch) and 6-8 internal ones. Last time I looked we only had 2 frequent errors, both of which had callstacks that exhibited this problem.

2 Likes