From 8781a6d4f9d5840c7c9954706c972564bd40e76e Mon Sep 17 00:00:00 2001 From: forever2k38 Date: Tue, 13 Oct 2026 22:10:24 +0200 Subject: feat: copy build config instead of just makeopts --- src/package.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/package.c') diff --git a/src/package.c b/src/package.c index 76216c7..2a947c0 100644 --- a/src/package.c +++ b/src/package.c @@ -167,7 +167,7 @@ int pow_extract_package_info(lua_State *L, pow_package *pkg) { return 0; } -int pow_package_open(pow_package *pkg, pow_config *cfg, const char *path) { +int pow_package_open(lua_State *L_global, pow_package *pkg, pow_config *cfg, const char *path) { FILE *fp; int c; int err; @@ -212,10 +212,12 @@ int pow_package_open(pow_package *pkg, pow_config *cfg, const char *path) { package_buffer[total] = '\0'; - lua_State *L = luaL_newstate(); + lua_State *L = lua_newthread(L_global); pkg->L = L; + // push the config object from cfg thread to pkg thread + luaL_openlibs(L); pow_lua_load(L, cfg); -- cgit v1.3