Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lua import function not working property on Linux/MacOS #501

Open
caioavidal opened this issue Jul 4, 2023 · 4 comments
Open

Lua import function not working property on Linux/MacOS #501

caioavidal opened this issue Jul 4, 2023 · 4 comments

Comments

@caioavidal
Copy link
Contributor

caioavidal commented Jul 4, 2023

Hello,

I noticed an issue while working with NLua where the import functionality behaves differently on Linux/MacOS compared to Windows. I have encountered a scenario where running the following code works fine and the Lua script is executed without any problems:

lua.LoadCLRPackage();
lua.DoString("import 'Game.Common'");
lua.DoString("import 'Game.Common.A'");
lua.DoString("import 'Game.Common.B'");
lua.DoString("import 'Game.Common.C'");

However, when attempting to execute the following code, it doesn't work and causes the entire application to crash:

lua.LoadCLRPackage();
lua.DoString(@"import 'Game.Common'
              import 'Game.Common.A'
              import 'Game.Common.B'
              import 'Game.Common.C'");

It's important to note that both cases work fine on Windows.
I'm running on Ubuntu 22.04

Thank you for your attention to this matter.

@viniciusjarina
Copy link
Member

What happen? it crashes? do you have the stacktrace? you running on Mono? .NET ?

@caioavidal
Copy link
Contributor Author

caioavidal commented Jul 7, 2023

What happen? it crashes? do you have the stacktrace? you running on Mono? .NET ?

The application crashes. There is no stacktrace the app simply crashes.
I'm running .NET 7 on Ubuntu 22.04

@viniciusjarina
Copy link
Member

Can you write a small test case? I don't know what is Game Game.Common etc

Underscore76 added a commit to Underscore76/SDVTASMod that referenced this issue Dec 27, 2023
* `Controller.SkipSave` exposed (set to false to enable saving)
* Save/loading of files now restricted to `StardewTAS/Saves` folder
* remove lua reloading because it was crashing on mac (mac has a reported NLua bug where import fails (NLua/NLua#501), lua will generally fail ~40% of the time on initial load)
* Added dynamic text panel in the bottom left
* Added lua advance throttling (you can define the target FPS for lua advancing or let it run uncapped, helps with playback/testing)
* Added lua advance ejection: press both `-=` to throw an error and stop lua frame advancing (useful when you find yourself in an infinte frame advance loop...)
* Path finding now won't freak out about flooring/torches
@Underscore76
Copy link

Howdy @viniciusjarina, so I have a small test app that repros the same issue

https://github.com/Underscore76/NLuaMacDebug/tree/main

it feels super weird why some combinations work and some don't (called out in the readme). Happy to help try and debug, but the crash that occurs isn't giving me anything (it just exits directly, not a thrown error that I can catch or anything on stderr...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants