lune icon indicating copy to clipboard operation
lune copied to clipboard

Make `Runtime::run` Return Lua Values

Open CompeyDev opened this issue 1 year ago • 6 comments

This PR intends to return a more meaningful output for Runtime::run invocations. Instead of only returning an ExitCode, Runtime::run now returns a tuple including a Vec of values returned by the lua thread.

TODO:

  • [x] Return the actual exit code instead of an enum variant
    • [x] Depends on https://github.com/lune-org/mlua-luau-scheduler/pull/1 to be merged
  • [x] Return lua values
    • [x] Update dependents to consume tuple

Once merged, this closes #175 and closes #92.

CompeyDev avatar Apr 11 '24 13:04 CompeyDev

@filiptibell In order to return consumable exit information, exit.rs in mlua-luau-scheduler needs to return an ExitStatus instead of an ExitCode.

I'll go ahead and create an issue in the repo.

CompeyDev avatar Apr 11 '24 13:04 CompeyDev

I'm currently returning the raw exit code, instead of an ExitStatus since there doesn't seem to be any way to construct one out of an exit code.

See https://github.com/lune-org/mlua-luau-scheduler/pull/1/

CompeyDev avatar Apr 12 '24 10:04 CompeyDev

Just a heads up - since this is a breaking change it's going to take a while before it gets merged. I've added it to the 0.9 milestone to make sure it's not forgotten for that

filiptibell avatar Apr 18 '24 10:04 filiptibell

Would it be possible to merge this before #188?

CompeyDev avatar Apr 22 '24 06:04 CompeyDev

Would it be possible to merge this before #188?

#188 is not going to have any breaking changes, and the plan is to make a patch release with that PR + changes on main, so it would be difficult to get this PR in before

filiptibell avatar Apr 22 '24 14:04 filiptibell

Guess I will restructure once the restructuring is complete.

CompeyDev avatar Apr 22 '24 16:04 CompeyDev