Skip to content

Commit

Permalink
rever to lua54
Browse files Browse the repository at this point in the history
  • Loading branch information
CppCXY committed Oct 20, 2024
1 parent d71dd53 commit 9d556c3
Showing 38 changed files with 12 additions and 20,498 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -19,11 +19,12 @@ jobs:
- { os: ubuntu-20.04, target: x86_64-unknown-linux-gnu, platform: linux-x64, cross: general }
- { os: ubuntu-22.04, target: aarch64-unknown-linux-gnu, platform: linux-arm64, cross: no_format }
- { os: ubuntu-20.04, target: x86_64-unknown-linux-musl, platform: linux-musl, cross: cross }
# - { os: ubuntu-22.04, target: x86_64-unknown-freebsd, platform: linux-bsd, cross: no_format }
- { os: ubuntu-22.04, target: x86_64-unknown-freebsd, platform: linux-bsd, cross: no_format }
- { os: macos-latest, target: x86_64-apple-darwin, platform: darwin-x64, cross: general }
- { os: macos-latest, target: aarch64-apple-darwin, platform: darwin-arm64, cross: general }
- { os: windows-latest, target: x86_64-pc-windows-msvc, platform: win32-x64, cross: general }
- { os: windows-latest, target: i686-pc-windows-msvc, platform: win32-ia32, cross: general }
- { os: windows-latest, target: aarch64-pc-windows-msvc, platform: win32-arm64, cross: general }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ members = [
]

[workspace.dependencies]
mlua = { version = "0.10.0-beta.2", features = [ "luajit52", "vendored", "async"] }
mlua = { version = "0.10.0-beta.2", features = [ "lua54", "vendored", "async"] }
lazy_static = "1.4.0"
encoding_rs = "0.8"
tokio = { version = "1.40.0", features = ["full"] }
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ This is a Rust port of the Lua Language Server. Not all code is implemented in R

# Runtime

The current default runtime is LuaJIT, but JIT is not enabled. Performance is better with `jit.off()`.
The current default runtime is 5.4

# Build Support

@@ -13,15 +13,13 @@ The current default runtime is LuaJIT, but JIT is not enabled. Performance is be
- [x] linux-aarch64 not format
- [x] linux-x64
- [x] linux-musl
- [x] linux-bsd not format. need 'ld' but not find.
- [x] linux-bsd not format.
- [x] darwin-x64
- [x] darwin-arm64

NOTE:
1. The linux-aarch64 and linux-bsd are not format, because there are some build problems.

2. linux-bsd Unable to compile successfully under the virtual machine provided by cross, you can compile it yourself.

# Build

Rust version: 1.81.0
27 changes: 3 additions & 24 deletions crates/basic/build.rs
Original file line number Diff line number Diff line change
@@ -5,13 +5,12 @@ fn main() {
build_lpeglabel();
cfg!(windows).then(|| build_setfilemode());
cfg!(not(feature = "no_format")).then(|| build_emmyluacodestyle());
build_luajit_utf8();
}

fn build_lua_seri() {
cc::Build::new()
.include("3rd/lua-seri")
.include("3rd/LuaJIT/src")
.include("3rd/lua")
.files(
std::fs::read_dir("3rd/lua-seri")
.unwrap()
@@ -31,7 +30,7 @@ fn build_lua_seri() {
fn build_lpeglabel() {
cc::Build::new()
.include("3rd/lpeglabel")
.include("3rd/LuaJIT/src")
.include("3rd/lua")
.files(
std::fs::read_dir("3rd/lpeglabel")
.unwrap()
@@ -75,8 +74,7 @@ fn build_emmyluacodestyle() {
.include("3rd/EmmyLuaCodeStyle/CodeFormatCore/include")
.include("3rd/EmmyLuaCodeStyle/LuaParser/include")
.include("3rd/EmmyLuaCodeStyle/3rd/wildcards/include")
.include("3rd/LuaJIT/src");
builder.define("LUAJIT", "1");
.include("3rd/lua");

let file_patterns = vec![
"3rd/EmmyLuaCodeStyle/CodeFormatLib/src/*.cpp",
@@ -106,22 +104,3 @@ fn build_emmyluacodestyle() {
builder.compile("EmmyLuaCodeStyle");
}

fn build_luajit_utf8() {
cc::Build::new()
.include("3rd/LuaJIT-utf8")
.include("3rd/LuaJIT/src")
.files(
std::fs::read_dir("3rd/LuaJIT-utf8")
.unwrap()
.filter_map(|entry| {
let entry = entry.unwrap();
let path = entry.path();
if path.extension()?.to_str()? == "c" {
Some(path)
} else {
None
}
}),
)
.compile("luajit-utf8");
}
2 changes: 1 addition & 1 deletion crates/basic/src/lib.rs
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ pub fn lua_preload(lua: &Lua) -> LuaResult<()> {
&lua,
vec![
"resources/?.lua;resources/?/init.lua;",
"resources/override_script/?.lua;resources/override_script/?/init.lua;",
// "resources/override_script/?.lua;resources/override_script/?/init.lua;",
"resources/script/?.lua;resources/script/?/init.lua",
],
)?;
3 changes: 1 addition & 2 deletions crates/luals/Cargo.toml
Original file line number Diff line number Diff line change
@@ -16,6 +16,5 @@ tokio.workspace = true
luals-basic = { path = "../basic" , optional = true }

[features]
default = ["luals-basic", "luajit"]
default = ["luals-basic""]
no_format = ["luals-basic/no_format"]
luajit = ["luals-basic/luajit"]
104 changes: 0 additions & 104 deletions resources/luajitCompact.lua

This file was deleted.

5 changes: 2 additions & 3 deletions resources/main.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require "luajitCompact"
local fs = require 'bee.filesystem'
local util = require 'utility'
local version = require 'version'
@@ -55,8 +54,8 @@ METAPATH = METAPATH and util.expandPath(METAPATH) or (ROOT:string() .. '/meta')


---@diagnostic disable-next-line: deprecated
-- debug.setcstacklimit(200)
-- collectgarbage('generational', 10, 50)
debug.setcstacklimit(200)
collectgarbage('generational', 10, 50)
--collectgarbage('incremental', 120, 120, 0)

---@diagnostic disable-next-line: lowercase-global
61 changes: 0 additions & 61 deletions resources/override_script/SDBMHash.lua

This file was deleted.

Loading

0 comments on commit 9d556c3

Please sign in to comment.