Permalink
Commits on Oct 9, 2017
  1. Prepare 0.9.2 release

    pavouk committed Oct 9, 2017
Commits on Sep 26, 2017
  1. Work around a hang on LuaJIT

    psychon committed Sep 23, 2017
    I do not know why, but using async method on LuaJIT sometimes hangs.
    Work around this by disabling the JIT.
    
    Signed-off-by: Uli Schlachter <psychon@znc.in>
  2. Run tests in a proper DBus session

    psychon committed Sep 23, 2017
    This makes tests/Makefile run the tests under "dbus-run-session" so that
    a DBus user session surely exists. Thus, the code using Gio.TestDBus is
    no longer necessary and can be removed.
    
    If dbus-run-session does not exists, dbus-launch is used instead.
    
    Signed-off-by: Uli Schlachter <psychon@znc.in>
Commits on Sep 23, 2017
  1. .travis.yml: Use xvfb-run with argument "-a"

    psychon committed Sep 23, 2017
    Some builds on Travis failed because the second call to xvfb-run failed
    with "xvfb-run: error: Xvfb failed to start".
    
    According to google, this happens when the display number is already in
    use, for example from a previous call to xvfb-run. Since we recently
    added a second call to xvfb-run to .travis.yml, this seems plausible to
    me.
    
    Fix this by calling xvfb-run with --auto-servernum (aka -a), which means
    that xvfb-run automatically picks a free display.
    
    Signed-off-by: Uli Schlachter <psychon@znc.in>
  2. Work around API break in GLib 2.54

    psychon committed Sep 22, 2017
    Previously, g_object_newv() was annotated with [rename-to g_object_new].
    This annotation was moved to (the new function)
    g_object_new_with_properties(). Since this expects different arguments,
    things break. Work around this by using g_object_newv() directly if it
    exists.
    
    Fixes: #167
    Signed-off-by: Uli Schlachter <psychon@znc.in>
  3. Traivs: Check that lgi works after 'make install'

    psychon committed Aug 29, 2017
    Signed-off-by: Uli Schlachter <psychon@znc.in>
  4. Better error message when Gtk.init_check() fails

    psychon committed Aug 29, 2017
    When loading a namespace, namespace.require() also loads the suitable
    override file. When no override file exists, this should be non-fatal,
    so pcall(require, override_name) is used. However, any other errors
    besides "no such file" should still be fatal. Thus, in this case
    namespace.require() require()s the override file again expecting it to
    fail in the same way again, but this time the error is propagated out.
    
    This behaviour causes problems for Gtk when gtk_init_check() fails.
    Since gtk was already (unsuccessfully) initialized when the override
    file was loaded the first time, the call to gtk_disable_setlocale() that
    is done first results in a warning "gtk_disable_setlocale() must be
    called before gtk_init()" to be printed by Gtk. Also, the actual error
    message will be "assertion failed!", which does not say much. So, it is
    quite natural to hunt after the extraneous call to gtk_init(), which is
    not really the problem here.
    
    To get a better error message and to get rid of the extra call to
    gtk_disable_setlocale(), this commit adds a new convention: When an
    override file returns a string, that's an error message. In this case
    the override file is not loaded a second call and instead
    namespace.require() calls error() with the given error message.
    
    This results in a more obvious error message without any "red herring"
    messages which are misleading. However, one downside is that the
    traceback that is printed now just points at namespace.require() calling
    error(), instead to where the error actually happened. However, since we
    control override files and I expect that this new facility will not be
    used much, it will still be simple to find the source of the error: Just
    grep for the error message.
    
    Fixes: #169
    Signed-off-by: Uli Schlachter <psychon@znc.in>
  5. Make objects unusable in the __gc metamethod

    psychon committed May 3, 2017
    Fixes: #122
    Signed-off-by: Uli Schlachter <uli.schlachter@informatik.uni-oldenburg.de>
Commits on Feb 19, 2017
  1. Respect _is_pointer() for arrays

    pavouk committed Feb 19, 2017
Commits on Feb 12, 2017
  1. Merge pull request #159 from Szunti/patch-1

    pavouk committed Feb 12, 2017
    DBusCallFlags are needed in method calls
Commits on Feb 10, 2017
Commits on Jan 29, 2017
  1. Merge pull request #156 from psychon/callback-issue

    pavouk committed Jan 29, 2017
    Callback issue
Commits on Jan 24, 2017
  1. Fix possible crash when invoking a callback

    psychon committed Jan 24, 2017
    The code for invoking a callback first tries to figure out which
    coroutine to use for this. Here it is possible that a new coroutine is
    created to do this call. Specifically, the code creates a new coroutine
    (lua_newthread()) and then registers this one in the registry to prevent
    it from being garbage collected prematurely.
    
    However, the code was wrong. lua_newthread() produces a new coroutine,
    pushes it onto the stack and returns its lua_State pointer. This new
    lua_State pointer was used to overwrite the variable L here. This means
    that the following line that tried to create a strong reference to the
    coroutine instead called lua_rawseti() on an empty stack. In a debug
    build of Lua (LUA_USE_APICHECK preprocessor symbol defined) this would
    cause a failed assertion. In a normal build "something" happened where
    "something" often ended in a segfault.
    
    Fix this by using the correct Lua state in the argument to
    lua_rawseti().
    
    This commit also adds a regression test for this. The test counts to 100
    in a complicated way involving a callback through lgi. In my
    experiments, the test causes the crash after just two iterations.
    However, earlier versions needed more iterations.  100 iterations only
    take about 0.6 milliseconds here, so should still be fast enough not to
    be about problem, but should still be good enough to detect the problem.
    
    Fixes: #155
    Fixes: #143
    Signed-off-by: Uli Schlachter <psychon@znc.in>
  2. Small refactoring in closure_callback

    psychon committed Jan 24, 2017
    This function had a variable L for some Lua state and almost immediately
    this value was overwritten with a value fetched from some Lua reference.
    This was confusing me and lead me to write a wrong patch.
    
    Refactor the code so that the value of this variable is not overwritten
    right after being set. Hopefully this makes it easier to see where its
    value comes from in the future.
    
    Signed-off-by: Uli Schlachter <psychon@znc.in>
