Giter Site home page Giter Site logo

bee.lua's People

Contributors

actboy168 avatar ast-x64 avatar azure-pipelines[bot] avatar felipelema avatar fesily avatar junjie020 avatar lcheylus avatar mazunki avatar mcepl avatar michaeladler avatar microctar avatar pkubaj avatar shuxiao9058 avatar silent-dxx avatar sumneko avatar xiaobin0860 avatar young40 avatar zhanlangorz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bee.lua's Issues

Fails to build on Fedora 38/Rawhide

I'm trying to build https://github.com/LuaLS/lua-language-server for Fedora. For Fedora 37 it works fine, but on Fedora 38/Rawhide I run into the following errors:

FAILED: build/linux/obj/source_bee/lua_serialization.obj 
gcc -MMD -MT build/linux/obj/source_bee/lua_serialization.obj -MF build/linux/obj/source_bee/lua_serialization.obj.d -std=c++17 -fno-rtti -O2 -Wall -Werror -fvisibility=hidden -I3rd/bee.lua/3rd/lua-seri -I3rd/bee.lua -Itools/lua54 -DBEE_STATIC -DNDEBUG -fPIC -o build/linux/obj/source_bee/lua_serialization.obj -c 3rd/bee.lua/binding/lua_serialization.cpp
3rd/bee.lua/binding/lua_serialization.cpp: In function 'int bee::lua_serialization::lightuserdata(lua_State*)':
3rd/bee.lua/binding/lua_serialization.cpp:34:33: error: 'intptr_t' was not declared in this scope
   34 |             lua_pushinteger(L, (intptr_t)lua_touserdata(L, 1));
      |                                 ^~~~~~~~
3rd/bee.lua/binding/lua_serialization.cpp:5:1: note: 'intptr_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
    4 | #include <lua-seri.h>
  +++ |+#include <cstdint>
    5 | }
[17/31] Compile C++ build/linux/obj/source_bee/lua_socket.obj
[18/31] Compile C++ build/linux/obj/source_bee/lua_filesystem.obj
ninja: build stopped: subcommand failed.
error: Bad exit status from /var/tmp/rpm-tmp.01qIgC (%build)

Looking at the source code, the only place this header is included at is here. The header binding.h doesn't seem to include cstdint either.

I'm guessing this is because Fedora 38 includes a newer version of GCC (https://fedoraproject.org/wiki/Changes/GNUToolchainF38#Summary), and perhaps that version no longer includes this header for you?

some tests are failing

When trying to compile latest: https://github.com/sumneko/lua-language-server bee.lua is failing with:

[58/58] build/linux/bin/bootstrap test/test.lua.obj
FAILED: build/linux/_/test
build/linux/bin/bootstrap test/test.lua
OS:             Linux
Arch:           64
Compiler:       GCC 10.2.0
CRT:            libstdc++ 20200723
DEBUG:          false
.......................................................................................F
Failed tests:
-------------
1) filewatch.test_2
test/test_filewatch.lua:90: expected: nil, actual: <userdata:/build/source/3rd/luamake/3rd/bee.lua/temp/test1>
stack traceback:
        test/test_filewatch.lua:90: in local 'assertHas'
        test/test_filewatch.lua:92: in local 'f'
        test/test_filewatch.lua:46: in upvalue 'test'
        test/test_filewatch.lua:59: in upvalue 'filewatch.test_2'

Ran 88 tests in 0.284 seconds, 87 successes, 1 failures
ninja: build stopped: subcommand failed.
FAILED: build/linux/_/bee
cd 3rd/bee.lua && ninja -f ninja/linux.ninja
ninja: build stopped: subcommand failed.

无法包含头文件

因为你本地文件也用 #include <> 来引入?不应该是 #include "" ?
是否 cl 中还可以用参数来忽略这个差异 ?

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30037\bin\HostX64\x64\cl.exe" -c -nologo -Ox -fp:fast -TP -I3rd\bee.lua\3rd\lua -DBEE_INLINE /I3rd/bee.lua/3rd/lua-seri -Fobuild.objs\bee.dll\windows\x64\release\3rd\bee.lua\3rd\lua-seri\lua-seri.c.obj 3rd\bee.lua\3rd\lua-seri\lua-seri.c
checking for flags (cl_sourceDependencies) ... ok
checking for flags (cl_sourceDependencies) ... ok
error: unicode_win.cpp
3rd\bee.lua\bee\utility\unicode_win.cpp(1): fatal error C1083: 无法打开包括文件: “bee/utility/unicode_win.h”: No such file or directory

