Skip to content

Commit

Permalink
update bee
Browse files Browse the repository at this point in the history
  • Loading branch information
actboy168 committed Apr 26, 2024
1 parent 9df4532 commit 16b4d0c
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 31 deletions.
2 changes: 1 addition & 1 deletion 3rd/bee.lua
Submodule bee.lua updated 64 files
+0 −4 .clang-format
+0 −1 .gitignore
+1 −1 bee/filewatch/filewatch.h
+1 −2 bee/filewatch/filewatch_linux.cpp
+1 −2 bee/filewatch/filewatch_osx.cpp
+2 −4 bee/filewatch/filewatch_win.cpp
+20 −40 bee/lua/binding.h
+28 −28 bee/lua/file.cpp
+8 −0 bee/lua/file.h
+7 −1 bee/lua/luaref.cpp
+2 −0 bee/lua/luaref.h
+0 −0 bee/lua/module.h
+1 −2 bee/lua/narrow.h
+8 −6 bee/net/bpoll.h
+11 −11 bee/net/bpoll_linux.cpp
+164 −173 bee/net/bpoll_osx.cpp
+16 −16 bee/net/bpoll_win.cpp
+5 −10 bee/net/endpoint.cpp
+2 −4 bee/net/ip.h
+24 −30 bee/net/socket.cpp
+1 −2 bee/nonstd/charconv.h
+1 −2 bee/nonstd/expected.h
+2 −2 bee/subprocess/common.h
+2 −4 bee/subprocess/subprocess_posix.cpp
+5 −10 bee/subprocess/subprocess_win.cpp
+24 −24 bee/sys/file_handle.cpp
+45 −44 bee/sys/file_handle.h
+6 −6 bee/sys/file_handle_bsd.cpp
+36 −36 bee/sys/file_handle_linux.cpp
+26 −26 bee/sys/file_handle_osx.cpp
+33 −33 bee/sys/file_handle_posix.cpp
+88 −88 bee/sys/file_handle_win.cpp
+10 −0 bee/sys/path.h
+50 −0 bee/sys/path_bsd.cpp
+14 −0 bee/sys/path_linux.cpp
+17 −0 bee/sys/path_osx.cpp
+24 −0 bee/sys/path_posix.cpp
+41 −0 bee/sys/path_win.cpp
+3 −6 bee/thread/atomic_sync.cpp
+29 −36 bee/utility/flatmap.h
+0 −172 bee/utility/path_helper.cpp
+0 −11 bee/utility/path_helper.h
+11 −0 bee/utility/path_view.h
+4 −8 bee/win/afd/afd.cpp
+2 −4 bee/win/afd/poller_fd.cpp
+8 −16 bee/win/cwtf8.h
+1 −1 binding/lua_debugging.cpp
+12 −8 binding/lua_epoll.cpp
+134 −159 binding/lua_filesystem.cpp
+13 −4 binding/lua_filewatch.cpp
+1 −1 binding/lua_platform.cpp
+8 −15 binding/lua_select.cpp
+1 −1 binding/lua_serialization.cpp
+4 −7 binding/lua_socket.cpp
+8 −14 binding/lua_subprocess.cpp
+3 −5 binding/lua_thread.cpp
+2 −3 binding/lua_time.cpp
+2 −2 binding/port/lua_windows.cpp
+1 −1 bootstrap/bootstrap_init.cpp
+0 −1 bootstrap/forward_lua.c
+0 −48 bootstrap/forward_lua.lua
+6 −6 bootstrap/main.cpp
+6 −10 compile/common.lua
+22 −8 test/test_epoll.lua
9 changes: 6 additions & 3 deletions compile/common/bee.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local lm = require "luamake"

lm.rootdir = "../../3rd/bee.lua"

