Ubuntu

GIR interface is not following the documentation of the constructor

Reported by Nadav on 2012-04-28
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Light Display Manager
High
Unassigned
lightdm (Ubuntu)
High
salomon peralta lopez
Oneiric
High
Unassigned

Bug Description

I try to create greeter in JS and it complain that the constructor of
LightDM.Greeter need args while in the documentation is not.

let greeter = new LightDM.Greeter();

    JS ERROR: !!! Exception was: Error: Unable to construct boxed type
Greeter since it has no zero-args <constructor>, can only wrap an existing
one
    JS ERROR: !!! lineNumber = '0'
    JS ERROR: !!! fileName = '"gjs_throw"'
    JS ERROR: !!! stack = '"("Unable to construct boxed type Greeter
since it has no zero-args <constructor>, can only wrap an existing
one")@gjs_throw:0
@./main.js:7
"'
    JS ERROR: !!! message = '"Unable to construct boxed type Greeter
since it has no zero-args <constructor>, can only wrap an existing one"'
Error: Unable to construct boxed type Greeter since it has no zero-args
<constructor>, can only wrap an existing one

Based on documentation:
http://people.ubuntu.com/~robert-ancell/lightdm/reference/lightdm-gobject-1-Greeter-Interface.html

original post in mailing list:
http://lists.freedesktop.org/archives/lightdm/2012-April/000262.html

Changed in lightdm:
status: New → Triaged
importance: Undecided → High
Robert Ancell (robert-ancell) wrote :

What Javascript engine are you running through? Can you give a step by step way to reproduce this?

Nadav (nadavvin) wrote :

Ubuntu 11.10
gir1.2-lightdm-1
gjs

$ gjs
gjs> const LightDM = imports.gi.LightDM;
typein:1: strict warning: reference to undefined property imports.gi
typein:1: strict warning: reference to undefined property imports.gi.LightDM
gjs> let greeter = new LightDM.Greeter();
typein:2: strict warning: reference to undefined property LightDM.Greeter
Error: Unable to construct boxed type Greeter since it has no zero-args <constructor>, can only wrap an existing one

attached example code

Robert Ancell (robert-ancell) wrote :

Nadav, could you try the version in this PPA:
https://launchpad.net/~lightdm-team/+archive/test

Thanks.

Robert Ancell (robert-ancell) wrote :

This works for me in Ubuntu 12.04, it appears the problem is the GIR bindings are broken and this was fixed in lightdm 1.1.2. The PPA version has this backported.

Nadav (nadavvin) wrote :

It's work on the version in the PPA

Clint Byrum (clint-fewbar) wrote :

Hi! Please add an Impact/Test Case/Regression Potential section to the bug description, per https://wiki.ubuntu.com/StableReleaseUpdates

The upload looks fine, but please add those sections and then the upload can be accepted into oneiric-proposed.

Thanks!

Changed in lightdm (Ubuntu):
status: New → Fix Released
importance: Undecided → High
Changed in lightdm (Ubuntu Oneiric):
status: New → Fix Committed
importance: Undecided → High
Robert Ancell (robert-ancell) wrote :

Impact - GIR bindings do not work in Oneiric
Development Fix - But was fixed in lightdm 1.1.2 by fixing build rules for GIR generation and correcting one GIR annotation. This fix has been backported.
Stable Fix - debian/patches/13_fix_gir_bindings.patch
Test Case - Run the program in comment 2. It should not generate an error.
Regression Potential - Nothing was using the GIR bindings in Oneiric and this bug shows they weren't working. The patch only changes the GIR generation so should not change any other aspect of the program.

Robert Ancell (robert-ancell) wrote :

Hello Nadav, or anyone else affected,

Accepted lightdm into oneiric-proposed. The package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: verification-needed
Jonathan Reed (jdreed) wrote :

lightdm and its gir bindings in oneiric-proposed (1.0.6-0ubuntu1.7) work fine for me, both with the JavaScript test case above, and my project's own LightDM greeter written in Python. Can this please get pushed to production?

tags: removed: verification-needed
tags: added: verification-done
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lightdm - 1.0.6-0ubuntu1.7

---------------
lightdm (1.0.6-0ubuntu1.7) oneiric-proposed; urgency=low

  * debian/patches/13_fix_gir_bindings.patch:
    - Fix GIR bindings (LP: #990490)
 -- Robert Ancell <email address hidden> Tue, 01 May 2012 10:45:07 +1200

Changed in lightdm (Ubuntu Oneiric):
status: Fix Committed → Fix Released
Changed in lightdm (Ubuntu):
assignee: nobody → salomon peralta lopez (peraltasalomon)
Changed in lightdm:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers