lunarmodules / luasystem Goto Github PK
View Code? Open in Web Editor NEWPlatform independent system calls for Lua
Home Page: http://lunarmodules.github.io/luasystem/
License: MIT License
Platform independent system calls for Lua
Home Page: http://lunarmodules.github.io/luasystem/
License: MIT License
Hi.
I'm currently packaging luasystem for Debian (as a dependency of busted)
I ran into a test failure:
1 success / 1 failure / 0 errors / 0 pending : 0.500998 seconds
Failure โ spec/time_spec.lua @ 4
Test time functions gettime returns current time
spec/time_spec.lua:5: Expected values to be near.
Passed in:
(number) 1456083442.0007779598
Expected:
(number) 1456083441 +/- 1
This was with Lua5.1 (could not reproduce with 5.2 or 5.3, maybe it was just bad luck!)
Running the tests again work fine. Looks like the two calls to os.time() and system.gettime() were too far from each other.
Would the solution be to increase the limit? This is very arbitrary as on some systems it could take longer to call both functions.
Hey there,
Installing luasystem on OS X 10.12 gives the following:
$ luarocks install luasystem
Installing https://luarocks.org/luasystem-0.2.0-0.src.rock
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -O2 -fPIC -I/usr/local/Cellar/luajit/2.1_1/include/luajit-2.1 -c src/core.c -o src/core.o
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -O2 -fPIC -I/usr/local/Cellar/luajit/2.1_1/include/luajit-2.1 -c src/compat.c -o src/compat.o
env MACOSX_DEPLOYMENT_TARGET=10.8 gcc -O2 -fPIC -I/usr/local/Cellar/luajit/2.1_1/include/luajit-2.1 -c src/time.c -o src/time.o
In file included from src/time.c:14:
src/time_osx.h:20:9: warning: 'CLOCK_REALTIME' macro redefined [-Wmacro-redefined]
#define CLOCK_REALTIME 0
^
/usr/include/time.h:154:9: note: previous definition is here
#define CLOCK_REALTIME _CLOCK_REALTIME
^
In file included from src/time.c:14:
src/time_osx.h:23:9: warning: 'CLOCK_MONOTONIC' macro redefined [-Wmacro-redefined]
#define CLOCK_MONOTONIC 3
^
/usr/include/time.h:156:9: note: previous definition is here
#define CLOCK_MONOTONIC _CLOCK_MONOTONIC
^
In file included from src/time.c:14:
src/time_osx.h:36:12: error: static declaration of 'clock_gettime' follows non-static declaration
static int clock_gettime(int clockid, struct timespec *ts) {
^
/usr/include/time.h:177:5: note: previous declaration is here
int clock_gettime(clockid_t __clock_id, struct timespec *__tp);
^
2 warnings and 1 error generated.
Error: Build error: Failed compiling object src/time.o
This thus prevents the installation of busted
, which depends on luasystem. Some more info:
$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.38)
Target: x86_64-apple-darwin16.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.12
BuildVersion: 16A323
I created a cross-platform lib that does some basics that ANSI-C cannot do, and hence cannot be done with plain Lua, when I ran into this module.
I need some more stuff then what is here, and was thinking I could add it.
Is this still maintained, and/or would you be willing to move the repo to Lunar Modules so I can add to it?
@alerque would you mind having a look at why the release jobs failed?
I tagged v0.3.0
mostly worked, but seems the 0.2.1
version of the rockspec is failing to build. When I locally build that version it works for me?
It doesn't seem to find the source files, could it be that the monkey patching of the urls fails for some reason?
I am trying to install luasystem via luarocks on Windows, and the build is failing with the following error:
Error: Build error: Failed compiling module system/core.dll
Windows 10
Lua 5.1
LuaRocks 3.9.2 (64-bit)
GCC 13.2 from MSYS/MinGW-64 toolchain
shell: pwsh
Run the following command in the above environment:
luarocks --lua-version=5.1 install luasystem
Installing https://luarocks.org/luasystem-0.3.0-1.src.rock
gcc -O2 -c -o src/core.o -IC:\Program Files\lua\5.1\include src/core.c -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -Ic:/windows/system32/include -Ic:/windows/system32/include
gcc -O2 -c -o src/compat.o -IC:\Program Files\lua\5.1\include src/compat.c -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -Ic:/windows/system32/include -Ic:/windows/system32/include
gcc -O2 -c -o src/time.o -IC:\Program Files\lua\5.1\include src/time.c -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -Ic:/windows/system32/include -Ic:/windows/system32/include
gcc -O2 -c -o src/environment.o -IC:\Program Files\lua\5.1\include src/environment.c -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -Ic:/windows/system32/include -Ic:/windows/system32/include
gcc -O2 -c -o src/random.o -IC:\Program Files\lua\5.1\include src/random.c -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -Ic:/windows/system32/include -Ic:/windows/system32/include
gcc -O2 -c -o src/term.o -IC:\Program Files\lua\5.1\include src/term.c -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -Ic:/windows/system32/include -Ic:/windows/system32/include
gcc -shared -o system/core.dll src/core.o src/compat.o src/time.o src/environment.o src/random.o src/term.o -Lc:/windows/system32 -Lc:/windows/system32 -ladvapi32 -lwinmm C:\Program Files\lua\5.1/bin/lua51.dll -lm
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib/dllcrt2.o: in function `_CRT_INIT':
C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtdll.c:130:(.text+0x148): undefined reference to `_execute_onexit_table'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib/dllcrt2.o: in function `pre_c_init':
C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtdll.c:64:(.text+0x8): undefined reference to `_initialize_onexit_table'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib/dllcrt2.o: in function `atexit':
C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtdll.c:207:(.text+0x35b): undefined reference to `_register_onexit_function'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/term.o:term.c:(.text+0x1d): undefined reference to `fileno'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/term.o:term.c:(.text+0x24): undefined reference to `isatty'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../lib/libmingw32.a(lib64_libmingw32_a-pseudo-reloc.o): in function `__report_error':
C:/M/B/src/mingw-w64/mingw-w64-crt/crt/pseudo-reloc.c:150:(.text+0x28): undefined reference to `__acrt_iob_func'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/M/B/src/mingw-w64/mingw-w64-crt/crt/pseudo-reloc.c:151:(.text+0x51): undefined reference to `__acrt_iob_func'
collect2.exe: error: ld returned 1 exit status
Error: Build error: Failed compiling module system/core.dll
My first thought is that this is an issue in my windows environment, but I am not sure about how to proceed. Any advice on how to get this compiled via luarocks on windows?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.