Commits on Jan 14, 2017
  1. Add GooCanvas override and sample

    pavouk committed Jan 14, 2017
    Sample is based on psychon's port of original GooCanvas sample.
    
    #146
  2. Merge pull request #152 from palob/readme-update

    pavouk committed Jan 14, 2017
    Add Lua 5.3 compatibility to README
  3. Merge pull request #153 from psychon/lua5.3

    pavouk committed Jan 14, 2017
    .travis.yml: Fix Lua download link
Commits on Jan 7, 2017
  1. .travis.yml: Fix Lua download link

    psychon committed Jan 7, 2017
    The unofficial GitHub mirror became a bit more official and
    removed/changed releases. Switch to the official Lua site instead.
    
    Signed-off-by: Uli Schlachter <psychon@znc.in>
Commits on Jan 6, 2017
Commits on Nov 20, 2016
  1. Merge pull request #148 from TingPing/tingping/logging

    pavouk committed Nov 20, 2016
    Use structured logging when available
  2. Use 'SYSTEM' instead of 'SESSION' bus

    pavouk committed Nov 20, 2016
    An attempt to make test pass in travis CI.
Commits on Nov 18, 2016
  1. Merge pull request #149 from psychon/travis-pull

    pavouk committed Nov 18, 2016
    Add a .travis.yml file
  2. Add a .travis.yml file

    psychon committed Nov 18, 2016
    This allows automatically building and running tests on Travis for every commit
    and pull request. Travis will build four different configurations which differ
    in the Lua version that is being used: Lua 5.1, 5.2, 5.3 and LuaJIT are tested.
    
    Lua 5.1 and Lua 5.2 are installed from the Ubuntu package repository.
    
    Lua 5.3.3 and latest LuaJIT git are built manually. For Lua 5.3, additional
    asserts are enabled to catch API mis-use (e.g. lua_pop() on an empty stack).
    
    This .travis.yml is loosely based on the same file in awesomeWM's git
    repository.
    
    Signed-off-by: Uli Schlachter <psychon@znc.in>
Commits on Nov 17, 2016
  1. Use structured logging when available

    TingPing committed Nov 17, 2016
    https://developer.gnome.org/glib/stable/glib-Message-Logging.html#id-1.4.12.6.8
    
    This allows writing to the journal and in the future opens up possibilities for
    exposing more information.
  2. Merge pull request #144 from psychon/fix-crash

    pavouk committed Nov 17, 2016
    Fix crash due to Gio.DBusProxy.get_interface_info
Commits on Oct 24, 2016
  1. Work around incorect annotation on Gio.DBusProxy.get_interface_info

    psychon committed Oct 24, 2016
    The return value should be "transfer=none", but since it is not annotated as
    such, it gets "transfer=full". Work around this with a hand-written bindings
    based on core.callable.
    
    This fixes the test added by the previous commit.
    
    Signed-off-by: Uli Schlachter <psychon@znc.in>
  2. Add a test for a double-free in Gio-DBus

    psychon committed Oct 24, 2016
    The docs for g_dbus_proxy_get_interface_info() say "Do not unref the returned
    object, it is owned by proxy". However, this function's return value is not
    correctly annotated as transfer=none. This causes a double-free at runtime,
    because lgi frees a reference that it never owned.
    
    Because we cannot query the reference count, this test does not actually test
    much. If it causes a segfault, then the test failed. This is bad behaviour for a
    test, but seems to be the best that we can do.
    
    This test uses Gio.TestDBus to create a local dbus daemon. This in turn causes
    problems, because it has to make sure everything referencing that dbus daemon is
    finalized before TestDBus is torn down. The implementation is careful to trigger
    a GC cycle where needed to handle this.
    
    Signed-off-by: Uli Schlachter <psychon@znc.in>
  3. Simplify Makefile: Don't query for default LUA_PATH

    psychon committed Oct 24, 2016
    All Lua versions since at least Lua 5.1 replace ";;" in $LUA_PATH and $LUA_CPATH
    with the default value. Use this instead of trying to query the default path so
    that we can prepend something.
    
    If $LUA_PATH is empty, we end up with ";;" in the new value, so the default path
    is added. If $LUA_PATH is not empty, we add our own entry to it.
    
    This also fixes a (theoretical) issue due to missing quoting on the path.
    
    Signed-off-by: Uli Schlachter <psychon@znc.in>
Commits on Sep 1, 2016
  1. Merge pull request #136 from heirecka/master

    pavouk committed Sep 1, 2016
    Don't hard-code the pkg-config executable
Commits on Aug 20, 2016
  1. Merge pull request #141 from supertobi/patch-1

    pavouk committed Aug 20, 2016
    changed play.uri to a new URL that works
Commits on Aug 19, 2016
Commits on May 29, 2016
Commits on May 27, 2016
  1. Prepare 0.9.1 release

    pavouk committed May 27, 2016