Coder Social home page Coder Social logo

luasystem's People

Contributors

alerque avatar asakatida avatar goldenstein64 avatar o-lim avatar tieske avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

luasystem's Issues

test failure: Expected values to be near

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.

fails to install on OS X 10.12 Sierra

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

is this still maintained?

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?

Release failure in CI

@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?

Linker Errors When Compiling LuaSystem on windows

Description

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

Environment

Windows 10
Lua 5.1
LuaRocks 3.9.2 (64-bit)
GCC 13.2 from MSYS/MinGW-64 toolchain
shell: pwsh

Steps to reproduce

Run the following command in the above environment:
luarocks --lua-version=5.1 install luasystem

Full error message

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

Attempts to resolve:

  • Tried using 32-bit luarocks binaries and 32-bit MINGW env
  • The issue appears to be that there are undefined references to C runtime functions '_execute_onexit_table', '_initialize_onexit_table', and '_register_onexit_function'.
  • I have checked the win32 libraries "advapi32", "winmm" are in C:\WINDOWS\system32

Request for help

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.