Comments (10)
Could you test it? You should be able to do that by fetching that branch and then running
luarocks make rockspecs/compat53-scm-0.rockspec
. Thank you!!
Will do! Give me a moment
from lua-compat-5.3.
Fixed in #64
from lua-compat-5.3.
This is odd because it should be getting those defines from your lua.h
settings. Does this rockspec work?
You can save this file as compat53-0.12-1.rockspec
and run luarocks build compat53-0.12-1.rockspec
.
package = "compat53"
version = "0.12-1"
source = {
url = "https://github.com/lunarmodules/lua-compat-5.3/archive/v0.12.zip",
dir = "lua-compat-5.3-0.12",
}
description = {
summary = "Compatibility module providing Lua-5.3-style APIs for Lua 5.2 and 5.1",
detailed = [[
This is a small module that aims to make it easier to write Lua
code in a Lua-5.3-style that runs on Lua 5.1+.
It does *not* make Lua 5.2 (or even 5.1) entirely compatible
with Lua 5.3, but it brings the API closer to that of Lua 5.3.
]],
homepage = "https://github.com/lunarmodules/lua-compat-5.3",
license = "MIT"
}
dependencies = {
"lua >= 5.1, < 5.5",
--"struct" -- make Roberto's struct module optional
}
build = {
type = "builtin",
modules = {
["compat53.init"] = "compat53/init.lua",
["compat53.module"] = "compat53/module.lua",
["compat53.utf8"] = "lutf8lib.c",
["compat53.table"] = "ltablib.c",
["compat53.string"] = "lstrlib.c",
["compat53.io"] = {
sources = { "liolib.c" },
}
},
platforms = {
windows = {
modules = {
["compat53.io"] = {
defines = { "LUA_USE_WINDOWS" },
}
}
}
}
}
from lua-compat-5.3.
Unfortunately I don't have a Windows system to test this on, so any help debugging this is much appreciated!
from lua-compat-5.3.
This is odd because it should be getting those defines from your
lua.h
settings. Does this rockspec work?You can save this file as
compat53-0.12-1.rockspec
and runluarocks build compat53-0.12-1.rockspec
.package = "compat53" version = "0.12-1" source = { url = "https://github.com/lunarmodules/lua-compat-5.3/archive/v0.12.zip", dir = "lua-compat-5.3-0.12", } description = { summary = "Compatibility module providing Lua-5.3-style APIs for Lua 5.2 and 5.1", detailed = [[ This is a small module that aims to make it easier to write Lua code in a Lua-5.3-style that runs on Lua 5.1+. It does *not* make Lua 5.2 (or even 5.1) entirely compatible with Lua 5.3, but it brings the API closer to that of Lua 5.3. ]], homepage = "https://github.com/lunarmodules/lua-compat-5.3", license = "MIT" } dependencies = { "lua >= 5.1, < 5.5", --"struct" -- make Roberto's struct module optional } build = { type = "builtin", modules = { ["compat53.init"] = "compat53/init.lua", ["compat53.module"] = "compat53/module.lua", ["compat53.utf8"] = "lutf8lib.c", ["compat53.table"] = "ltablib.c", ["compat53.string"] = "lstrlib.c", ["compat53.io"] = { sources = { "liolib.c" }, } }, platforms = { windows = { modules = { ["compat53.io"] = { defines = { "LUA_USE_WINDOWS" }, } } } } }
I'll try this too, I am using the latest (like latest commit) of luarocks because it seems to be the only one that works well on windows
from lua-compat-5.3.
the latest (like latest commit) of luarocks because it seems to be the only one that works well on windows
That is encouraging to hear :) I am planning to cut a new LuaRocks release by the end of the week.
from lua-compat-5.3.
This is odd because it should be getting those defines from your
lua.h
settings. Does this rockspec work?You can save this file as
compat53-0.12-1.rockspec
and runluarocks build compat53-0.12-1.rockspec
.package = "compat53" version = "0.12-1" source = { url = "https://github.com/lunarmodules/lua-compat-5.3/archive/v0.12.zip", dir = "lua-compat-5.3-0.12", } description = { summary = "Compatibility module providing Lua-5.3-style APIs for Lua 5.2 and 5.1", detailed = [[ This is a small module that aims to make it easier to write Lua code in a Lua-5.3-style that runs on Lua 5.1+. It does *not* make Lua 5.2 (or even 5.1) entirely compatible with Lua 5.3, but it brings the API closer to that of Lua 5.3. ]], homepage = "https://github.com/lunarmodules/lua-compat-5.3", license = "MIT" } dependencies = { "lua >= 5.1, < 5.5", --"struct" -- make Roberto's struct module optional } build = { type = "builtin", modules = { ["compat53.init"] = "compat53/init.lua", ["compat53.module"] = "compat53/module.lua", ["compat53.utf8"] = "lutf8lib.c", ["compat53.table"] = "ltablib.c", ["compat53.string"] = "lstrlib.c", ["compat53.io"] = { sources = { "liolib.c" }, } }, platforms = { windows = { modules = { ["compat53.io"] = { defines = { "LUA_USE_WINDOWS" }, } } } } }
Just got a chance to test it (had to create a new windows VM) same error, but I realise its using my luaconf.h
I copied to my include
dir. Should I have a luaconf.h
there? I just copied it directly from the lua source tree when I built lua
"C:\Program Files\LLVM\bin\gcc.exe" -O2 -c -o liolib.o -IC:\Program Files\Lua\5.4\include liolib.c -DLUA_USE_WINDOWS
In file included from liolib.c:10:
In file included from ./lprefix.h:46:
In file included from ./c-api/compat-5.3.h:10:
In file included from C:\Program Files\Lua\5.4\include/lua.h:16:
C:\Program Files\Lua\5.4\include/luaconf.h:51:9: warning: 'LUA_USE_WINDOWS' macro redefined [-Wmacro-redefined]
51 | #define LUA_USE_WINDOWS /* enable goodies for regular Windows */
| ^
<command line>:1:9: note: previous definition is here
1 | #define LUA_USE_WINDOWS 1
| ^
liolib.c:408:13: error: call to undeclared function 'getc_unlocked'; ISO C99 and later do not support implicit function
declarations [-Wimplicit-function-declaration]
408 | rn->c = l_getc(rn->f); /* read next one */
| ^
from lua-compat-5.3.
Should I have a luaconf.h there?
Yes, Lua installations include luaconf.h
(e.g. the Ubuntu package installs /usr/include/lua5.4/luaconf.h
).
C:\Program Files\Lua\5.4\include/luaconf.h:51:9: warning: 'LUA_USE_WINDOWS' macro redefined
Ok, so that means that the Lua headers do attempt to set LUA_USE_WINDOWS
on your system. This means that the rockspec I sent you is not the right way to go, as it was trying to force that explicitly in that rockspec.
The reason why I wanted to try that rockspec is because this error...
"C:\Program Files\LLVM\bin\gcc.exe" -O2 -c -o liolib.o -IC:\Program Files\Lua\5.4\include liolib.c
liolib.c:408:13: error: call to undeclared function 'getc_unlocked'; ISO C99 and later do not support implicit function
declarations [-Wimplicit-function-declaration]
408 | rn->c = l_getc(rn->f); /* read next one */
| ^
liolib.c:86:20: note: expanded from macro 'l_getc'
86 | #define l_getc(f) getc_unlocked(f)
...is happening due to that line 86:
Line 86 in b182b41
...which is inside a LUA_USE_POSIX
block!
Perhaps there's some difference in configuration between the system in your original message and the Windows VM where you tried this rockspec? Does the original rockspec fail the same way as the original message in the Windows VM?
I don't see a way how LUA_USE_WINDOWS
and LUA_USE_POSIX
can be active at the same time...
Thank you for the testing! Let's keep digging this!
from lua-compat-5.3.
Oh wait, looks like compat-5.3 really is doing something wrong here:
Lines 197 to 204 in 737264a
I made this PR to try to fix the issue: #64
Could you test it? You should be able to do that by fetching that branch and then running luarocks make rockspecs/compat53-scm-0.rockspec
. Thank you!!
from lua-compat-5.3.
Compat-5.3 0.13 is released!!
from lua-compat-5.3.
Related Issues (20)
- luaL_Stream
- LUAERRGCM missing HOT 1
- luaL_loadbufferx HOT 1
- Problems with detection of strerror_r HOT 3
- lua_getuservalue should return type HOT 2
- lua_tointegerx accepts non-integers HOT 5
- Build fail with x86_64-w64-mingw32-gcc on MacOS HOT 1
- luaossl installation fails on alpine docker image HOT 8
- src/compat-5.3.c:59:9: error: implicit declaration of function 'strerror_r' [-Werror=implicit-function-declaration]
- src/compat-5.3.c:451:42: error: initializer element is not computable at load time [-Werror=pedantic] HOT 2
- luaL_typeerror HOT 4
- How to compile on windows HOT 4
- Lua 5.4 HOT 11
- Tests fail on 32bit systems HOT 18
- table.maxn HOT 2
- lprefix.h fails with compilation error HOT 1
- release automation HOT 3
- installing compat-5.3.h by luarocks HOT 1
- Unable to install from luarocks on Windows: C4047 issue on liolib.c HOT 3
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 lua-compat-5.3.