-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ feat: luajit replace lua #697
Changes from 18 commits
7535a51
33e874e
c4a6697
707b177
c20070d
27a507c
d2654cd
41a2bcb
cb3de60
e3d612d
5df804f
1bbaa2e
870ab9d
bbc8ae6
2caf97e
5a00567
d4a6ff9
ccfbd4f
4e542c6
61eddc5
eedfada
ba54b75
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
include_guard() | ||
|
||
include(cmake/utils.cmake) | ||
|
||
FetchContent_DeclareGitHubWithMirror(luajit | ||
KvrocksLabs/LuaJIT 803487f8b01c672495a2fcd29dcbed09e4fd6319 | ||
MD5=cd08841342cd933fb7e3d6d4253fbeec | ||
) | ||
|
||
FetchContent_GetProperties(luajit) | ||
if(NOT lua_POPULATED) | ||
FetchContent_Populate(luajit) | ||
|
||
set(LUA_CFLAGS "-DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC= -DLUA_USE_MKSTEMP") | ||
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") | ||
set(LUA_CFLAGS "${LUA_CFLAGS} -isysroot ${CMAKE_OSX_SYSROOT}") | ||
endif() | ||
|
||
set(MACOSX_TARGET "") | ||
if (CMAKE_HOST_APPLE) | ||
set(MACOSX_TARGET "MACOSX_DEPLOYMENT_TARGET=11.0") | ||
endif() | ||
|
||
add_custom_target(make_luajit COMMAND make libluajit.a | ||
"CFLAGS=${LUA_CFLAGS}" | ||
${MACOSX_TARGET} | ||
WORKING_DIRECTORY ${luajit_SOURCE_DIR}/src | ||
BYPRODUCTS ${luajit_SOURCE_DIR}/src/libluajit.a | ||
) | ||
|
||
file(GLOB LUA_PUBLIC_HEADERS "${luajit_SOURCE_DIR}/src/*.hpp" "${luajit_SOURCE_DIR}/src/*.h") | ||
file(COPY ${LUA_PUBLIC_HEADERS} DESTINATION ${luajit_BINARY_DIR}/include) | ||
endif() | ||
|
||
add_library(luajit INTERFACE) | ||
target_include_directories(luajit INTERFACE ${luajit_BINARY_DIR}/include) | ||
target_link_libraries(luajit INTERFACE ${luajit_SOURCE_DIR}/src/libluajit.a dl) | ||
add_dependencies(luajit make_luajit) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -263,9 +263,10 @@ start_server {tags {"scripting"}} { | |
assert(re.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x) | ||
-- so, the final x.x is at the depth limit and was assigned nil | ||
assert(re.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x.x == nil) | ||
return {h, re.x.x.x.x.x.x.x.x.y == re.y, re.y == 5} | ||
assert(h == "82a17881a17882a17881a17882a17881a17882a17881a17882a17881a17882a17881a17882a17881a17882a17881a178c0a17905a17905a17905a17905a17905a17905a17905a17905" or h == "82a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a178c0") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why there are two different values of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had fix this test. The case is from here https://github.com/antirez/lua-cmsgpack/blob/master/test.lua#L393 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I got it. It is due to the element order of a table is unstable. This reminds me of Map in golang. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, It behaves differently in different compilers There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I still have deep doubts about this, because I think we should try to avoid semantics behaving differently under different compilers. |
||
return {re.x.x.x.x.x.x.x.x.y == re.y, re.y == 5} | ||
} 0 | ||
} {82a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a17882a17905a17881a178c0 1 1} | ||
} {1 1} | ||
test {EVAL - Numerical sanity check from bitop} { | ||
r eval {assert(0x7fffffff == 2147483647, "broken hex literals"); | ||
assert(0xffffffff == -1 or 0xffffffff == 2^32-1, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to add
${{ matrix.without_luajit }}
to line 140, otherwise it is uselessThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done d4a6ff9