actboy168 / bee.lua Goto Github PK
View Code? Open in Web Editor NEWLua runtime and toolset
License: MIT License
Lua runtime and toolset
License: MIT License
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?
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.
使用的是 luamake -EXE lua
命令
因为你本地文件也用 #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
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
.
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:
bee.lua/binding/lua_filewatch.cpp
Line 132 in a73df87
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
Related to LuaLS/lua-language-server#160,
Line 147 in 590917d
linux.ninja
allows the build to succeed.I just want to use bee.filesystem
, etc. with native lua. How would I do that?
subprocess必须先关闭stdin后才能从stdout读取数据吗。
可不可以交叉进行。
我用的是某个老版本的bee.lua
在vs里编译正常。
用luamake编译linux版本也正常
但是用luamake编译windows版本,time.time()会我返回负值
请问有可能是什么原因呢?
Is there any documentation for added methods, how to use and etc?
From tests I have some understanding, but not fully.
➜ 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.
如题,如果说加入了一些重复的路径filewatch内部有判断吗
Hi,
Can we improve the C++ backward compatibility of this project?
是否能考虑兼容较低版本的C++, 比如C++ 11
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
YD里面用的是lua5.3 这里面用的是lua5.4
到底用哪个版本
is it possible regarding Lua 5.1/Jit ?
Thank you for the great utility
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.
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.
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.
bee.lua/test/test_filesystem.lua
Lines 780 to 788 in e2a8a4f
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
Line 14 in 3c6764a
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:
Lines 59 to 62 in 3c6764a
BEE_CRT_VERSION
?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.
bee.lua/test/test_filesystem.lua
Lines 571 to 574 in 5819270
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
auto dll_path(void* module_handle) -> nonstd::expected<fs::path, std::exception>
这个函数没有实现,编译的时候会出LINK200错误。
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?
Line 33 in 240982c
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?
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.