pkg-config vs. Cross Compile and Multi-arch
One of the areas where pkg-config
can cause some problems is when trying to cross compile some code, or
when working with multi-arch systems (such as bi-arch AMD64 Linux
distros). While it is possible to use pkg-config
in such systems by
manipulating $PKG_CONFIG_PATH
and/or $PKG_CONFIG_LIBDIR
, users
can't just follow the instructions given for the single-arch case.
After some discussion with Wolfgang Wieser, we came up with a proposal for better supporting cross-compile and multi-arch uses. The main changes would be:
HTTP code in GWeather
One of the things that pisses me off about gweather
is that it
occasionally hangs and stops updating. It is a bit easier to tell when
this has occurred these days, since it is quite obvious something's
wrong if gweather thinks it is night time when it clearly isn't.
The current code uses gnome-vfs
, which isn't the best choice for this
sort of thing. The code is the usual mess you get when turning an
algoithm inside out to work through callbacks in C:
Overriding Class Methods in Python
One of the features added back in Python 2.2 was class methods. These differ from traditional methods in the following ways:
- They can be called on both the class itself and instances of the class.
- Rather than binding to an instance, they bind to the class. This means that the first argument passed to the method is a class object rather than an instance.
For most intents and purposes, class methods are written the same way as normal instance methods. One place that things differ is overriding a class method in a subclass. The following simple example demonstrates the problem:
pkg-config patches
I uploaded a few patches to the pkg-config bugzilla recently, which will hopefully make their way into the next release.
The first is related to bug 3097, which has to do with the broken dependent library elimination code added to 0.17.
The patch adds a Requires.private
field to .pc
files that contains a
list of required packages like Requires
currently does, which has the
following properties:
Clipboard Handling
Phillip: your idea about direct client to client clipboard transfers is doable with the current X11 clipboard model:
- Clipboard owner advertises that it can convert selection to some special target type such as "client-to-client-transfer" or similar.
- If the pasting client supports client to client transfer, it can check the list of supported targets for the "client-to-client-transfer" target type and request conversion to that target.
- The clipboard owner returns a string containing details of how to request the data (e.g. hostname/port, or some other scheme that only works for the local host).
- Pasting application contacts the owner out of band and receives the data.
Yes, this requires modifications to applications in order to work correctly, but so would switching to a new clipboard architecture.
Anonymous voting
I put up a proposal for implementing anonymous voting for the foundation elections on the wiki. This is based in part on David's earlier proposal, but simplifies some things based on the discussion on the list and fleshes out the implementation a bit more.
It doesn't really add to the security of the elections process (doing so would require a stronger form of authentication than "can read a particular email account"), but does anonymise the election results and lets us do things like tell the voter that their completed ballot was malformed on submission.
Python Challenge
Found out about The Python Challenge. While you don't need to use Python to solve most of the problems, a knowledge of the language certainly helps. While the initial problems are fairly easy, some of the later ones are quite difficult, and cover many topics.
If you decide to have a go, here are a few hints that might help:
- Keep a log of what you do. Solutions to may provide insight into subsequent problems.
- Look at ALL the information provided to you. If the solution isn't apparent, look for patterns in the information and extrapolate.
- If you are using brute force to solve a problem, there is probably a quicker and simpler method to get the answer.
- If you get stuck, check the forum for hints.
There is also a solutions wiki, however, you need to have solved the corresponding problem before it will give you access.
Clipboard Manager
Phillip:
the majority of applications have no cut and paste code in them — they
rely on the cut and paste behaviour of the standard widgets. Since the
standard widgets like GtkEntry
in GTK 2.6 mark their selections as
being savable (in fact, any code that calls gtk_clipboard_set_text()
will have its selection marked as savable). Most of the remaining cases
are ones where you'd want to be selective in what gets saved (e.g.
selecting cell ranges in Gnumeric, or regions of images in Gimp), so
need to be handled specially anyway.
Merging In Bazaar
This posting follows on from my previous postings about Bazaar, but is a bit more advanced. In most cases you don’t need to worry about this, since the tools should just work. However if problems occur (or if you’re just curious about how things work), it can be useful to know a bit about what’s going on inside.
Changesets vs. Tree Snapshots
A lot of the tutorials for Arch list “changeset orientation” as one of its benefits over other systems such as Subversion, which were said to be based on “tree snapshots”. At first this puzzled me, since from my mathematical background the relationship between these two concepts seemed the same as the relationship between integrals and derivatives:
First Thoughts on NewsBruiser
I've moved my diary over to blogs.gnome.org
, which offers a few extra
features over advogato (the main ones I'm interested in are more
control over the layout, and the ability to embed images). Overall it
seems pretty good, although I have a few gripes:
- The login cookie gets set for the path
/nb.cgi/
only, so when I go to the front page of my diary, which is not under that path due to somemod_rewrite
magic, it never thinks I'm logged in. - My login cookie gets sent to all pages under
/nb.cgi/
, including other hosted blogs. Given that I can put arbitrary HTML in the templates for my blog, it would be possible to capture the passwords of other NewsBruiser users on the system without much trouble (it's a good thing we all trust each other). This one is a bit difficult to fix because of the URI structure for newsbruiser pages, which look like "/nb.cgi/verb/username/...
". If they were structured with the username first, it would be trivial to set up the cookie so it only gets sent when viewing one particular blog.
Overall though, it seems quite nice.
Bazaar (continued)
I got a few responses to the comparison between CVS, Subversion and Bazaar command line interfaces I posted earlier from Elijah, Mikael and David. As I stated in that post, I was looking at areas where the three systems could be compared. Of course, most people would choose Arch because of the things it can do with it that Subversion and CVS can't. Below I'll discuss two of those things: disconnected development and distributed development. I'll follow on from the examples in the previous post.
SCM Command Line Interface Comparison
With the current discussion on gnome-hackers about whether to switch Gnome over to Subversion, it has been brought up a number of times that people can switch from CVS to Subversion without thinking about it (the implication being that this is not true for Arch). Given the improvements in Bazaar, it isn't clear that Subversion is the only system that can claim this benefit.
For the sake of comparison, I'm considering the case of a shared repository accessed by multiple developers over SSH. While this doesn't exploit all the benefits of Arch, it gives a better comparison of the usability of the different tools.
Something is wrong with the Immigration Department
Shortly after the scandal over Cornelia Rau (a mentally ill Australian who was in detention for 10 months), another case gets some media attention: Vivian Young/Alvarez/Solon.
She is an Australian citizen born in the Phillipines, who also suffers from a mental illness. From the news reports, the sequence of events seems to be:
- In 1984, Vivian moved to Australia to live with her new husband.
- In 2001, she was involved in a car accident in NSW. While being treated at Lismore Hospital for her injuries, she lodged a citizenship application and the staff contacted the immigration officials. She gave her name as "Vivian Alvarez".
- On July 17, 2001, the Queensland Department of Families finally notified police that "Vivian Young" was missing.
- Days later, she was deported to the Phillipines -- neither the NSW or Qld police noticing that she was on the missing persons list. Apparently she was pushed onto the plane in a wheelchair, still suffering from head injuries.
- In 2003, an immigration official discovered the mistake while looking through the missing persons list. It doesn't seem that any action was taken at this time.
- This month, the mistaken deportation becomes public. This is the first time that the family is notified -- four years after the deportation, and two years after the mistake had been discovered. The government says they don't know her location, but are doing everything in their power to find her.
Among the Australian family, she left behind a son who is still in foster care.
<tt>bgchannel://</tt> Considered Harmful?
Recently Bryan posted about
background
channels
-- a system for automatic updating desktop wallpaper. One of the
features of the design is a new URI scheme based on the same ideas as
webcal://
, which I think is a bad idea (as dobey has also pointed
out).
The usual reasoning for creating a URI scheme like this go something like this:
- You want to be able to perform some action when a link in a web page is clicked.
- The action requires that you know the URI of the link (usually to allow contacting the original server again).
- When the web browser activates a helper application bound to a MIME type, you just get the path to a saved copy of the resource, which doesn't satisfy (2).
- Helper applications for URI types get passed the full URI.
So the solution taken with Apple's iCal and Bryan's background
channels is to strip the http:
off the start of resource's URI, and
replace it with a custom scheme name. This works pretty well for the
general case, but causes problems for a few simple use cases that'll
probably turn out to be more common than you think:
29 April 2005
I have been in Sydney for the past week for UDU, which wraps up tomorrow. It has been great meeting up with everyone again, but has also been exhausting.
Some of the stuff on the horizon will be quite ground breaking. For instance, I don't think anyone has attempted something like Grumpy Groundhog (which will hopefully be very useful to both the distro team, and upstream projects like Gnome).
pkg-config
One of the changes in the recent
pkg-config releases is that the
--libs
output no longer prints out the entire list of
libraries expanded from the requested set of packages. As an example,
here is the output of pkg-config --libs gtk+-2.0
with version
0.15:
-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
And with 0.17.1:
-lgtk-x11-2.0
If an application is compiled with the first set of -l
flags, it will include DT_NEEDED
tag for each of those
libraries. With the second set, it will only have a
DT_NEEDED
tag for libgtk-x11-2.0.so.0
. When run,
the application will still pull in all the other libraries via shared
library dependencies.
The Colour Purple
If you look at the bottom of Cadbury's website in the footer of the page, you find the following text:
..., and the colour purple are Cadbury Group trade marks in Australia.
Apparently Cadbury believes they can trade mark a colour, and according to a story on the radio they've been sending out cease and desist letters to other small chocolate makers in Australia.
It turns out that even though they are claiming it as a trade mark, they only have a pending application. The details can be found by going to here, choose "enter as guest", and enter "902086" into the search box at the bottom (it doesn't seem like you can bookmark a particular application).
New pkg-config
I recently pointed jhbuild's bootstrap module-set at the new releases of pkg-config, which seems to have triggered some problems for some people.
In some ways, it isn't too surprising that some problems appeared, since there were two years between the 0.15 and 0.16 releases. When you go that long without testing from packages that depend on you, some incompatibilities are bound to turn up. However, Tollef has been doing a good job fixing the bugs and 0.17.1 fixes most of the problems I've found.
8 April 2005
Tracing Python Programs
I was asked recently whether there was an equivalent of sh -x
for
Python (ie. print out each statement before it is run), to help with
debugging a script. It turns out that there is a module in the Python
standard library to do so, but it isn't listed in the standard library
reference for some reason.
To use it, simply run the program like this:
/usr/lib/python2.4/trace.py -t program.py
This'll print out the filename, line number and contents of that line
before executing the code. If you want to skip the output for the
standard library (ie. only show statements from your own code), simply
pass --ignore-dir=/usr/lib/python2.4
(or similar) as an option.
Fedora EULA
roozbeh: the Fedora EULA probably isn't a GPL violation (I'm sure Red Hat has legal advice that it is okay). Section 1 says "This agreement does not limit User's rights under, or grant User rights that supersede, the license terms of any particular component". So the EULA explicitly says that it doesn't limit any rights you received under the GPL. Section 2 goes on to say that your rights to copy or modify individual components of the distro are covered by the respective license.
14 March 2005
Eugenia's Article
I find it amusing how Eugenia selectively quotes mailing list posts to create an article about how Gnome doesn't care about what users want, and then in a follow-up asks that people don't take her article out of context.
New Gettext
While looking at the new version of gettext, I noticed the libgettextpo
library. Starting with the new 0.14.2 release, this library now includes
a .po
file writer as well as a parser. I wonder if this could be
useful for tools like intltool
.
8 March 2005
South Africa
I put up my photos from the trip to Cape Town online. Towards the end there are some photos I took while hiking up Table Mountain.
Building Gnome
It looks like with the Gnome 2.10 release, some packages fail to build from CVS if you are using a version of libtool older than 1.5.12. This is due to the way libtool verifies the version strings — in versions prior to 1.5.12, the check to make sure that the interface version numbers were non negative used a shell pattern that only matched numbers up to 3 digits long.
South Africa
From the conditions of residence at the place I'm staying:
5. Where appropriate the masculine gender shall include the feminine gender and vice versa and the singular shall include the plural.
Bush fire
When I woke up this morning, there was a lot of smoke in the air from the bush fire up in the hills east of Perth. The smoke is so thick that some buildings less than a kilometer away are only just visible. Also, sunlight filtering through the smoke gives everything a yellow tinge.
It hasn't burnt down any houses yet, and hopefully the fire services will get it under control before it does.
GraphViz
On the gtk-doc-list
mailing list, Matthias mentioned that the
GraphViz license has been changed to the
CPL (the same license as
used for Eclipse), which is considered Free by both the FSF and OSI
(although still GPL incompatible). This should remove the barriers that
prevented it getting packaged by Linux distributions.
Due to the previous licensing, RMS urged developers of GNU software to
not even produce output in the form that the GraphViz tools use as
input. Maybe that can change now. While the license is GPL incompatible,
the GraphViz tools can easily be invoked from the command line, passing
a .dot
file in, and getting output in PNG, PS, SVG, etc format (or
even another .dot
file with the layout information added), which is
enough for pretty much all uses of the tools.