luarocks / hererocks

Python script for installing Lua/LuaJIT and LuaRocks into a local directory
MIT License
71 stars 12 forks source link

LuaJIT rolling release build: WARNING Cannot determine rolling release version from git log #28

Closed un-def closed 4 months ago

un-def commented 4 months ago
$ python3 hererocks.py -j@v2.1 rolling21 --verbose
Cloning LuaJIT from https://github.com/LuaJIT/LuaJIT @v2.1 (cached)
Running git rev-parse --quiet --verify v2.1
d06beb0480c5d1eb53b3343e78063950275aa281
Running git checkout v2.1
Already on 'v2.1'
Your branch is up to date with 'origin/v2.1'.
Running git symbolic-ref -q HEAD
refs/heads/v2.1
Running git pull --rebase
Already up to date.
Running git rev-parse HEAD
d06beb0480c5d1eb53b3343e78063950275aa281
Building LuaJIT @d06beb0
Running make
==== Building LuaJIT 2.1 ====
make -C src
make[1]: Entering directory '/tmp/tmpv7b77wdp/LuaJIT/src'
VERSION   luajit.h
**** WARNING Cannot determine rolling release version from git log.
**** WARNING The 'git' command must be available during the build.
DYNASM    host/buildvm_arch.h
HOSTCC    host/buildvm.o
HOSTCC    host/buildvm_asm.o
HOSTCC    host/buildvm_peobj.o
HOSTCC    host/buildvm_lib.o
HOSTCC    host/buildvm_fold.o
HOSTLINK  host/buildvm
[...]
BUILDVM   jit/vmdef.lua
DYNLINK   libluajit.so
LINK      luajit
OK        Successfully built LuaJIT
make[1]: Leaving directory '/tmp/tmpv7b77wdp/LuaJIT/src'
==== Successfully built LuaJIT 2.1 ====
Installing LuaJIT @d06beb0
Done.
$ ./rolling21/bin/lua -v
LuaJIT 2.1.ROLLING -- Copyright (C) 2005-2023 Mike Pall. https://luajit.org/

The correct version should look like this:

LuaJIT 2.1.1710088188 -- Copyright (C) 2005-2023 Mike Pall. https://luajit.org/

LuaJIT make recipe needs .git directory to determine the third component (usually called “patch”/“micro”) of the version [1] but we don't copy this directory [2].

[1] https://www.freelists.org/post/luajit/LuaJIT-uses-rolling-releases

Instead of manual increments for each release, the build process uses the (monotonic) POSIX time stamp of the latest commit as the release number of the semantic version. The full version number in the format $major.$minor.$timestamp can be shown with: luajit -v

[2] https://github.com/luarocks/hererocks/blob/4ea0822c30c4ed568d6cb43038224b93aae436f4/hererocks.py#L338

See also: