diff mbox series

[WIP,1/2] package/luvi: don't use LUAJIT_VERSION for the luajit installation path

Message ID 20211031210258.654193-1-romain.naour@gmail.com
State Superseded
Headers show
Series [WIP,1/2] package/luvi: don't use LUAJIT_VERSION for the luajit installation path | expand

Commit Message

Romain Naour Oct. 31, 2021, 9:02 p.m. UTC
Luajit package has been recently updated to the latest commit in the
master branch [1]. Since then LUAJIT_VERSION doesn't contain the luajit
version anymore but a commit hash:

LUAJIT_VERSION = 05f1984e1a862e4b3d3c3b370c773492e2edf84a

Use pkg-config --variable=version luajit in luvi package to set
LUA_PATH correctly.

Fixes:
luajit: unknown luaJIT command or jit.* modules not installed

https://gitlab.com/buildroot.org/buildroot/-/jobs/1710552605

[1] 9450b53c8e06f1b5a75840b82c0f4663a5d75c45

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Jörg Krause <joerg.krause@embedded.rocks>
---
The TestLuvi doesn't work yet due to missing rng support on Qemu armv7 target
used to run the test. luvi -v is stuck due to getrandom().
---
 package/luvi/luvi.mk | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Jörg Krause Nov. 7, 2021, 10:47 a.m. UTC | #1
Hi Romain,

I can confirm that this fixes the following build error:

```
PATH="$BR/output/host/bin:$BR/output/host/sbin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl"  /usr/bin/make -j9  -C $BR/output/build/luvi-2.12.0/
make[1]: Entering directory '$BR/output/build/luvi-2.12.0'
make[2]: Entering directory '$BR/output/build/luvi-2.12.0'
make[3]: Entering directory '$BR/output/build/luvi-2.12.0'
[ 50%] Building Luajitted $BR/output/build/luvi-2.12.0/src/lua/luvibundle.lua: $BR/output/build/luvi-2.12.0/jitted_tmp/src/lua/luvibundle.lua_luvi_generated.o
[ 50%] Building Luajitted $BR/output/build/luvi-2.12.0/src/lua/luvipath.lua: $BR/output/build/luvi-2.12.0/jitted_tmp/src/lua/luvipath.lua_luvi_generated.o
[ 50%] Building Luajitted $BR/output/build/luvi-2.12.0/src/lua/init.lua: $BR/output/build/luvi-2.12.0/jitted_tmp/src/lua/init.lua_luvi_generated.o
luajit: unknown luaJIT command or jit.* modules not installed
luajit: unknown luaJIT command or jit.* modules not installed
make[3]: *** [CMakeFiles/luvi.dir/build.make:78: jitted_tmp/src/lua/luvipath.lua_luvi_generated.o] Error 1
```

The issue is, that LUA_PATH is set to `$BR/output/host/share/luajit-05f1984e1a862e4b3d3c3b370c773492e2edf84a/?.lua`, which is wrong, as the installation path of luajit is `$BR/output/host/share/luajit-2.1.0-beta3/`.

So, the fix proposed by Romain is correct.

Tested-by: Jörg Krause <joerg.krause@embedded.rocks>

Best regards
Jörg Krause

