2013-08-27

[Technology] "Error: Unsupported type void, deriving from fundamental void"

I have an issue trying to use GHashTable as a property in an introspected GObject from Javascript (using gjs).  I was trying to create a test case, but I encountered this when trying to construct my object from gjs:



"Error: Unsupported type void, deriving from fundamental void"



The object was dead-simple, and derived from GObject, so I wasn't sure what the problem was.  Ultimately, it turned out that that was gjs's way of telling me it didn't have a definition for my constructor.  Yikes.  Ultimately, I had to specify a 'shared-library' attribute for the 'namespace' element in the .gir and .typelib files that gjs was using for introspection.  I wasted a couple hours trying to figure that out.  Whee.



For now, I filed a bug, 706906, requesting a useful error message when definitions aren't found, rather than ambiguously complaining about void types.


Writing the Object and test file


First I created a quick object using Vala for my test case.

namespace Foo {
public class Bar : GLib.Object {
public GLib.HashTable hashtable { get; set; }
public Bar () {
this.hashtable = new GLib.HashTable (GLib.str_hash, GLib.str_equal);
}
}
}

Well, that was quick.  Next I wrote a small .js file

#!/usr/bin/gjs
const Foo = imports.gi.Foo;
var bar = new Foo.Bar ();


Compiling the Vala object and introspection files


Of ourse, first you'll need to compile your shared library, Foo.

valac --library=foo --gir=Foo-0.1.gir --vapi foo.vapi -H foo.h -g Foo.vala -X -fPIC -X -shared -o libfoo.so

If you try to run test.js now, it won't find the library and will report the error:



"Requiring Foo, version none: Typelib file for namespace 'Foo' (any version) not found"



To access Foo via introspection, we'll of course need to compile the .typelib too!

g-ir-compiler --shared-library=libfoo.so Foo-0.1.gir --output Foo-0.1.typelib



If you don't specify the name of the shared-library, that's when you'll see the earlier error, "Error: Unsupported type void, deriving from fundamental void" when trying to actually use the objects from gjs, as they're defined, they're only declared through their typelib



If you still see the Typelib file not found, it might not be in your GI_TYPELIB_PATH, so you might want to set that.  Lots of typelibs get installed to /usr/lib64/girepository-1.0/.  For my test case, I set GI_TYPELIB_PATH=. since my typelib is in the current directory.


GHashTable properties: the original problem


Now all I need to do is find a solution to my original problem, "Error: Unable to introspect element-type of container in GValue", where I can't access a GHashTable as a property. :\  (Now bug 706907)

2013-08-15

[GNOME] Providing feedback on patches and branches

awesome advert:

Did you know that GXml has a mailing list now?  gxml-list at gnome dot org!

  

Finding time to review

 

A week before GUADEC, the spectacular Daniel Espinosa let me know of work he's doing on GXml serialization in a new branch.  Sadly, it's taken me three weeks to provide adequate feedback.



There were three obstacles to this. 


  1. having my HP tc4400 laptop (her name was clarity, after Claire Danes) die shortly thereafter.  

  2. going to GUADEC (there was a lot of new work to do while there!)

  3. my thesis (sadly, I don't have my summer totally free)

  4. other GSOC goals


I feel like such a long delay, even if the causes seem reasonable, is terrible for encouraging good contribution's like Daniel.  I'm lucky Daniel is currently  motivated and has goals.



Doing the review



Because the new work is on a branch, and the changes are a bit extensive, it was a bit challenging keeping track of all the changes.  That's opposed to a set of smaller patches or contained changes, which I might be able to analyse in parts.  Because of cross-file changes and some code-reorganisation, I ended up using emacs ediff and some hand-editing to ease my comparison.  Sometimes changes look bigger on the outside, until you realise that fundamentally a lot of the new logic is the same.



I finally ended up spending about 5 hours reviewing it, which feels a little excessive, and I hope I get better at it.  As a graduate teaching assistant at my university, I'm used to reviewing students' code (which is more predictable and less complex).  I think one problem is that I didn't want to miss anything; I feel as though a quicker and sloppier review might actually be preferable for its quicker return time, than having a thorough and careful one that takes forever to find the time to start.



Providing feedback



One of the hardest parts is providing meaningful and friendly resistance to changes.  I want to make sure that changes are safe (smaller and more precise ones are preferable to minimise new bugs) and necessary (changing APIs without a clear benefit is painful for existing developers), but I don't want to overly discourage a submitter.



I tried to ask specific questions about the motivations behind certain changes, and tried to propose smaller changes that could accomplish the same purpose.



Hopefully I will prove more responsive in the future and Daniel's work will improve GXml's serialization support. :D



Advice from you



I'd appreciate any advice you have for reviewing code and encouraging submitters.  I heard that cursing at contributors works well for some well-known maintainers, but I don't think GXml is quite popular enough to afford that level of abuse. :)

2013-08-06

[GNOME] GUADEC 2013: Talking Heads