Test fails during compilation on WSL

Trying to compile under Ubuntu 20.04 in WSL causes test test_socket.test_unix_echo_2 to crash.

Full output of bootstrap -v:

$ build/linux/bin/bootstrap test/test.lua -v
OS:             Linux
Arch:           64
Compiler:       GCC 9.3.0
CRT:            libstdc++ 20200408
DEBUG:          false
Started on Mon Jun  1 18:16:11 2020
    test_fs.test_absolute ... Ok
    test_fs.test_absolute_relative ... Ok
    test_fs.test_add_remove_permissions ... Ok
    test_fs.test_concat ... Ok
    test_fs.test_copy_file ... Ok
    test_fs.test_create_directories ... Ok
    test_fs.test_create_directory ... Ok
    test_fs.test_current_path ... Ok
    test_fs.test_div ... Ok
    test_fs.test_dll_path ... Ok
    test_fs.test_eq ... Ok
    test_fs.test_equal_extension ... Ok
    test_fs.test_exe_path ... Ok
    test_fs.test_exists ... Ok
    test_fs.test_extension ... Ok
    test_fs.test_filelock_1 ... Ok
    test_fs.test_filelock_2 ... Ok
    test_fs.test_filename ... Ok
    test_fs.test_is_directory ... Ok
    test_fs.test_is_regular_file ... Ok
    test_fs.test_last_write_time ... Ok
    test_fs.test_list_directory ... Ok
    test_fs.test_parent_path ... Ok
    test_fs.test_path ... Ok
    test_fs.test_permissions ... Ok
    test_fs.test_relative ... Ok
    test_fs.test_remove ... Ok
    test_fs.test_remove_all ... Ok
    test_fs.test_remove_filename ... Ok
    test_fs.test_rename ... Ok
    test_fs.test_replace_extension ... Ok
    test_fs.test_setup ... Ok
    test_fs.test_stem ... Ok
    test_fs.test_string ... Ok
    test_fs.test_tostring ... Ok
    test_fw.test_1 ... Ok
    test_fw.test_2 ... Ok
    test_lua.test_next ... Ok
    test_lua.test_stack_overflow_1 ... Ok
    test_lua.test_stack_overflow_2 ... Ok
    test_plat.test_1 ... Ok
    test_seri.test_err_1 ... Ok
    test_seri.test_err_2 ... Ok
    test_seri.test_err_3 ... Ok
    test_seri.test_ok_1 ... Ok
    test_seri.test_ref ... Ok
    test_socket.test_bind ... Ok
    test_socket.test_pair ... Ok
    test_socket.test_tcp_accept ... Ok
    test_socket.test_tcp_connect ... Ok
    test_socket.test_tcp_echo_1 ... Ok
    test_socket.test_tcp_echo_2 ... Ok
    test_socket.test_tcp_echo_3 ... Ok
    test_socket.test_unix_accept ... Ok
    test_socket.test_unix_connect ... Ok
    test_socket.test_unix_echo_1 ... 

I don't see a core dump anywhere but I'm not sure if they're enabled by default in this distro.

Libc6 version is 2.31-0ubuntu9.

Tests fail on FreeBSD with SIGBUS

I've tried to run the tests on FreeBSD but they fail since they are killed by SIGBUS. There seems to be a problem with creating the file watcher from Lua. This is the line which triggers the SIGBUS:

lua::newudata<filewatch::watch>(L, metatable);

I've also added some debug code to the constructor but it seems like the constructor is never executed.

Usually I wouldn't mind about the tests failing but lua-language-server uses bee's filewatcher and is killed by the same SIGBUS, so this issue is actually the root cause.

I don't have a solution for this problem so I'm creating this issue in the hope that someone else has an idea :) Maybe a Lua bug? I tried to update the bundled Lua to 5.4.6 but it still fails.

EDIT: Seems to be related to actboy168/luamake#33

time.time()得到负值

我用的是某个老版本的bee.lua
在vs里编译正常。
用luamake编译linux版本也正常
但是用luamake编译windows版本,time.time()会我返回负值
请问有可能是什么原因呢?

Documentation

Is there any documentation for added methods, how to use and etc?
From tests I have some understanding, but not fully.

macOS 10.14.4 编译不通过

