Re: libseed-list gobject-introspection-1.30.0



Ah yes, I remember this one, they have been talking about fixing it for a long while, guess we finally need to solve that.

Fun one is, that Javascript does not support pure byte arrays very well, strings are supposed to be UTF8.

Ideally we should create a new object in javascript that behaves like a string, but contains a byte array, but for the time being, I think, just converting these arrays straight to strings, and living with the concequenc
es is the best solution.

Regards
Alan
 --- On 04/Oct/2011, Chris Vine wrote: 
> On Mon, 03 Oct 2011 11:23:41 +0800
> "Alan Knowles" <alan akbkhome com> wrote:
> > Introspection is a bit of a nightmare sometimes...
> > 
> > The 'ideal' solution is to find the definition in the .c file, and
> > fix the definition there, then report it as a bug.. and wait for
> > upstream to fix it.
> 
> You email is helpful and does at least identify the problem, although
> having looked at it I think it is a deliberate introspection API break
> on the part of the glib and gobject-introspection developers rather
> than a bug, in order to allow gjs to throw around utf8 byte arrays more
> easily.  The gjs-1.30 binding for Gio.DateInputStream.read_line() now
> provides a utf8 (guint8) array to provide text input as compared with
> the standard javascript String object which gjs-0.7 provided, which
> will no doubt have broken a number of gjs scripts people might have
> written.
> 
> The annotation for the return value of g_data_input_stream_read_line()
> in gdatainputstream.c has changed from (for glib-2.28):
> 
>   Returns: transfer null:
> 
> to (from glib-2.30):
> 
>   Returns: transfer null: (array zero-terminated=1) (element-type
>   guint8)
> 
> The Gio-2.0.gir file for glib-2.28/gobject-introspection-0.10 has:
> 
>         <return-value transfer-ownership="full">
>           <doc xml:whitespace="preserve">a string with the line that
>         was read in</doc> <type name="utf8" c:type="char*"/>
>         </return-value>
> 
> The Gio-2.0.gir file for glib-2.30/gobject-introspection-1.30 has:
> 
>         <return-value transfer-ownership="full">
>           <doc xml:whitespace="preserve">a</doc>
>           <array c:type="char*">
>             <type name="guint8"/>
>           </array>
>         </return-value>
> 
> Presumably this is what has broken seed.
>  
> > The more realistic workaround is to 
> > a) find the bad .gir file, 
> > b) fix the definition in there
> > c) use g-ir-compile to re-create the .typelib file
> > 
> > Since some of my code is on my critical workflow, I've had to make a
> > copy of all the relivant gir's here.
> > https://github.com/roojs/gir-1.2-gtk-3.0
> > 
> > These have been slightly fixed to solve a few common bugs in glib /
> > gtk etc.
> > 
> > I then use this small script to generate typelibs from them
> > https://github.com/roojs/gitlive/blob/master/install1.2.sh
> > 
> > Then add this at the start of the application - to modify the search
> > path.
> > 
> > GI = imports.gi.GIRepository;
> > GLib        = imports.gi.GLib;
> > GI.Repository.prepend_search_path(GLib.get_home_dir() +
> > '/.Builder/girepository-1.2');
> > 
> > Note: if you modify Glib, you will probably have to replace your
> > system glib-2.0.typelib,
> > 
> > Regards
> > Alan
> 
> I have a copy of the old glib-2.28/gobject-introspection-0.10 bindings
> on another machine so I will probably copy them across pending seed
> catching up.  It looks as if seed is being treated as something of a
> second citizen here with this kind of arbitrary breakage, but no doubt
> that is the result of gjs having been adopted for gnome-shell.
> 
> Chris



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]