aidanholm / luakit

A fork of a fast, small, webkit based browser framework extensible by Lua that uses GTK 3 and WebKit 2.
https://aidanholm.github.io/luakit/
GNU General Public License v3.0
38 stars 8 forks source link

Automated Debian package build process with pbuilder fail in Makefile's apidoc target rule #387

Open groolot opened 7 years ago

groolot commented 7 years ago

Context

I'm trying to make a Debian package from this repository. I've setup a 'debianization' branch in my fork groolot/luakit an started automating creation of Debian package with pbuilder in a chroot.

Issue

When calling pbuilder to build the package, this error outputs:

./luakit --log=error -c build-utils/docgen/process.lua > doc/apidocs/module_info.lua
Unable to init server: Could not connect: Connection refused

(luakit:31746): Gtk-WARNING **: cannot open display: 
Makefile:73: recipe for target 'apidoc' failed

Reason

I think this is due to the gtk_init in luakit.c that try to setup environment within a DISPLAY, that do not exist at all in the pbuilder process.

Propositions

groolot commented 7 years ago

xvfb try...

xvfb-run -a ./luakit --log=error -c build-utils/docgen/process.lua > doc/apidocs/module_info.lua
Makefile:73: recipe for target 'apidoc' failed
make[1]: *** [apidoc] Error 1
make[1]: Leaving directory '/build/luakit-2'
dh_auto_build: make -j4 returned exit code 2
debian/rules:20: recipe for target 'build' failed
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2

It ends with an unknow and silent error. Need to investigate farther in this way to rack the error.

aidanholm commented 7 years ago

Another alternative is to add a command-line flag to Luakit that would prevent opening a display, by telling GTK to render to a buffer instead (if that's possible). This would get rid of Xvfb as a testing dependency too.

groolot commented 7 years ago

Why does the process.lua need to be loaded by luakit?

Is there another way to do the same thing without launching luakit?

aidanholm commented 7 years ago

process.lua is a startup script (like config.rc) that collects information about modes and binds provided by each module. Unfortunately, because Lua is a turing-complete language, the only robust way to determine what binds/modes a script creates is by executing it, and all scripts expect the Lua environment semantics provided by luakit. So there is no good way to do this without launching luakit.

Alternatives:

aidanholm commented 7 years ago

From a brief perusal of GTK docs, it seems unlikely that it supports running without connecting to an X server. So Xvfb looks like it will stay. I'll have a look at this mysterious error.

aidanholm commented 7 years ago

@groolot I don't get that far; I am following https://www.debian.org/doc/manuals/maint-guide/build.en.html, and have the following output:

vagrant@jessie64:/vagrant$ dpkg-buildpackage -us -uc          
dpkg-buildpackage: source package luakit
dpkg-buildpackage: source version 2017.06-1
dpkg-buildpackage: source distribution unstable
dpkg-buildpackage: source changed by Grégory DAVID <groolot@groolot.net>
dpkg-buildpackage: host architecture amd64
 dpkg-source --before-build vagrant
 fakeroot debian/rules clean
dh clean --parallel
   dh_testdir -O--parallel
   dh_auto_clean -O--parallel
make[1]: Entering directory '/vagrant'
rm -rf doc/apidocs doc/html luakit log.o luakit.o luah.o ipc.o web_context.o common/luautil.o common/luah.o common/luaserialize.o common/luaclass.o common/ipc.o common/property.o common/luauniq.o common/util.o common/luaobject.o common/luajs.o common/clib/regex.o common/clib/luakit.o common/clib/ipc.o common/clib/msg.o common/clib/timer.o clib/request.o clib/sqlite3.o clib/unique.o clib/xdg.o clib/luakit.o clib/download.o clib/ipc.o clib/web_module.o clib/soup.o clib/stylesheet.o clib/widget.o widgets/socket.o widgets/label.o widgets/entry.o widgets/webview.o widgets/common.o widgets/notebook.o widgets/box.o widgets/scrolled.o widgets/paned.o widgets/overlay.o widgets/window.o widgets/spinner.o widgets/drawing_area.o widgets/image.o widgets/eventbox.o common/tokenize.o extension/scroll.o extension/script_world.o extension/log.o extension/extension.o extension/ipc.o extension/luajs.o extension/clib/luakit.o extension/clib/ipc.o extension/clib/dom_element.o extension/clib/soup.o extension/clib/dom_document.o extension/clib/page.o common/luautil.o common/luah.o common/luaserialize.o common/luaclass.o common/ipc.o common/property.o common/luauniq.o common/util.o common/luaobject.o common/luajs.o common/clib/regex.o common/clib/luakit.o common/clib/ipc.o common/clib/msg.o common/clib/timer.o common/tokenize.o common/tokenize.c common/tokenize.h buildopts.h luakit.1 luakit.1.gz luakit.so
make[1]: Leaving directory '/vagrant'
   dh_clean -O--parallel
 dpkg-source -b vagrant
dpkg-source: error: can't build with source format '3.0 (quilt)': no upstream tarball found at ../luakit_2017.06.orig.tar.{bz2,gz,lzma,xz}
dpkg-buildpackage: error: dpkg-source -b vagrant gave error exit status 255

The luakit repository is mounted at /vagrant; a source tarball is missing but I'm not sure how that's supposed to be built.

groolot commented 7 years ago

@aidanholm, you have to have the tarball of the original sources in your up dir.

you can ask dh_make --createorig -s -c gpl3 -y to create it for you after renaming your current source directory to luakit-2017.06

And then you should create the package.

groolot commented 7 years ago

Understand that the error is appearing when I try to recompile the Debian Package inside the pbuilder environment that is a fresh chroot env. without any Xorg server.

aidanholm commented 7 years ago

I think I got that working with dh build --createorig -s -c gpl3 -y. Need to update my image to stretch first; looks like I'm stuck with WK 2.6 (!!!) on jessie. That might explain the command difference.

aidanholm commented 7 years ago

Ok, got it working and I'm getting the same error as in your original comment

aidanholm commented 7 years ago

@groolot You probably need to install lua-filesystem. See if cat doc/apidocs/module_info.lua contains an error log about lfs not being found, after adding xvfb-run. Probably need to add lua-filesystem to the build depends.

groolot commented 7 years ago

@aidanholm I already define that.

My control file is as folow:

Source: luakit
Section: web
Priority: optional
Maintainer: Grégory DAVID <groolot@groolot.net>
Build-Depends: debhelper (>= 9), libluajit-5.1-dev, libwebkit2gtk-4.0-dev, lua5.1, libsqlite3-dev, libjavascriptcoregtk-4.0-dev, xvfb, xauth, lua-filesystem, git
Standards-Version: 3.9.8
Homepage: https://aidanholm.github.io/luakit/

Package: luakit
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libjs-jquery, lua-filesystem
Description: fast and small web browser extensible by Lua, WebKit2 based
 Luakit is a highly-configurable browser framework based on WebKit2GTK+.
 It is very fast and extensible by Lua.  It is primarily targeted at power
 users, developers and any people with too much time on their hands who
 want to have fine-grained control over their web browser's behaviour and
 interface.
groolot commented 7 years ago

I do not have much time now, but in the middle of July, I will finish it and upload things to Debian repository (I've gained access to the inner luakit git repo).

aidanholm commented 7 years ago

No worries, take your time, and thanks!