➜  bee.lua git:(master) clang --version
Apple LLVM version 10.0.1 (clang-1001.0.46.3)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

ninja 1.9.0

➜  bee.lua git:(master) ninja -f ninja/macos.ninja
[89/89] build/macos/bin/bootstrap test/test.lua
FAILED: build/macos/_/test
build/macos/bin/bootstrap test/test.lua
build/macos/bin/bootstrap: error loading module 'bee.filesystem' from file 'build/macos/bin/bee.so':
	dlopen(build/macos/bin/bee.so, 6): Symbol not found: __ZNSt3__16__itoa8__u32toaEjPc
  Referenced from: build/macos/bin/bee.so
  Expected in: flat namespace
 in build/macos/bin/bee.so
stack traceback:
	[C]: in ?
	[C]: in function 'require'
	./test/test_platform.lua:49: in main chunk
	[C]: in function 'require'
	test/test.lua:21: in main chunk
	/Users/young40/Work/Lua/bee.lua/build/macos/bin/main.lua:24: in main chunk
	[C]: in ?
ninja: build stopped: subcommand failed.

Please add arm architecture

I was trying to build luamake and when I started building it then some error pops up and shows that my device architecture is not supported
Please add support for arm

lua版本

YD里面用的是lua5.3 这里面用的是lua5.4
到底用哪个版本

[Bug Report] test_filesystem::test_appdata_path() failed when building from Homebrew

Homebrew fakes $HOME with a temporary directory like /private/tmp/lua-language-server-20211002-15688-17zis4f/.brew_home during building. Test filesystem.test_appdata_path won't pass.

Related logs

[54/57] Link    Exe build/macos/bin/luamake
[55/57] Copy 3rd/bee.lua/bootstrap/main.lua build/macos/bin/main.lua
[55/57] build/macos/bin/luamake 3rd/bee.lua/test/test.lua
OS:             macOS
Arch:           x86_64
Compiler:       Clang 10.0.1
CRT:            libc++ 7000
DEBUG:          false
............................................F................................................
Failed tests:
-------------
1) filesystem.test_appdata_path
3rd/bee.lua/test/test_filesystem.lua:38: expected: /private/tmp/lua-language-server-20211002-15688-17zis4f/.brew_home/Library/Caches, actual: /Users/foobar/Library/Caches
stack traceback:
        3rd/bee.lua/test/test_filesystem.lua:38: in upvalue 'assertPathEquals'
        3rd/bee.lua/test/test_filesystem.lua:786: in upvalue 'filesystem.test_appdata_path'

Ran 93 tests in 0.420 seconds, 92 successes, 1 failures
[56/57] Copy build/macos/bin/luamake luamake
FAILED: build/macos/_/test
build/macos/bin/luamake 3rd/bee.lua/test/test.lua
ninja: build stopped: subcommand failed.

I changed the test function name to skip running it as a test to make the build success.

https://github.com/laggardkernel/homebrew-tap/blob/e4af1e17708b858cae9eb7223e4ca3a8cf0c00c3/Formula/lua-language-server.rb#L37-L41