I survived my trip through Toronto, Amsterdam, and Prague to Brno.
I'm becoming pretty good at flowing through foreign countries without
saying a word. I'd like to thank the GNOME Foundation for making this possible:





The four days of talks have ended, and it's been honestly amazing.  Here are my thoughts on the ones I attended and liked.  (Let me know if you find any errors.)



The AGM



The annual general meeting was informative and entertaining, as usual.
It's nice to know we can have fun while getting serious business done.
Some neat things I learnt is that there's a pre-built image for
virtual machines with a complete jhbuild available to download. Also,
there's now HowDoI on the GNOME Wiki. For localisation, 52 languages
have over 80%. Outreach has helped increase participation of women in
the GNOME project. We also got to hear about GNOME Asia and GNOME
India. From the foundation report, the privacy campaign was a good
success. Noted was that this September will be the 30th anniversary
of the GNU Project!




Keynotes






Ethan Lee on gaming in Linux



Ethan works on porting popular indie games to Linux. It's great seeing
more games available on Linux through the Humble Indie Bundle and
Steam for Linux. Game availability is one of the few remaining
barriers, so it was nice to hear from someone working with games on
Linux about challenges there and what we can do to help facilitate it.




Endless Mobile



Endless Mobile wants to get a smartphone and eventually a computer to
most of the world. They're targetting the market segment of people
who can afford to live in their area but can't really afford a
computer, because while many items are priced locally, electronics are
largely priced globally, and a typical device can exceed a potential
customer's annual earnings.


So, simple devices, near Raspberry Pi price levels and capability,
with intelligent, great design built atop free software. The
hardware has a stylised appearance, and a core part of their value is
their app collection, which is embodied not of fun entertainment, but
a lot of practical software, which can help with cooking, farming,
business, education, etc.




ZaReason



ZaReason, proprietor of Linux laptops and desktops, came to discuss
their goals (provide great, open computers that work well), their
challenges (hardware that restricts freedom), and encourage GNOME to
continue to promote a Free ecosystem. They had some of their
hardware, and I was thrilled by its light weight.





Talks






Colin Walters on GNOME OSTree



GNOME OSTree is being actively used for continuous integration, on a
32-core, 48GBRAM machine. It's working great for testing patches and
git commits as they happen, resulting in quick detection of errors,
and helping improve the overall stability of the stack it tests. It
focuses mostly on the OS and not so much on apps, though it does have
a concept of profiles (sets of packages) with some including apps, for
development and testing purposes. Could help provide atomic updates
and easy rollback, and help decouple the OS from apps.




Fabiana Simões on how not to report User Experience bugs



Fabiana helped emphasise that UX (User Experience) bugs are important,
even if they don't prevent software from compiling and running.
Evaluating user experience issues can be challenging, and encouraging
good UX bug reporting is helpful. Highlights include not to use the
following useless phrases:



  • "I think X should be Y"

  • "It sucks/it's not user friendly/intuitive"

  • "Most users …" without doing actual research


There were also some recommendations on information users should
provide regarding a user experience bug, including what they were
doing, why they were doing it, what steps they took, what were they
expecting, and what happened. What the user felt, saw, and did are
important.




Meg Ford on GNOME in Open Source communities



I didn't catch this entire talk, but was interested in Meg's points
regarding inclusiveness and exclusive attitudes. It's sad to hear
about issues regarding overt discrimination and sexism. I enjoyed the
activity surrounding small local groups like in Chicago.




Lennart Poettering on Sandboxed Applications for GNOME



This was a delicious talk, touching quite a bit on systemd and the
future of applications in GNOME. Basically, isolation for stability
and security, with support in the kernel and through cgroups to help
control apps. Single files bundling apps from the user's point of
view, actually a compressed multiarch loopback filesystem, optioning
containing their own versions of libraries to avoid library version
dependencies in the OS. App distribution through community stores,
not a single canonical source. Unprivileged installation. kdbus for
controlled IPC of even large data between apps and the system or even
other apps, and Portals, intents-like method of providing interactive
security around this. The need for a stricter hierarchy file system
spec and reduce some distribution differences.


I'm really excited about how this will change my interactions with my
computer.




Juan Pablo Ugarte on building UIs in Glade



Juan gave a pretty presentation showing recent work for CCS support in
Glade, with pretty things like gradients, shadows, animations, etc. A
demo of a Baccarat game helped demonstrate just how completely you can
style your windows and widgets. To my great delight, he then revealed
that the presentation was actually built using Glade itself! And was
being run by the new Glade Previewer. (Disclaimer: Glade is not
intended to efficiently build beautiful presentations, though it can.)




Lightning Talks



Some non-comprehensive highlights were that EasyTag, the audio tagger,
has seen some recent activity again. Boxes has had work on copy-paste
between host and guest and usb redirection. The gettext maintainer,
Daiki Ueno, came, and it's seem some exciting new features like
support for GtkBuilder, Vala, Lua, and Javascript, as well as
multiline strings. Work for systemd in the user session advances the
cause of the faster login. Also, the Cantarell font has seem some
refinement. There was a lot more.




Philip Withnall on testing web services



