Skip to contentSkip to conversation

libuci: Lua binding needs mmu and version 5.1

PATCH New Yegor Yefremov 3 participants 4 messages Apr 5, 2014 – Apr 6, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libuci: Lua binding needs mmu and version 5.1

The Lua binding option of libuci uses fork() so it needs the MMU.

Finally, libuci fails to build with Lua 5.2 because it uses functions removed from this version. Fix it by activating the option only with Lua 5.1.

---
 package/libuci/libuci.mk | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
package/libuci/libuci.mk +7 -3
index 736b946..42e61ee 100644
@@ -10,10 +10,14 @@ LIBUCI_LICENSE = LGPLv2.1
 LIBUCI_INSTALL_STAGING = YES
 LIBUCI_DEPENDENCIES = libubox
 
-ifeq ($(BR2_PACKAGE_LUA),y)
-	LIBUCI_DEPENDENCIES += lua
+ifeq ($(BR2_USE_MMU),y) # fork()
+ifeq ($(BR2_PACKAGE_LUA_5_1),y)
+LIBUBOX_DEPENDENCIES += lua
+LIBUBOX_CONF_OPT += -DLUAPATH=$(STAGING_DIR)/usr/lib/lua/5.1 \
+	-DLUA_CFLAGS=-I$(STAGING_DIR)/usr/include
 else
-	LIBUCI_CONF_OPT += -DBUILD_LUA:BOOL=OFF
+LIBUBOX_CONF_OPT += -DBUILD_LUA:BOOL=OFF
 endif
+endif # MMU
 
 $(eval $(cmake-package))
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/1 libuci: Lua binding needs mmu and version 5.1

Dear Yegor Yefremov,

Quoted 10 lines · Yegor Yefremov

The Lua binding option of libuci uses fork() so it needs the MMU.

Finally, libuci fails to build with Lua 5.2 because it uses functions removed from this version. Fix it by activating the option only with Lua 5.1.

---
 package/libuci/libuci.mk | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

I've applied your patch... but I'm not really happy because you clearly tested the patch insufficiently:

Quoted 8 lines
package/libuci/libuci.mk +0 -0
index 736b946..42e61ee 100644
@@ -10,10 +10,14 @@ LIBUCI_LICENSE = LGPLv2.1
 LIBUCI_INSTALL_STAGING = YES
 LIBUCI_DEPENDENCIES = libubox
 

package/libuci/libuci.mk LIBUCI_LICENSE = LGPLv2.1 · line 19

Quoted 10 lines
package/libuci/libuci.mk +6 -3
-ifeq ($(BR2_PACKAGE_LUA),y)
-	LIBUCI_DEPENDENCIES += lua
+ifeq ($(BR2_USE_MMU),y) # fork()
+ifeq ($(BR2_PACKAGE_LUA_5_1),y)
+LIBUBOX_DEPENDENCIES += lua
+LIBUBOX_CONF_OPT += -DLUAPATH=$(STAGING_DIR)/usr/lib/lua/5.1 \
+	-DLUA_CFLAGS=-I$(STAGING_DIR)/usr/include
 else
-	LIBUCI_CONF_OPT += -DBUILD_LUA:BOOL=OFF
+LIBUBOX_CONF_OPT += -DBUILD_LUA:BOOL=OFF

LIBUBOX_* variables in libuci.mk ? Surely this cannot work.

I've fixed that and applied, but it'd be nice if patches were minimally tested before being submitted :-)

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 libuci: Lua binding needs mmu and version 5.1

Quoted 38 lines · Thomas Petazzoni

Dear Yegor Yefremov,

Quoted 10 lines · Yegor Yefremov

The Lua binding option of libuci uses fork() so it needs the MMU.

Finally, libuci fails to build with Lua 5.2 because it uses functions removed from this version. Fix it by activating the option only with Lua 5.1.

---
 package/libuci/libuci.mk | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

I've applied your patch... but I'm not really happy because you clearly tested the patch insufficiently:

Quoted 8 lines
package/libuci/libuci.mk +0 -0
index 736b946..42e61ee 100644
@@ -10,10 +10,14 @@ LIBUCI_LICENSE = LGPLv2.1
 LIBUCI_INSTALL_STAGING = YES
 LIBUCI_DEPENDENCIES = libubox
 

package/libuci/libuci.mk LIBUCI_LICENSE = LGPLv2.1 · line 19

Quoted 10 lines
package/libuci/libuci.mk +6 -3
-ifeq ($(BR2_PACKAGE_LUA),y)
-     LIBUCI_DEPENDENCIES += lua
+ifeq ($(BR2_USE_MMU),y) # fork()
+ifeq ($(BR2_PACKAGE_LUA_5_1),y)
+LIBUBOX_DEPENDENCIES += lua
+LIBUBOX_CONF_OPT += -DLUAPATH=$(STAGING_DIR)/usr/lib/lua/5.1 \
+     -DLUA_CFLAGS=-I$(STAGING_DIR)/usr/include
 else
-     LIBUCI_CONF_OPT += -DBUILD_LUA:BOOL=OFF
+LIBUBOX_CONF_OPT += -DBUILD_LUA:BOOL=OFF

LIBUBOX_* variables in libuci.mk ? Surely this cannot work.

Quoted 2 lines

I've fixed that and applied, but it'd be nice if patches were minimally tested before being submitted :-)

OMG! My bad! I know now, why I send patches from work and not from home :-)

I even made a test, but it was a test with Lua enabled, so it didn't produce any error :-(

Yegor

#3 lore raw

PATCH 1/1 libuci: Lua binding needs mmu and version 5.1

In reply to Yegor Yefremov

Hello Yegor,

Quoted 1 line · Yegor Yefremov

The Lua binding option of libuci uses fork() so it needs the MMU.

The Lua binding of libuci doesn't use fork() unlike the libubox one, therefore the patches are not the same. You could simply check in its source directory with:

$ ack -c --cc fork lua/
lua/uci.c:0

or

$ grep -c fork lua/uci.c
0

So it doesn't need the MMU and you can remove:

package/libuci/libuci.mk LIBUCI_LICENSE = LGPLv2.1

Quoted 5 lines
package/libuci/libuci.mk +2 -0
+ifeq ($(BR2_USE_MMU),y) # fork()
 
(...)
 
+endif # MMU

However I agree with the other changes (corrected by Thomas), the Lua binding of libuci suffers from the same dirty CMakeLists.txt than libubox ;-).

Regards,

Hadrien