Skip to content

Commit 9d556c3

Browse files
committed
rever to lua54
1 parent d71dd53 commit 9d556c3

38 files changed

+12
-20498
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ jobs:
1919
- { os: ubuntu-20.04, target: x86_64-unknown-linux-gnu, platform: linux-x64, cross: general }
2020
- { os: ubuntu-22.04, target: aarch64-unknown-linux-gnu, platform: linux-arm64, cross: no_format }
2121
- { os: ubuntu-20.04, target: x86_64-unknown-linux-musl, platform: linux-musl, cross: cross }
22-
# - { os: ubuntu-22.04, target: x86_64-unknown-freebsd, platform: linux-bsd, cross: no_format }
22+
- { os: ubuntu-22.04, target: x86_64-unknown-freebsd, platform: linux-bsd, cross: no_format }
2323
- { os: macos-latest, target: x86_64-apple-darwin, platform: darwin-x64, cross: general }
2424
- { os: macos-latest, target: aarch64-apple-darwin, platform: darwin-arm64, cross: general }
2525
- { os: windows-latest, target: x86_64-pc-windows-msvc, platform: win32-x64, cross: general }
2626
- { os: windows-latest, target: i686-pc-windows-msvc, platform: win32-ia32, cross: general }
27+
- { os: windows-latest, target: aarch64-pc-windows-msvc, platform: win32-arm64, cross: general }
2728
runs-on: ${{ matrix.os }}
2829
steps:
2930
- uses: actions/checkout@v4

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ members = [
55
]
66

77
[workspace.dependencies]
8-
mlua = { version = "0.10.0-beta.2", features = [ "luajit52", "vendored", "async"] }
8+
mlua = { version = "0.10.0-beta.2", features = [ "lua54", "vendored", "async"] }
99
lazy_static = "1.4.0"
1010
encoding_rs = "0.8"
1111
tokio = { version = "1.40.0", features = ["full"] }

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is a Rust port of the Lua Language Server. Not all code is implemented in R
44

55
# Runtime
66

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

99
# Build Support
1010

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

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

23-
2. linux-bsd Unable to compile successfully under the virtual machine provided by cross, you can compile it yourself.
24-
2523
# Build
2624

2725
Rust version: 1.81.0

crates/basic/build.rs

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ fn main() {
55
build_lpeglabel();
66
cfg!(windows).then(|| build_setfilemode());
77
cfg!(not(feature = "no_format")).then(|| build_emmyluacodestyle());
8-
build_luajit_utf8();
98
}
109

1110
fn build_lua_seri() {
1211
cc::Build::new()
1312
.include("3rd/lua-seri")
14-
.include("3rd/LuaJIT/src")
13+
.include("3rd/lua")
1514
.files(
1615
std::fs::read_dir("3rd/lua-seri")
1716
.unwrap()
@@ -31,7 +30,7 @@ fn build_lua_seri() {
3130
fn build_lpeglabel() {
3231
cc::Build::new()
3332
.include("3rd/lpeglabel")
34-
.include("3rd/LuaJIT/src")
33+
.include("3rd/lua")
3534
.files(
3635
std::fs::read_dir("3rd/lpeglabel")
3736
.unwrap()
@@ -75,8 +74,7 @@ fn build_emmyluacodestyle() {
7574
.include("3rd/EmmyLuaCodeStyle/CodeFormatCore/include")
7675
.include("3rd/EmmyLuaCodeStyle/LuaParser/include")
7776
.include("3rd/EmmyLuaCodeStyle/3rd/wildcards/include")
78-
.include("3rd/LuaJIT/src");
79-
builder.define("LUAJIT", "1");
77+
.include("3rd/lua");
8078

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

109-
fn build_luajit_utf8() {
110-
cc::Build::new()
111-
.include("3rd/LuaJIT-utf8")
112-
.include("3rd/LuaJIT/src")
113-
.files(
114-
std::fs::read_dir("3rd/LuaJIT-utf8")
115-
.unwrap()
116-
.filter_map(|entry| {
117-
let entry = entry.unwrap();
118-
let path = entry.path();
119-
if path.extension()?.to_str()? == "c" {
120-
Some(path)
121-
} else {
122-
None
123-
}
124-
}),
125-
)
126-
.compile("luajit-utf8");
127-
}

crates/basic/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub fn lua_preload(lua: &Lua) -> LuaResult<()> {
2727
&lua,
2828
vec![
2929
"resources/?.lua;resources/?/init.lua;",
30-
"resources/override_script/?.lua;resources/override_script/?/init.lua;",
30+
// "resources/override_script/?.lua;resources/override_script/?/init.lua;",
3131
"resources/script/?.lua;resources/script/?/init.lua",
3232
],
3333
)?;

crates/luals/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@ tokio.workspace = true
1616
luals-basic = { path = "../basic" , optional = true }
1717

1818
[features]
19-
default = ["luals-basic", "luajit"]
19+
default = ["luals-basic""]
2020
no_format = ["luals-basic/no_format"]
21-
luajit = ["luals-basic/luajit"]

resources/luajitCompact.lua

Lines changed: 0 additions & 104 deletions
This file was deleted.

resources/main.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
require "luajitCompact"
21
local fs = require 'bee.filesystem'
32
local util = require 'utility'
43
local version = require 'version'
@@ -55,8 +54,8 @@ METAPATH = METAPATH and util.expandPath(METAPATH) or (ROOT:string() .. '/meta')
5554

5655

5756
---@diagnostic disable-next-line: deprecated
58-
-- debug.setcstacklimit(200)
59-
-- collectgarbage('generational', 10, 50)
57+
debug.setcstacklimit(200)
58+
collectgarbage('generational', 10, 50)
6059
--collectgarbage('incremental', 120, 120, 0)
6160

6261
---@diagnostic disable-next-line: lowercase-global

resources/override_script/SDBMHash.lua

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)