Skip to content

Commit 9eb14c9

Browse files
committed
Fix LuaJIT version mismatch when loading vmdef.lua
1 parent fe56080 commit 9eb14c9

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

test/lua_tests/luajit_version.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
local has_jit, jit = pcall(require, "jit")
2+
if has_jit then
3+
assert(not string.match(jit.version, "ROLLING"))
4+
end
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uid://dhpvwx6666vgh

tools/luajit.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ def CopyLuaJIT(env, target, source):
88
if not os.path.exists(target):
99
shutil.copytree(source, target)
1010
env.Execute(f"make -C {target} clean MACOSX_DEPLOYMENT_TARGET=11.0")
11+
12+
# fixup .git contents so that LuaJIT uses the correct version string
13+
with open(f"{source}/.git", "r") as source_dotgit:
14+
gitdir_key, _, gitdir_value = source_dotgit.read().partition(" ")
15+
abs_gitdir_value = os.path.abspath(os.path.join(source, gitdir_value))
16+
with open(f"{target}/.git", "w") as target_dotgit:
17+
target_dotgit.write(f"{gitdir_key} {abs_gitdir_value}")
1118

1219

1320
def MakeLuaJIT(env, build_dir):

0 commit comments

Comments
 (0)