lm:lua_source "source_bee" {
lm:lua_src "source_bee" {
sources = "3rd/lua-seri/lua-seri.c",
msvc = {
flags = "/wd4244"
Expand Down Expand Up @@ -41,7 +41,10 @@ local function need(lst)
end

lm:source_set "source_bee" {
includes = ".",
includes = {
".",
"3rd/lua/",
},
sources = "bee/**/*.cpp",
windows = {
sources = need "win"
Expand Down Expand Up @@ -98,7 +101,7 @@ lm:source_set "source_bee" {
}
}

lm:lua_source "source_bee" {
lm:lua_src "source_bee" {
includes = ".",
defines = {
lm.EXE ~= "lua" and "BEE_STATIC",
Expand Down
2 changes: 1 addition & 1 deletion compile/common/launcher.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ lm:source_set "launcher_hook_luajit" {
sources = "src/launcher/hook/luajit_listener.cpp",
}

lm:lua_source 'launcher_source' {
lm:lua_src 'launcher_source' {
deps = {
"frida",
"launcher_hook_luajit",
Expand Down
2 changes: 1 addition & 1 deletion compile/linux/runtime.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ local lm = require "luamake"
require "compile.common.runtime"
require "compile.common.launcher"

lm:lua_library 'launcher' {
lm:lua_dll 'launcher' {
export_luaopen = "off",
deps = {
"launcher_source",
Expand Down
2 changes: 1 addition & 1 deletion compile/macos/runtime.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require "compile.common.config"
require "compile.common.runtime"
require "compile.common.launcher"

lm:lua_library 'launcher' {
lm:lua_dll 'launcher' {
export_luaopen = "off",
deps = {
"launcher_source",
Expand Down
2 changes: 1 addition & 1 deletion compile/windows/runtime.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ local ArchAlias = {
["win32-ia32"] = "x86",
}

lm:lua_library ('launcher.'..ArchAlias[platform]) {
lm:lua_dll ('launcher.'..ArchAlias[platform]) {
bindir = "publish/bin",
export_luaopen = "off",
deps = {
Expand Down
6 changes: 3 additions & 3 deletions src/launcher/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <autoattach/autoattach.h>
#include <bee/nonstd/filesystem.h>
#include <bee/utility/path_helper.h>
#include <bee/sys/path.h>
#include <util/log.h>
#ifndef _WIN32
# include <unistd.h>
Expand Down Expand Up @@ -36,9 +36,9 @@ namespace luadebug::autoattach {

attach_status attach_lua(lua::state L) {
log::info("attach lua vm entry");
auto r = bee::path_helper::dll_path();
auto r = bee::sys::dll_path();
if (!r) {
log::fatal("dll_path error: {}", r.error());
log::fatal("dll_path error");
return attach_status::fatal;
}
auto root = r.value().parent_path().parent_path();
Expand Down
18 changes: 11 additions & 7 deletions src/launcher/util/bee_inline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,23 @@
#include <bee/error.cpp>
#include <bee/net/endpoint.cpp>
#include <bee/net/socket.cpp>
#include <bee/utility/file_handle.cpp>
#include <bee/utility/path_helper.cpp>
#include <bee/sys/file_handle.cpp>

#if defined(_WIN32)
# include <bee/utility/file_handle_win.cpp>
# include <bee/sys/file_handle_win.cpp>
# include <bee/sys/path_win.cpp>
# include <bee/win/wtf8.cpp>
#else
# include <bee/utility/file_handle_posix.cpp>
# include <bee/sys/file_handle_posix.cpp>
# include <bee/sys/path_posix.cpp>
# if defined(__APPLE__)
# include <bee/utility/file_handle_osx.cpp>
# include <bee/sys/file_handle_osx.cpp>
# include <bee/sys/path_osx.cpp>
# elif defined(__linux__)
# include <bee/utility/file_handle_linux.cpp>
# include <bee/sys/file_handle_linux.cpp>
# include <bee/sys/path_linux.cpp>
# elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
# include <bee/utility/file_handle_bsd.cpp>
# include <bee/sys/file_handle_bsd.cpp>
# include <bee/sys/path_bsd.cpp>
# endif
#endif
4 changes: 2 additions & 2 deletions src/launcher/util/log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <bee/nonstd/filesystem.h>
#include <bee/nonstd/format.h>
#include <bee/nonstd/unreachable.h>
#include <bee/utility/path_helper.h>
#include <bee/sys/path.h>
#include <stdio.h>

#include <algorithm>
Expand Down Expand Up @@ -51,7 +51,7 @@ namespace luadebug::log {
}

void notify_frontend(const std::string& msg) {
auto dllpath = bee::path_helper::dll_path();
auto dllpath = bee::sys::dll_path();
if (!dllpath) {
return;
}
Expand Down
18 changes: 11 additions & 7 deletions src/luadebug/luadbg/bee_inline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,31 @@
#include <bee/error.cpp>
#include <bee/net/endpoint.cpp>
#include <bee/net/socket.cpp>
#include <bee/sys/file_handle.cpp>
#include <bee/thread/atomic_sync.cpp>
#include <bee/thread/setname.cpp>
#include <bee/thread/spinlock.cpp>
#include <bee/utility/file_handle.cpp>
#include <bee/utility/path_helper.cpp>

#if defined(_WIN32)
# include <bee/sys/file_handle_win.cpp>
# include <bee/sys/path_win.cpp>
# include <bee/thread/simplethread_win.cpp>
# include <bee/utility/file_handle_win.cpp>
# include <bee/win/unicode.cpp>
# include <bee/win/wtf8.cpp>
#else
# include <bee/subprocess/subprocess_posix.cpp>
# include <bee/sys/file_handle_posix.cpp>
# include <bee/sys/path_posix.cpp>
# include <bee/thread/simplethread_posix.cpp>
# include <bee/utility/file_handle_posix.cpp>
#endif

#if defined(__APPLE__)
# include <bee/utility/file_handle_osx.cpp>
# include <bee/sys/file_handle_osx.cpp>
# include <bee/sys/path_osx.cpp>
#elif defined(__linux__)
# include <bee/utility/file_handle_linux.cpp>
# include <bee/sys/file_handle_linux.cpp>
# include <bee/sys/path_linux.cpp>
#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
# include <bee/utility/file_handle_bsd.cpp>
# include <bee/sys/file_handle_bsd.cpp>
# include <bee/sys/path_bsd.cpp>
#endif
4 changes: 2 additions & 2 deletions src/luadebug/luadbg/bee_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

#include "luadbg/bee_module.h"

#include <binding/file.h>
#include <binding/binding.h>
#include <bee/lua/file.cpp>
#include <bee/lua/module.h>
#include <binding/lua_socket.cpp>
#include <binding/lua_select.cpp>
#include <binding/lua_thread.cpp>
Expand Down
3 changes: 1 addition & 2 deletions src/process_inject/windows/inject.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include <Windows.h>
#include <bee/lua/binding.h>
#include <bee/lua/module.h>
#include <bee/subprocess.h>
#include <bee/utility/zstring_view.h>
#include <bee/win/wtf8.h>
#include <binding/binding.h>

#include <algorithm>
#include <lua.hpp>
Expand Down Expand Up @@ -45,5 +45,4 @@ extern "C" int luaopen_inject(lua_State* L) {
return 1;
}

#include <binding/binding.h>
static ::bee::lua::callfunc _init(::bee::lua::register_module, "inject", luaopen_inject);

0 comments on commit 16b4d0c

Please sign in to comment.