Philip helped address problems with testing against web services, with
the unpredictable nature of dealing with a remote host. The solution
appears to be recording a trace of normal activity for your operation,
and then testing against that rather than the remote server itself.




ownCloud



The future of open source cloud services is growing rapidly and the
cool keeps flowing. Syncing of files, calendars, and contents.
Integration with GNOME Online Accounts. To come is integration with
Documents, Notes, tentatively RSS, Maps, Music, mail, bookmarks, and
more. Syncing should be comprehensive enough to eventually include
settings, dot files, etc, so you could restore a lost installation
from your ownCloud. Vitally, Mines' high scores. For security, the
client could encrypt data before arriving at the server, but if you do
this, some apps won't work well (since they can't read your data).
Right now, I think it's something I'd like to run within my own VPN
for privacy, practically providing me with a 'Google in a box'.




Emmanuelle Bassi on Clutter



The state of Clutter was discussed, along with a proposal to move more
functionality into Gtk+. There was a bit of technical discussion
during the talk and interested parties generally liked the idea.




Tristan van Berkom on Glade and GtkBuilder's UI developer experience



Tristan showed off some long-desired improvements to Glade and
GtkBuilder. He talked about the use in guiding users (here:
developers) on the right path, with the idea of improving the tie-in
between GtkBuilder and actual class code, especially regarding
callbacks and such. Also, you can finally click-and-drag UI elements
onto the graph (whee!) and intelligent grouping of widget properties
by section.




Matthias Clasen's guide through GtkApplication



Matthias led us through a new tutorial of how to build a modern
GtkApplication, emphasing important parts like application-id,
embedding of resources into the binary, using templates and new
macros. Demonstrated was newer candy like GActionMap, GSettings,
templates, GtkStack, GtkSearchEntry and Bar, GtkRevealer, GtkListBox,
GBindings, and more. Wow!





Conclusion



The conference has been really amazing. I'm surrounded by my greatest
programming heroes and have gotten to be immersed in the shared
excitement over GNOME's future.


I'm looking forward to the talks next year in Strasbourg, and the
Boston Summit in Montréal this October.


Dieses Blog durchsuchen

Labels

#Technology #GNOME gnome gxml fedora bugs linux vala google #General firefox security gsoc GUADEC android bug xml fedora 18 javascript libxml2 programming web blogger encryption fedora 17 gdom git emacs libgdata memory mozilla open source serialisation upgrade web development API Spain containers design evolution fedora 16 fedora 20 fedora 22 fedup file systems friends future glib gnome shell internet luks music performance phone photos php podman preupgrade tablet testing typescript yum #Microblog Network Manager adb apache art automation bash brno catastrophe css data loss debian debugging deja-dup disaster docker emusic errors ext4 facebook fedora 19 gee gir gitlab gitorious gmail gobject google talk google+ html libxml mail microsoft mtp mysql namespaces nautilus nextcloud owncloud picasaweb pitivi ptp python raspberry pi resizing rpm school selinux signal sms speech dispatcher systemd technology texting time management uoguelph usability video web design youtube #Tech Air Canada C Electron Element Empathy Europe GError GNOME 3 GNOME Files Go Google Play Music Grimes IRC Mac OS X Mario Kart Memento Nintendo Nintendo Switch PEAP Selenium Splatoon UI VPN Xiki accessibility advertising ai albums anaconda anonymity apple ask asus eee top automake autonomous automobiles b43 backup battery berlin bit rot broadcom browsers browsing canada canadian english cars chrome clarity comments communication compiler complaints computer computers configuration console constructive criticism cron cropping customisation dataloss dconf debug symbols design patterns desktop summit development discoverability distribution diy dnf documentation drm duplicity e-mail efficiency email english environment estate experimenting ext3 fedora 11 festival file formats firejail flac flatpak forgottotagit freedom friendship fuse galaxy nexus galton gay rights gdb german germany gimp gio gjs gnome software gnome-control-center google assistant google calendar google chrome google hangouts google reader gqe graphviz growth gtest gtg gtk gvfs gvfs metadata hard drive hard drives hardware help hp humour ide identity instagram installation instant messaging integration intel interactivity introspection jabber java java 13 jobs kernel keyboard language language servers languages law learning lenovo letsencrypt libreoffice librpm life livecd liveusb login lsp macbook maintainership mariadb mario matrix memory leaks messaging mounting mouse netflix new zealand node nodelist numix obama oci ogg oggenc oh the humanity open open standards openoffice optimisation org-mode organisation package management packagekit paint shedding parallelism pdo perl pipelight privacy productivity progress progressive web apps pumpkin pwa pyright quality recursion redhat refactoring repairs report rhythmbox sandboxes scheduling screenshots self-navigating car shell sleep smartphones software software engineering speed sql ssd synergy tabs test tests themes thesis tracker travel triumf turtles tv tweak twist typing university update usb user experience valadoc video editing volunteering vpnc waf warm wayland weather web apps website wifi wiki wireless wishes work xinput xmpp xorg xpath
Powered by Blogger.