On Sun, 2021-10-31 at 22:02 +0100, Romain Naour wrote:
> Luajit package has been recently updated to the latest commit in the
> master branch [1]. Since then LUAJIT_VERSION doesn't contain the luajit
> version anymore but a commit hash:
> 
> LUAJIT_VERSION = 05f1984e1a862e4b3d3c3b370c773492e2edf84a
> 
> Use pkg-config --variable=version luajit in luvi package to set
> LUA_PATH correctly.
> 
> Fixes:
> luajit: unknown luaJIT command or jit.* modules not installed
> 
> https://gitlab.com/buildroot.org/buildroot/-/jobs/1710552605
> 
> [1] 9450b53c8e06f1b5a75840b82c0f4663a5d75c45
> 
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> Cc: Jörg Krause <joerg.krause@embedded.rocks>
> ---
> The TestLuvi doesn't work yet due to missing rng support on Qemu armv7 target
> used to run the test. luvi -v is stuck due to getrandom().
> ---
>  package/luvi/luvi.mk | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/package/luvi/luvi.mk b/package/luvi/luvi.mk
> index 386daafc31..ef5777cac8 100644
> --- a/package/luvi/luvi.mk
> +++ b/package/luvi/luvi.mk
> @@ -9,7 +9,7 @@ LUVI_SOURCE = luvi-src-v$(LUVI_VERSION).tar.gz
>  LUVI_SITE = https://github.com/luvit/luvi/releases/download/v$(LUVI_VERSION)
>  LUVI_LICENSE = Apache-2.0
>  LUVI_LICENSE_FILES = LICENSE.txt
> -LUVI_DEPENDENCIES = libuv luajit luv host-luajit
> +LUVI_DEPENDENCIES = libuv luajit luv host-luajit host-pkgconf
>  
>  # Dispatch all architectures of LuaJIT
>  ifeq ($(BR2_i386),y)
> @@ -30,12 +30,16 @@ else
>  LUVI_TARGET_ARCH = $(BR2_ARCH)
>  endif
>  
> +# LUAJIT_VERSION and the luajit installation path may not use the
> +# same value. Use the value from luajit.pc file.
> +LUVI_LUAJIT_VERSION = $(shell $(PKG_CONFIG_HOST_BINARY) --variable=version luajit)
> +
>  # Bundled lua bindings have to be linked statically into the luvi executable
>  LUVI_CONF_OPTS = \
>  	-DBUILD_SHARED_LIBS=OFF \
>  	-DWithSharedLibluv=ON \
>  	-DTARGET_ARCH=$(LUVI_TARGET_ARCH) \
> -	-DLUA_PATH=$(HOST_DIR)/share/luajit-$(LUAJIT_VERSION)/?.lua
> +	-DLUA_PATH=$(HOST_DIR)/share/luajit-$(LUVI_LUAJIT_VERSION)/?.lua
>  
>  # Add "rex" module (PCRE via bundled lrexlib)
>  ifeq ($(BR2_PACKAGE_PCRE),y)
Francois Perrad Nov. 7, 2021, 1:10 p.m. UTC | #2
Le dim. 7 nov. 2021 à 11:47, Jörg Krause <joerg.krause@embedded.rocks> a
écrit :

> Hi Romain,
>
> I can confirm that this fixes the following build error:
>
> ```
> PATH="$BR/output/host/bin:$BR/output/host/sbin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl"
> /usr/bin/make -j9  -C $BR/output/build/luvi-2.12.0/
> make[1]: Entering directory '$BR/output/build/luvi-2.12.0'
> make[2]: Entering directory '$BR/output/build/luvi-2.12.0'
> make[3]: Entering directory '$BR/output/build/luvi-2.12.0'
> [ 50%] Building Luajitted
> $BR/output/build/luvi-2.12.0/src/lua/luvibundle.lua:
> $BR/output/build/luvi-2.12.0/jitted_tmp/src/lua/luvibundle.lua_luvi_generated.o
> [ 50%] Building Luajitted
> $BR/output/build/luvi-2.12.0/src/lua/luvipath.lua:
> $BR/output/build/luvi-2.12.0/jitted_tmp/src/lua/luvipath.lua_luvi_generated.o
> [ 50%] Building Luajitted $BR/output/build/luvi-2.12.0/src/lua/init.lua:
> $BR/output/build/luvi-2.12.0/jitted_tmp/src/lua/init.lua_luvi_generated.o
> luajit: unknown luaJIT command or jit.* modules not installed
> luajit: unknown luaJIT command or jit.* modules not installed
> make[3]: *** [CMakeFiles/luvi.dir/build.make:78:
> jitted_tmp/src/lua/luvipath.lua_luvi_generated.o] Error 1
> ```
>
> The issue is, that LUA_PATH is set to
> `$BR/output/host/share/luajit-05f1984e1a862e4b3d3c3b370c773492e2edf84a/?.lua`,
> which is wrong, as the installation path of luajit is
> `$BR/output/host/share/luajit-2.1.0-beta3/`.
>
> So, the fix proposed by Romain is correct.
>
> Tested-by: Jörg Krause <joerg.krause@embedded.rocks>
>
>
I agree.

Acked-by: Francois Perrad <francois.perrad@gadz.org>

François


