Hi everyone,
I tried x86_64 edge version of Alpine Linux (btw. thanks a lot for this
great distro!) on my home server and went into problems with ACF. I read
instructions on wiki, installed it and run mini_httpd, but in my browser
only this error message appeared:
Error passing the lua library to the lua vm: luascript.lua: bad header
in precompiled chunk
After much struggle I realised, that problem is in haserl package and
more specifically in lua chunk, which is inserted into haserl binary. In
haserl sources, there is a file called haserl_lualib.inc, precompiled
(probably) for x86 architecture, which is inserted into haserl as is,
not recompiled by automake process. Obviously, this could cause problems
on other architectures, such as x86_64.
After little searching I found a solution, looks like maintainer of
haserl knows about this (or similar) issue, because he has included some
hints into source files and Makefile. This is from Makefile:
haserl_lualib.inc : haserl_lualib.lua
@echo '-----------------------------------------------------'
@echo 'Whoops. haserl_lualib.inc is old. You will need'
@echo 'to compile lua2c by hand, or help the maintainer'
@echo 'get automake to do it for you.'
@echo ''
@echo 'For now, to compile lua2c:'
@echo ''
@echo 'gcc -I<luaheaderdir> -Wl,-E -L<lualibdir> -o lua2c
lua2c.c -llua -ldl -lm'
@echo ''
@echo ''
@echo 'Then follow the instructions in lua2c.c to create a'
@echo 'new haserl_lualib.inc'
@echo ''
@echo 'Sorry.'
@echo '-----------------------------------------------------'
@exit 1
So I inserted some lines into haserl APKBUILD:
./configure --prefix=/usr --with-lua || return 1
# inserted lines for recompiling problematic file haserl_lualib.inc
cd src
gcc -I/usr/include -Wl,-E -L/usr/lib -o lua2c lua2c.c -llua -ldl -lm
luac -s -o foo haserl_lualib.lua
./lua2c haserl_lualib foo >haserl_lualib.inc
cd ..
make || return 1
After recompilation and installation of new package, haserl and ACF now
works for me without any problem!
I don't know if anyone else has this issue, but I hope this will help
someone.
Kind regards,
Juraj Šujan
---
Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org
Help: alpine-devel+help@lists.alpinelinux.org
---