Should we improve the test in bee.lua to support Homebrew? Or just leave the problem let it be fixed by the homebrew formula packager (the 'solution' what I'm using)? Not sure if it should be considered a bug of bee.lua.

MacOS filesystem test (filesystem.test_appdata_path) fails on MacPorts

Test error during build. At compile time, I set the HOME variable to the following path:

/opt/local/var/macports/build/.../lua-language-server/work/.home

I also tried to create a Library/Caches directory inside HOME, but it was also unsuccessful.

If I try to manually compile luamake, I get the following error:

$ sudo -u macports HOME="/opt/local/var/macports/sources/.../work/lua-language-server-2.4.2/.home" ninja -C 3rd/luamake -f compile/ninja/macos.ninja

ninja: Entering directory `3rd/luamake'
[0/1] build/macos/bin/luamake 3rd/bee.lua/test/test.lua
OS:       	macOS
Arch:     	x86_64
Compiler: 	Clang 13.0.0
CRT:      	libc++ 12000
DEBUG:    	false
............................................F................................................
Failed tests:
-------------
1) filesystem.test_appdata_path
3rd/bee.lua/test/test_filesystem.lua:38: expected: /opt/local/var/macports/sources/github.com/judaew/macports-ports/lua/lua-language-server/work/lua-language-server-2.4.2/.home/Library/Caches, actual: /opt/local/var/macports/home/Library/Caches
stack traceback:
	3rd/bee.lua/test/test_filesystem.lua:38: in upvalue 'assertPathEquals'
	3rd/bee.lua/test/test_filesystem.lua:786: in upvalue 'filesystem.test_appdata_path'

Ran 93 tests in 0.414 seconds, 92 successes, 1 failures
FAILED: build/macos/_/test 
build/macos/bin/luamake 3rd/bee.lua/test/test.lua
ninja: build stopped: subcommand failed.

function test_fs:test_appdata_path()
if platform.OS == 'Windows' then
assertPathEquals(fs.appdata_path(), os.getenv "LOCALAPPDATA")
elseif platform.OS == 'Linux' then
assertPathEquals(fs.appdata_path(), os.getenv "XDG_DATA_HOME" or (os.getenv "HOME" .. "/.local/share"))
elseif platform.OS == 'macOS' then
assertPathEquals(fs.appdata_path(), os.getenv "HOME" .. "/Library/Caches")
end
end

Android support?

Can this be built on android or with NDK toolchain?

It is detected as a platform that's why I was wondering if it was supported or not :D

#elif defined(__ANDROID__)

I was trying to build this on termux

It mostly compiles but I get this error at the end

[57/59] build/linux/bin/bootstrap 3rd/bee.lua/test/test.lua 
     build/linux/bin/bootstrap: error loading module 'bee.platform' from file 'build/linux/bin/bee.so':
           dlopen failed: cannot locate symbol "_ZNKSt6__ndk14__fs10filesystem4path6__stemEv" referenced by "/data/data/com.termux/files/home/.cache/lsp/sumneko-lua/3rd/luamake/build/linux/bin/bee.so"...
           stack traceback:
           [C]: in ?
           [C]: in function 'require'  
           3rd/bee.lua/test/test.lua:19: in main chunk
           ...che/lsp/sumneko-lua/3rd/luamake/build/linux/bin/main.lua:24: in main chunk
           [C]: in ?
[58/59] Copy build/linux/bin/bee.so bee.so

Any idea what this might be ?

Also:

bee.lua/bee/platform.h

Lines 59 to 62 in 3c6764a

#if defined(__BIONIC__)
# define BEE_CRT_NAME "bionic"
# define BEE_CRT_NAME "bionic"
#elif defined(_MSC_VER)

2nd one is probably a typo and should be BEE_CRT_VERSION ?

MacOS filesystem test fails on Linux

It looks like this test should only run on macOS, but it's causing failures for me on Ubuntu Linux 18.04. Deleting these lines fixed the build for me.

if platform.OS ~= "macOS" then
--TODO
lu.assertEquals(fs.path('temp2.txt'):permissions() & USER_WRITE, 0)
end

Info from the end of my build:
OS: Linux
Arch: x86_64
Compiler: GCC 7.5.0
CRT: libstdc++ 20191114 glibc 2.27
DEBUG: false

Statically linking libstdc++ causes lua-language-server to fail at build

OS: Fedora 34

Running compile/install.sh gives the following error. (Instructions)

[57/59] Link    Dll build/linux/bin/bee.so
FAILED: build/linux/bin/bee.so 
gcc --shared build/linux/obj/bee/lua-seri.obj build/linux/obj/bee/error.obj build/linux/obj/bee/fsevent_linux.obj build/linux/obj/bee/endpoint.obj build/linux/obj/bee/socket.obj build/linux/obj/bee/format.obj build/linux/obj/bee/os.obj build/linux/obj/bee/subprocess_posix.obj build/linux/obj/bee/file_helper.obj build/linux/obj/bee/path_helper.obj build/linux/obj/bee/lua_embed.obj build/linux/obj/bee/lua_filesystem.obj build/linux/obj/bee/lua_filewatch.obj build/linux/obj/bee/lua_platform.obj build/linux/obj/bee/lua_serialization.obj build/linux/obj/bee/lua_socket.obj build/linux/obj/bee/lua_subprocess.obj build/linux/obj/bee/lua_thread.obj build/linux/obj/bee/lua_time.obj -o build/linux/bin/bee.so -lpthread -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -static-libgcc -s
/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Was made aware this could be the issue?

crt = "static",

or is this something that should be handled in lua-language-server repo for instructions to be updated to require libstdc++-static as a dependency?

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.