All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [WIP 1/2] package/luvi: don't use LUAJIT_VERSION for the luajit installation path
@ 2021-10-31 21:02 Romain Naour
  2021-10-31 21:02 ` [Buildroot] [WIP 2/2] support/testing: test_luvi: switch to armv5 to boot with rng support enabled Romain Naour
  2021-11-07 10:47 ` [Buildroot] [WIP 1/2] package/luvi: don't use LUAJIT_VERSION for the luajit installation path Jörg Krause
  0 siblings, 2 replies; 4+ messages in thread
From: Romain Naour @ 2021-10-31 21:02 UTC (permalink / raw)
  To: buildroot; +Cc: Romain Naour, Jörg Krause

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)
-- 
2.31.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Buildroot] [WIP 2/2] support/testing: test_luvi: switch to armv5 to boot with rng support enabled
  2021-10-31 21:02 [Buildroot] [WIP 1/2] package/luvi: don't use LUAJIT_VERSION for the luajit installation path Romain Naour
@ 2021-10-31 21:02 ` Romain Naour
  2021-11-07 10:47 ` [Buildroot] [WIP 1/2] package/luvi: don't use LUAJIT_VERSION for the luajit installation path Jörg Krause
  1 sibling, 0 replies; 4+ messages in thread
From: Romain Naour @ 2021-10-31 21:02 UTC (permalink / raw)
  To: buildroot; +Cc: Romain Naour, Jörg Krause

Since the commit replacing moonjit by luajit [1] luvi doesn't work without
rng support enabled.

Switch to armv5 to use virtio-rng-pci on the qemu command line [2].

[1] 9450b53c8e06f1b5a75840b82c0f4663a5d75c45
[2] https://git.buildroot.net/buildroot/tree/support/testing/infra/emulator.py?h=2021.08.1

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Jörg Krause <joerg.krause@embedded.rocks>
---
luvi still doesn't work since the luv static linking doesn't seems to
work anymore.
(see https://github.com/luvit/luvi/commit/a9dc8dae2eb69d4a754a0cf5c08622d70f6b7067)

 # luvi -v

[string "return require('init')(...)"]:1: module 'init' not found:

	no field package.preload['init']
	no file './init.lua'
	no file '/usr/share/luajit-2.1.0-beta3/init.lua'
	no file '/usr/local/share/lua/5.1/init.lua'
	no file '/usr/local/share/lua/5.1/init/init.lua'
	no file '/usr/share/lua/5.1/init.lua'
	no file '/usr/share/lua/5.1/init/init.lua'
	no file './init.so'
	no file '/usr/local/lib/lua/5.1/init.so'
	no file '/usr/lib/lua/5.1/init.so'
	no file '/usr/local/lib/lua/5.1/loadall.so'

stack traceback:
	[C]: in function 'require'
	[string "return require('init')(...)"]:1: in main chunk

luvi now try to load init.lua script:
https://github.com/luvit/luvi/blob/v2.12.0/src/main.c#L176

Reverting to moonjit fixes the issue.
---
 support/testing/tests/package/test_luvi.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/support/testing/tests/package/test_luvi.py b/support/testing/tests/package/test_luvi.py
index a85a6f4d27..eb15ad31b5 100644
--- a/support/testing/tests/package/test_luvi.py
+++ b/support/testing/tests/package/test_luvi.py
@@ -17,7 +17,7 @@ class TestLuvi(infra.basetest.BRTest):
 
     def login(self):
         cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
-        self.emulator.boot(arch="armv7",
+        self.emulator.boot(arch="armv5",
                            kernel="builtin",
                            options=["-initrd", cpio_file])
         self.emulator.login()
-- 
2.31.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [WIP 1/2] package/luvi: don't use LUAJIT_VERSION for the luajit installation path
  2021-10-31 21:02 [Buildroot] [WIP 1/2] package/luvi: don't use LUAJIT_VERSION for the luajit installation path Romain Naour
  2021-10-31 21:02 ` [Buildroot] [WIP 2/2] support/testing: test_luvi: switch to armv5 to boot with rng support enabled Romain Naour
@ 2021-11-07 10:47 ` Jörg Krause
  2021-11-07 13:10   ` François Perrad
  1 sibling, 1 reply; 4+ messages in thread
From: Jörg Krause @ 2021-11-07 10:47 UTC (permalink / raw)
  To: Romain Naour, buildroot

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)

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [WIP 1/2] package/luvi: don't use LUAJIT_VERSION for the luajit installation path
  2021-11-07 10:47 ` [Buildroot] [WIP 1/2] package/luvi: don't use LUAJIT_VERSION for the luajit installation path Jörg Krause
@ 2021-11-07 13:10   ` François Perrad
  0 siblings, 0 replies; 4+ messages in thread
From: François Perrad @ 2021-11-07 13:10 UTC (permalink / raw)
  To: buildroot; +Cc: Romain Naour, Jörg Krause


[-- Attachment #1.1: Type: text/plain, Size: 4337 bytes --]

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
>

[-- Attachment #1.2: Type: text/html, Size: 6050 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-07 13:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-31 21:02 [Buildroot] [WIP 1/2] package/luvi: don't use LUAJIT_VERSION for the luajit installation path Romain Naour
2021-10-31 21:02 ` [Buildroot] [WIP 2/2] support/testing: test_luvi: switch to armv5 to boot with rng support enabled Romain Naour
2021-11-07 10:47 ` [Buildroot] [WIP 1/2] package/luvi: don't use LUAJIT_VERSION for the luajit installation path Jörg Krause
2021-11-07 13:10   ` François Perrad

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.