> Best regards
> Jörg Krause
>
> On Sun, 2021-10-31 at 22:02 +0100, Romain Naour wrote:
> > Luajit package has been recently updated to the latest commit in the
> > master branch [1]. Since then LUAJIT_VERSION doesn't contain the luajit
> > version anymore but a commit hash:
> >
> > LUAJIT_VERSION = 05f1984e1a862e4b3d3c3b370c773492e2edf84a
> >
> > Use pkg-config --variable=version luajit in luvi package to set
> > LUA_PATH correctly.
> >
> > Fixes:
> > luajit: unknown luaJIT command or jit.* modules not installed
> >
> > https://gitlab.com/buildroot.org/buildroot/-/jobs/1710552605
> >
> > [1] 9450b53c8e06f1b5a75840b82c0f4663a5d75c45
> >
> > Signed-off-by: Romain Naour <romain.naour@gmail.com>
> > Cc: Jörg Krause <joerg.krause@embedded.rocks>
> > ---
> > The TestLuvi doesn't work yet due to missing rng support on Qemu armv7
> target
> > used to run the test. luvi -v is stuck due to getrandom().
> > ---
> >  package/luvi/luvi.mk | 8 ++++++--
> >  1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/package/luvi/luvi.mk b/package/luvi/luvi.mk
> > index 386daafc31..ef5777cac8 100644
> > --- a/package/luvi/luvi.mk
> > +++ b/package/luvi/luvi.mk
> > @@ -9,7 +9,7 @@ LUVI_SOURCE = luvi-src-v$(LUVI_VERSION).tar.gz
> >  LUVI_SITE =
> https://github.com/luvit/luvi/releases/download/v$(LUVI_VERSION)
> >  LUVI_LICENSE = Apache-2.0
> >  LUVI_LICENSE_FILES = LICENSE.txt
> > -LUVI_DEPENDENCIES = libuv luajit luv host-luajit
> > +LUVI_DEPENDENCIES = libuv luajit luv host-luajit host-pkgconf
> >
> >  # Dispatch all architectures of LuaJIT
> >  ifeq ($(BR2_i386),y)
> > @@ -30,12 +30,16 @@ else
> >  LUVI_TARGET_ARCH = $(BR2_ARCH)
> >  endif
> >
> > +# LUAJIT_VERSION and the luajit installation path may not use the
> > +# same value. Use the value from luajit.pc file.
> > +LUVI_LUAJIT_VERSION = $(shell $(PKG_CONFIG_HOST_BINARY)
> --variable=version luajit)
> > +
> >  # Bundled lua bindings have to be linked statically into the luvi
> executable
> >  LUVI_CONF_OPTS = \
> >       -DBUILD_SHARED_LIBS=OFF \
> >       -DWithSharedLibluv=ON \
> >       -DTARGET_ARCH=$(LUVI_TARGET_ARCH) \
> > -     -DLUA_PATH=$(HOST_DIR)/share/luajit-$(LUAJIT_VERSION)/?.lua
> > +     -DLUA_PATH=$(HOST_DIR)/share/luajit-$(LUVI_LUAJIT_VERSION)/?.lua
> >
> >  # Add "rex" module (PCRE via bundled lrexlib)
> >  ifeq ($(BR2_PACKAGE_PCRE),y)
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
>
diff mbox series

Patch

diff --git a/package/luvi/luvi.mk b/package/luvi/luvi.mk
index 386daafc31..ef5777cac8 100644
--- a/package/luvi/luvi.mk
+++ b/package/luvi/luvi.mk
@@ -9,7 +9,7 @@  LUVI_SOURCE = luvi-src-v$(LUVI_VERSION).tar.gz
 LUVI_SITE = https://github.com/luvit/luvi/releases/download/v$(LUVI_VERSION)
 LUVI_LICENSE = Apache-2.0
 LUVI_LICENSE_FILES = LICENSE.txt
-LUVI_DEPENDENCIES = libuv luajit luv host-luajit
+LUVI_DEPENDENCIES = libuv luajit luv host-luajit host-pkgconf
 
 # Dispatch all architectures of LuaJIT
 ifeq ($(BR2_i386),y)
@@ -30,12 +30,16 @@  else
 LUVI_TARGET_ARCH = $(BR2_ARCH)
 endif
 
+# LUAJIT_VERSION and the luajit installation path may not use the
+# same value. Use the value from luajit.pc file.
+LUVI_LUAJIT_VERSION = $(shell $(PKG_CONFIG_HOST_BINARY) --variable=version luajit)
+
 # Bundled lua bindings have to be linked statically into the luvi executable
 LUVI_CONF_OPTS = \
 	-DBUILD_SHARED_LIBS=OFF \
 	-DWithSharedLibluv=ON \
 	-DTARGET_ARCH=$(LUVI_TARGET_ARCH) \
-	-DLUA_PATH=$(HOST_DIR)/share/luajit-$(LUAJIT_VERSION)/?.lua
+	-DLUA_PATH=$(HOST_DIR)/share/luajit-$(LUVI_LUAJIT_VERSION)/?.lua
 
 # Add "rex" module (PCRE via bundled lrexlib)
 ifeq ($(BR2_PACKAGE_PCRE),y)