Comments (4)
I agree that it is indeed strange, as I'd expect the statically compiled executable to use the library that is compiled in instead of trying to resolve the links dynamically.
The only difference between launching outside of the IDE and from it is that the environment variables are set differently. Can you try running wx.wxUnsetEnv('LUA_CPATH')
before calling ExecuteCommand
? It will have to be restored after the call, so it's working for other calls, but it will allow you at least to check if it helps with this issue or not.
from zerobranestudio.
That was the secret! I'll dig some more to see if I can change the behavior of Singe to make more sense, but for now, that fixed it.
Thank you!
from zerobranestudio.
@sduensin, that's an interesting approach; thank you for sharing! I would have simply used https://www.lua.org/manual/5.4/manual.html#luaL_requiref, but, as described in the post, it's a good way to solve this problem (by only loading what's actually used).
from zerobranestudio.
For anyone reading this later, here's how I finally really fixed it...
My embedded Lua instance and it's embedded modules used the searcher code I found here:
https://leiradel.github.io/2020/03/01/Embedding-Lua-Modules.html
That adds the new searcher to the end of the package searcher table. I modified the code to put it at the head:
// Get the package global table
lua_getglobal(L, "package");
// Get the list of searchers in the package table
lua_getfield(L, -1, "searchers");
// Get the number of existing searchers in the table
length = lua_rawlen(L, -1);
// Shift existing elements to make room for ours
for (i=length+1; i>1; i--) {
lua_rawgeti(L, -2, i - 1);
lua_rawseti(L, -2, i);
}
// Add our own searcher to the front of the list
lua_pushcfunction(L, luaSearcher);
//lua_rawseti(L, -2, length + 1);
lua_rawseti(L, -2, 1);
// Remove the seachers and the package tables from the stack
lua_pop(L, 2);
from zerobranestudio.
Related Issues (20)
- Search - Find in files. wxLua Runtime Error when specify file path HOT 2
- Studio .app crashes on M1, Sonoma beta HOT 17
- Live coding in Love2D broken HOT 7
- The search box should accept Ctrl+A to select all text... HOT 1
- Windows: ZeroBrane built-in lua interpreters perform unavoidable command line file globbing HOT 4
- Plugin Settings HOT 3
- Zerobrane crash when renaming a file to a name that already exists HOT 3
- [request] column text edition mode HOT 3
- Failed to add image 'zbstudio/res/32/FOLDER-PROJECT.png' to the image list. HOT 8
- minifier plugin or tool?
- Segfault when creating a new file HOT 5
- CadZinho integrated with ZeroBrane Studio
- ZBS stops while debugging HOT 4
- ZBS error while closing child windows HOT 7
- Changing LUA Interpreter for Zerobrane itself
- Console window input problems
- Lua Error While running Chunk HOT 12
- Debug output console don't relay keypress
- Download links are broken HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zerobranestudio.