Search Results: "matthew"

24 July 2006

Bdale Garbee: elilo in Debian

In a recent work-related conversation, Matthew Wilcox pointed out that EFI partitions are mountable on Linux and many distributions keep ia64 system partitions mounted at /boot/efi by default, but Debian does not. Since that behavior is mostly my fault, I recounted the history by way of explaining why it worked that way... and on suggestion from Martin Pool am repeating it here to document all this for posterity. When we were making ia64 bootstrap decisions, the default bootloader on i386 was lilo, and the closest example to what we needed for ia64 in Debian was powerpc. This is because systems using EFI only understand FAT partitions by default, and thus need a FAT partition somewhere that the firmware can read from... often the first partition on the first disk. The Debian model for handling such things at the time seemed to be to craft a command to hook from kernel package postinst scripts that did the heavy lifting in association with a config file. What went on behind the curtain wasn't something to bother the user with on an average day if you could avoid it cleanly. Some bootloaders know how to read a config file from /boot directly, and we started out thinking we'd use elilo that way, but it was hard to match up paths/naming in EFI to what they would look like under Linux. It was also clear to me that most ia64 systems were going to have large system partitions so there'd be plenty of space. So we punted and copy the elilo executable, config file, and any kernels or initrd files referenced in the config to the system partition. I also thought the default location other distributions had chosen for mounting the EFI partition once the kernel was up, /boot/efi, was pretty ugly, but I couldn't think of anything better. The problem is that the standard says you need an \efi\"whatever" directory as the root of your content in the system partition, so mounting the partition at /boot/efi yields paths like /boot/efi/efi/debian. Some distributions didn't adhere to the standard at first, and so didn't see the ugliness until they started to comply... but I was on a team at HP making disk partitioning and content decisions that caused me to be very aware of these details. Putting that all together, I decided there wasn't any point in having the EFI partition mounted by default... anyone who cared and wanted it mounted could just add a line to /etc/fstab to put it wherever they wanted. If I were doing it again today, I'd have an entry in /fstab marked noauto delivered during system installation. I haven't cared enough to tackle that change, though. Sadly, there's one detail of the current implementation that can get in the way of complete happiness. The Debian-specific 'elilo' script that runs in user space to manage the EFI boot partition contents based on the content of /etc/elilo.conf expects to have to mount the EFI partition, and exits with a complaint if the partition is already mounted. For typical users, this script only gets called during installation and from kernel package postinsts, and the actual elilo bootloader remains oblivious to all this. If other distros have picked up the Debian script, I'm not aware of it. So, you're no worse off mounting the EFI partition in Debian than with some other distro, you just get treated poorly if you try to use our elilo script while the partition is mounted. Clearly, we could handle this better. If someone wants to offer up a patch to the elilo script that asks the user if it's OK to scribble in the already-mounted partition instead of doing a mount / scribble / unmount cycle in the presence of an existing mount, I'll be happy to include it in the Debian elilo package. Meanwhile, a lot of us have switched from lilo to grub on our i386 systems, and I'd love for my ia64 systems to work more like my grub-equipped systems. But making a substantive change like teaching elilo to know where /boot is so that it can read a config file from there and do things more like grub, without symlinks, etc, has several issues. We'd need to get the right set of file systems supported from EFI/elilo, we'd need to address the naming issues, and we would require either user intervention on upgrade, or some clever automatic parsing and rewriting of the relevant config files. I can think of other things that would be more rewarding to work on, so don't anyone hold their breath...

20 July 2006

Matthew Garrett

Results 1 - 10 of about 621 from pastebin.ca for password.

19 July 2006

Matthew Garrett

Mark:

You've been somewhat disingenuous in your quoting. The full phrase is "Since Debian has no authority to hold money or property, any donations for the Debian Project must be made to SPI, which manages such affairs". That is, the "Any donations for the Debian Project must be made to SPI" isn't saying "Money must be given to SPI because we don't trust anyone else", it's saying "Money must be given to SPI because we can't accept money ourselves". It's a historical bug, much like "Debian's Developers are currently members of SPI by virtue of their status as Developers" (untrue and the sort of thing that you'd normally complain about".

it looks to me like the DPL endorsing someone not approved by SPI maybe isn't a properly-made decision

"SPI has no authority regarding Debian's technical or nontechnical decisions" could be used to argue against that, since it clearly indicates that the approval (or not) of SPI can't be used to block decisions made by the rest of the project. Perhaps this section of the constitution was badly written? Good Lord, etc.

Advocating expulsion! For wanting to avoid involvement with an unethical, buggy business venture of some UK DDs!

Or, alternatively, for going on and on and on and on and on and on and on about an argument that you've already lost and wasting absolutely no opportunity to bring it up in any possible new vaguely related forum. Sort of like your "religious hate campaign" and "violation of the UN human rights declaration" routines. Entirely coincidentally, I've been facing the latter from a co-worker who keeps accusing me of having stolen her Windows XP CD. I mention this merely as an amusing aside.

I would have commented rather than making a post of my own, except that you don't seem to have any mechanism for providing publically viewable comments. Coincidentally, this is the same reason that I didn't comment to say that I didn't like the way you fold your posts.

(Edited to fix spelling)

17 July 2006

Matthew Garrett

So it turns out that if you collect some trays that fruitflies have been laying eggs on, and you collect most of the eggs from them and fix them in (effectively) formaldehyde and put them in the freezer, you should make sure that the trays (with some number of excess eggs) are put in a sealed bag and disposed of. Instead of, say, leaving them on your bench and then all the eggs you didn't collect hatching and filling your laboratory with flies. For instance.

I win at science.

11 July 2006

Matthew Palmer: It's All So Simple When You Know How

As a followup to my Dapper is teh suck entry, it appears that my egregiously slow system is known bug. Of course, it'd be better if it were a fixed bug, but at least it's trivially work-aroundable (echo 1 >/sys/module/processor/parameters/max_cstate -- down from it's default, on my system at least, of 8). Apparently there's some "issues" with the SMP-compiled kernel on uniprocessor systems, and hitting that tunable down masks the problem, whatever it is. It's funny -- just the other day I was having a chat with the other sysadmin at a place I'm contracting at about the vagaries of SMP kernels on non-SMP machines, and he was amazed that you could have a modern system that didn't play nice with an SMP kernel. Now, it seems, I'm a walking, cursing example of the issue. I don't mind, though -- I'm playing Oolite at full speed again, so I'm happy.

Matthew Palmer: User Interfaces as Slideshows

Backstory: I recently found a new game. It's called Oolite, and is (probably unsurprisingly) a clone of that great old spacefaring game, Elite (for BBC Micro and C64, amongst others). This game (unlike the original!) uses OpenGL and hardware rendering, so it was a good motivation to get accelerated rendering going on my laptop (never bothered before; it's unlikely that DRI is going to make an Xterm run any faster, after all). The problem with DRI under Ubuntu Breezy on my laptop is that it makes the machine unstable. Every couple of hours, my screen would freeze, and I'd get a lovely collection of randomly-coloured 80x25 text-mode characters on my screen, flashing madly at me. That's the signal for "game over", apparently, and I'd have to reboot. Incidentally, this used to happen, but very rarely, before I turned DRI on, so it's not really DRI-specific, but it went from occasional irritation to regular irritation. End backstory.
So it was time to upgrade. "Dapper's Out", thought I. "May as well see what all of the fuss is about". I think the phrase "oops" correctly describes the result. For reasons which I have not fully determined yet, my system is now Dog Slow. (That's the technical term, anyway; I've got a few more colourful phrases for it that I'm using privately). What was, previously, a nice quick Xterm launch is now a slowly progressing set of concentric rectangles culminating in the eventual, lacklustre, appearance of a terminal window. Oolite, my new obsession, is like playing Quake3 (the last OpenGL game I really got into, many years ago) on a P-II 300 with no 3d graphics card -- here a frame, there a frame, oh, by the way, you died a couple of minutes ago. (And yes, before you ask, glxinfo says "direct rendering: Yes".) This isn't an old machine -- it's a Thinkpad T43, with gobs of RAM and a 1.7GHz processor. It ran Breezy like a charm. Now, my machine looks like a powerpoint presentation. I've got to put something onto my wife's "new" (P-III 700) laptop -- lord only knows what it'll think of Dapper. Other strangenesses I've noticed so far include: Ultimately, I think that the cause of my problem may be closely related to that last point. I need to find out what's chewing my machine's CPU and kill it dead. Oh won't that be fun. Well, enough moaning. Time to find the cause(s) of these problems and nail it/them to the floor.

Matthew Garrett

A while ago, some people were delegated to make a decision about debconf. The final decision was meant to be made at a meeting, at which various vaguely disturbing comments were made by a couple of the delegates.

Shortly before the second meeting that was supposed to really, certainly, no questions this time arrive at a decision, the project leader removed the delegations and altered the way that the meeting was going to be run.

Unsurprisingly, this resulted in some unhappiness, including accusations of power grabbing.

So. Let's take a slightly closer look at things. Some facts:Or:

In the worst case scenario, the response to certain outcomes of the meeting may have been a general resolution with the aim of overturning an existing decision

Such a GR would have been horribly divisive. It would have been open to accusations of prejudice or vested interests against all involved. It would have wasted vast quantities of time that could have been better spent, and whatever the outcome it would have left a shadow over next year's Debconf.

We'll never know whether this would have happened, but it's hardly unrealistic. Anthony was left in an awkward position - remove the delegates (an action that would undoubtedly result in some people being very unhappy), or allow things to continue and risk all-out warfare within the project. Was it the right call? Maybe. Maybe not. But he was willing to take the personal popularity hit in order to reduce the probability of intra-project conflict. That's the sort of thing that we elect leaders to do. We should be happy that a leader actually shows a willingness to make difficult decisions, rather than crucifying them for it.

8 July 2006

Romain Francoise: Wisdom

Matthew Garrett: "I think the idea that Debconf should attempt to expose developers to different cultures is entirely insane. It doesn't fit any of the goals of Debian. That isn't to say that I'm against Debconf being held in countries which don't have stereotypical "western culture", merely against this being any sort of criterion in choosing the location."

3 July 2006

Matthew Palmer: Shittyrail does it again!

(Caution: Rant ahead. At least it's short.) It's obvious that they're putting the extra funds they're getting from yesterday's ticket price hike to good use -- this morning, my train was cancelled. These trains are pretty packed by the time they get to the city anyway, and now we're going to have twice as many sardines in the can. You'd think that, for at least this week, they'd try that bit harder not to piss people off too much. Or perhaps they're just packing it all into one chunk, figuring that there's some sort of upper-limit on people's irritation and it can't get worse beyond a certain point of irritation.

28 June 2006

Anthony Towns: On being DPL

It’s almost the end of financial year in Australia, so what better time to take stock? I’m actually a bit surprised at just how much I need to do that – I knew being DPL would involve some new challenges, but it’s barely two months in and I’m already just about in shock. Guess it serves me right for putting “increasing Debian’s tempo” in my platform…
The two other roles I’ve been in that I would have expected to prepare me more have been Debian release manager, and secretary of Linux Australia. They’re both similar in a way – the release manager does a lot of cat herding within Debian, and has to make some calls that will leave people aggrieved; and Linux Australia has some contact with the press, and some reasonably serious projects going on. So a few issues were completely expected: a random initial slashdotting, a press report, an interview or two, some requests for quotes in articles and press releases, or ongoing opposition and arguments from dedicated Debianites who don’t happen to agree with me on some decision. There were other things that were new and interesting though not really surprising. The leader@ mail address turned out to have just as much spam as I expected, though also some unexpected interesting stuff too, including my first ever personally addressed open letter – in this case by Keith Curtis who also wrote the 10,000 bugs away from World Domination article that got slashdotted a while back. A tidbit:
Everyone agrees that Ubuntu couldn’t exist without Debian, but I also believe that Debian is better setup to take Ubuntu where it needs to go. There are hints that the Ubuntu team feels like they brought a pork chop suit to a lions den. Ubuntu’s user base and development team is growing exponentially, but I believe they could get there much faster with more of Debian’s help.
Keith also forwarded an open letter he’d written to Mark Shuttleworth, and had some interesting comments on the whole Java thing. As well, I suddenly started receiving SPI board mail, as Debian’s advisory representative to the SPI board, and started getting a couple of requests for authorising expenditures (Debian UK reimbursing Matthew Garrett for travel costs to the Gnome Advisory Board meeting in 2005) or providing a Debian representative for a meeting or joining the Google Summer of Code. And then there were the cool things I knew absolutely nothing about, like the excellent news Christian Perrier passed on about the launch of Dzongkha Linux, featured in news reports from Bhutan, India, and Australia. Of course, I completely expected that all this would overload me a bit, and I’d end up getting distracted from what I wanted to do, and not being able to keep up with stuff other people wanted me to do. To help with this a little, I delegated Steve McIntyre as, essentially, a co-DPL, and he’s been working on a few things, including the now successful switch of irc.debian.org over to OFTC, and another fun little endeavour that I won’t spoil just yet. Things started getting a bit weird as I was preparing to travel off to debconf in Mexico – with some frustrated comments from damog and Marga and Gunnar, which was odd coming from the conference organisers themselves; and independently the reinflamation of some old tension on the debian-installer team. That got compounded at debconf itself, with the controversy over the inclusion of Sun Java in non-free extending not just to the lists, but an article in LWN (with a followup) as well as numerous other places around the net. That issue came to something of a climax when John Goerzen (with whom I’ve had some entertaining disagreements in the past) questioned whether SPI had been sufficiently involved in the decision (“I am becoming increasingly concerned at the unilateral method in which you and/or the archive maintainers have taken this decision.”), to which I responded fairly curtly to defend the way Debian makes decisions (“If SPI wish to withdraw from their relationship with Debian, then that’s entirely possible to arrange. I don’t think it’s at all proper that you try to obtain veto power of Debian’s activities as conducted by the duly authorised members of that organisation.”). Nothing’s really news there – flamewar on Debian lists between influential project members? Next thing you know the sun will rise in the East every morning, and then where will we be? What’s not so normal is those flamewars getting front page coverage on slashdot, or noted in an article on distrowatch. As far as Debian’s concerned, we had a couple more rounds, both in public and on the developer only -private list, then moved onto actually getting the legal advice John wanted. That’s actually still pending, and the debate has pretty much abated while that’s going on. And meanwhile, Wouter Verhelst, Manoj Srivastava, and others have started a much more productive look at Debian’s relationship with SPI and similar organisations, which has continued on to a draft of a constitutional amendment. But there was more stress and chaos at debconf than just the Java stuff, but what’s really impressive is the way people ended up dealing with it. Take damog for example:
Just as Tore said: This is the best DebConf ever. Isn’t it great? I started really enjoying this DebConf once I stopped worrying about bullshit, once I stopped worrying about senseless things and started to really give a shit about almost anything. Why do I need Gunnar to tell my girlfriend Ana, “you picked up the irresponsible one”? Why do I have to worry about the DPL giving a shit or not on the Latinamerican Debian community, even after being invited to meet the guys or to attend our BOF? […] I enjoy people here, thanks to all the organization cabal, thanks for your effort and your time on this. […] But after leaving all of this behind, I think Ana and me are having a great time sharing time with friends around us (the friends, los cuates, we are here for).
After seeing that post, and figuring out who damog actually was when he gave a lightning talk towards the end of the conference, we had a chance to briefly chat about what was going on – somehow I hadn’t taken in the invitation to attend the BOF, and had been told it was all in Spanish anyway, so hadn’t gone; meanwhile they’ve been thinking about holding a Debian miniconf in Latin America somewhere and wanting to know what sort of support they can get from the rest of the project – particularly moral support rather than financial, at that. Hopefully we’ll see news on that score in the coming months. But really, damog was right in the first place anyway: why care if the DPL supports you or not? Debian’s about everyone doing what they think is good and worthwhile, and that combining to produce something great – it’s not about what some guy who got six votes more than the next guy happens to think is important. But support is important, whether it comes in the form of a DPL saying “good idea!”, or something else. Gunnar’s response to the latter, eg:
Debian is love. After my scream for help a couple of days ago, and after a mountain of hard work, things are just running. No, we are not -by far- free of incidents, and it would be foolish to expect it to be so, but we are working nicely. And by the way, thank you, I have been receiving the largest amount of hugs ever, and believe me, each of them has been important. […] Thank you all, folks. I am in Cristoph Berg’s talk about reworking NM - And this comes very good to wrap up my post. Debian is much, much more than technical work. It is a social club. I love this social club. Just sitting here makes long months of work really worth it. A great hug back to you all!
And in the end we got quite a bit out of debconf6, for example more movement on the forthcoming release, improvements on i18n stuff, a new publicity project, movement on updating python, amongst other things. Who knows if the next debconf will manage to be anywhere near as much of an experience, but at least we’ll find out fairly soon where it’s going to be (though that process isn’t without hiccups of its own). Post debconf, there’s also been a notable influx of trolling going on too; with the most obvious and odious example being the insane, anonymously-posted prayers for a female developer’s death. Fortunately those have mostly been ignored as the mindless spam they are, though one might argue that Marcela Tiznado’s acceptance as a DD on her birthday, and the inclusion of women.debian.org in the official debian.org namespace are a more appropriate response to that sort of harassment than any sort of direct reply anyway. Not all our problems have conveniently been resolved right now, of course, the difficulties related to the installer team I alluded to above are ongoing, and at the moment a really good solution is still eluding us, though development continues anyway. And then, of course, there’s more to come – half the point of posting this is so I can stop worrying about all the stuff that’s been and gone, and get on with interesting things like the next point release, and the various other projects that I’ve let languish for the past few weeks.

22 June 2006

Ross Burton: Clutter 0.1

It's getting late, I'm starting to think I'm getting RSI, and I need a coffee, so instead of saying how great Clutter is I'll just link to what Matthew said already. Go Clutter! NP: Foolish Games, Jewel

13 June 2006

Jonathan McDowell: Ooooh. It's all pretty.

I had a rant about Firefox today on #debian-uk. Mainly the fact it seems to like to guzzle memory and bring my system to a crawl when it feels unloved. Which is every time it loads an animated image as far as I can tell. Matthew suggested Epiphany so I thought I'd give it a try. Seems ok, but looked a bit blocky, like GTK apps do for me. Not shiny and curvy like people who run a GNOME desktop (I run the excellent evilwm). So I had a poke around. And the magic is to run aptitude install gtk-theme-switch gtk2-engines and then switch2 and pick a theme and marvel as your GTK apps become sexier. Of course you probably all knew this. I'm impressed with how it's affected GNUCash, liferea and workrave as well (yes, yes, that's the whole point of theming, but I'm a simple creature who mostly runs xterms). Time will tell if Epiphany actually sucks less than Firefox. And there's still the leaking bucket that is liferea (253MB? Eh? And that's with the optimise for memory option enabled).

8 June 2006

Matthew Palmer: [Ruby] Blocks as Resource Management

One of the really neat things about Ruby is the extensive use of blocks (closures, I think the rest of the world calls them) in the standard library to control the allocation and deallocation of resources. Take the following snippet:
 File.open('something.txt') do  fd 
   # Manipulate the file through 'fd'
 end
 # File handle is now closed
There's no way that you can escape from that block without the file being closed (well, in theory, you could lose the file handle if there was an exception thrown in the block, but the File::open method can take care of that internally by catching, closing, then rethrowing). I've loved this feature since I first saw it -- "holy crap!" I thought to myself, "I never have to call close again!". And I was pretty well right -- I think I can count (in unary, not binary!) on one hand (well, I'd use grep wc) the number of times I've used IO#close in my Ruby code. The funny thing is, though, that I don't think I've used this pattern in my own code enough. But I just had an epiphany whilst waiting for a train home -- and I think I'm cured. Take this hideous piece of test code I had laying around in an app I'm working on at the moment:
 def test_something_funny
   faux_path_on
   d = Domain.new('127.0.0.1', 'somethingfunny.com')
   faux_path_off
   
   # assert writ large
 end
Domain::new calls out to a shell command (dig(1) to be precise -- take a guess at what I'm writing <grin>, and yes, it will be released shortly) but for test purposes I can't run dig (because I'm not guaranteed to have all the infrastructure available for a real dig to succeed). So I have a flimsy mock of dig in a directory in my test suite, which is where faux_path_on sets ENV['PATH'] to look at. This is, of course, pretty untidy, because when (not if!) I forget to call faux_path_off, everything goes to complete poop, and my children will have two heads or something. The much cleaner version is like this:
 def test_something_funny
   d = faux_path   Domain.new  
 
   # Assert ahoy!
 end
And my faux_path method (I've even saved a method!) is as simple as simple can be:
 def faux_path
   realpath = ENV['PATH']
   ENV['PATH'] = my_fake_path
   rv = yield
   ENV['PATH'] = realpath
   return rv
 end
I also have a trickier faux_* method, which sets a couple of environment variables which tell my mock nsupdate(8) where to write the data it gets sent from my application -- again, it's a block-taking method that sets the environment, yields, reads in the data from the temporary file, cleans it up, and returns the contents of the aforementioned file. The power of the Ruby is growing within me, I can feel it. And I like it.

Matthew Palmer: A Fool And His Money are soon parted...

... but not nearly soon enough. The Daily WTF is almost always worth a read -- it makes me feel better about my lot in life. Today's entry, though, shocked me more than a little. How do people this dumb even breathe? Certainly, they don't deserve to be in control of a business.

Matthew Palmer: Inadvertantly Appropriate

Seen on the way to work this morning (for some sort of art show):
From the affordable... to the collectable!
I'm not sure that what they meant was "the stuff you can afford isn't worth keeping", but I'm pretty sure that it's the truth.

24 May 2006

Baruch Even: Debian in Google Summer of Code 2006

Congratulations to all whose projects were accepted, Debian received 60 eligible proposals, many of those were great projects which we would have loved to accept but we only had 10 slots that are paid for by Google so the competition was tough. The accepted projects are: All the accepted projects received email to them and their mentor, if you are a student whose project wasn't accepted, we'd still be happy if you will do the project even without the funding, if you need a helping hand or a mentor we will surely be happy to help you out, contact me at baruch@debian.org. The plan is that students who have a blog or setup one for the Summer of Code will be added to Planet Debian so everyone can follow their progress on their quest to help Debian improve. Cheers and thanks to everyone who helped make this happen!
Baruch Even
Debian SoC coordinator

Matthew Palmer: Testing the Testing of Your Tests

I'm writing an application in Ruby that makes heavy use of XMLRPC (the application of XMLRPC-over-Unix-socket fame), and so I'm using Mock Objects to mock out the XMLRPC client proxy and provide an interface that doesn't involve having a whole other infrastructure running on my laptop so I can run my test suite. For those who don't know, mock objects are objects which look and superficially act like the real objects you might use to communicate with an external service, but don't actually do the communication -- instead, they return canned responses to your calls. Why is this useful? Well, imagine that the real object talks to a SOAP service on the 'net (such as the Google search API). It means that every time you run your test suite, you need access to the Internet. The external service may also cost something everytime you talk to it -- or it may be impossible to use to test, since there's statistics generation or something going on that means that hammering it for test purposes is just impractical. In addition to returning values to your application, mock objects will usually record what has been called, so that after your test run is complete, you can also verify that all of the methods you wanted called have actually been called. This means that you can have a good idea that what you wanted to happen to the service actually would have been done. Handy. Some people have a (justified) ditrust of Mocks, because it's easy to make a mock object that doesn't perform like the real one (and hence invalidate your tests), but they provide a necessary evil in cases where you just can't use the real object when running your test suite. The XMLRPC proxy I'm using has a bit of a quirk. Everything runs through one method on that object -- XMLRPC::Client#call(). This seems really limiting, especially in a wonderfully dynamic language like Ruby. In reality, it's not too bad -- it makes the object interface easier to mock, and you couldn't emulate the whole thing with method_missing anyway, because you can have various Ruby-illegal characters in XMLRPC method names. The downside to this all-in-one-method thing, though, is that simply verifying that #call() has been invoked a dozen times doesn't really tell me much about whether the mock was used the way I wanted it to be used. My chosen mock object suite, Test::Unit::MockObject, whilst otherwise excellent, is (or rather, was) missing the ability to verify the arguments that are passed to your calls -- you can say "I need methods x(), y(), and z() called", but you couldn't say "I need the call y('foo', 'bar', 42) made". Of course, this change the mock object class is non-trivial, and needs to be tested itself (it'd be pretty lame if a class intended to facilitate automated testing lacked a test suite of it's own). I added a bunch of tests to the test suite, and got some good results. I had a couple of false starts, where I wasn't checking most of the corner cases (where bugs lurk in the shadows), but eventually I got a test suite that was fairly complete, which drove the new features I needed to a good place. So I carted my newly enhanced mock object class across to my production project, and off I went. Except that I was getting some downright weird failure messages when my code wasn't invoking the mock object the right way. Why? Because I hadn't tested that my failure messages were appropriate. Why was that? Because the assert_raise assertion in Test::Unit doesn't have a facility to make sure that you're passing back the right exception message, only that you're passing back the right exception class. Whisky, Tango, Foxtrot? Over. (This space intentionally left blank for me to insert the correction to this claim that the lazyweb is sure to provide) So I had to write a new assertion (assert_exception_message) which checked that both the right class and the right message came back. This code, of course, needs to be tested too, because otherwise you can't be sure that your test code is performing right. At this point, I was writing test code to test a new assertion I'd written so I could test the mock object class I had modified so I could test my application. At this point, things got a bit "meta". It got a bit difficult to separate out the tests from the tests' tests. But I fought through the brain melt, and shortly thereafter came out the other end with a properly working piece of actual application, and all was well in the world. By now, a certain Mr. Tendys is probably rubbing his hands with glee, as he gets ready to espouse at length about how this whole post just proves how utterly useless test-first programming (or even testing in general) is for producing economically-viable software. Let me analyse what I "spent" on getting all this functionality, though -- about 3 train trips home -- maybe 4 hours of time total, including writing the extra tests in my application to use the wonderful new features I'd made. That's not much, in the grand scheme of things. I've wasted that much time in a day skiving off work in the past because I was frustrated with what I was trying (and failing) to program, usually because I was swamped with bugs. What did that four hours of my time buy me? Heaps. I can now better verify my software works as anticipated. I have confidence that my software is a lot more robust than it was before. My tests identified several issues that passed my eyeball check, but blew up when I tried to actually use them in a particular way. But with the help of my tests, I identified the problems quickly and went on my way. Since I was working in a localised area of the application, I was immediately familiar with the code, and could stomp the bug almost immediately. If I'd only done end-to-end testing at the end of development (or worse, released it with the bugs still in there), the debugging would have been much harder because I'd forgotten little details about the code. I reckon that benefit, alone, has probably saved me 4 hours already, since I've spent whole days hunting down little bugs in an ad-hoc fashion in the past. I'm fairly sure most any programmer can empathise with me there.

Matthew Palmer: Trains: Inverse Hibernation

So it would appear that, now that the hot weather is over and blessed winter is upon us, the air-conditioned trains that I dreamed of so much and so rarely saw over summer are now out in force. Such a cruel, cruel world we live in.

14 May 2006

Matthew Palmer: Curious Perversions in Software Engineering

I've been ill with flu the last few days, so I've been doing very little other than sitting huddled in my recliner, with a large, warm blanket over me, and my hot water bottle (AKA the laptop) to work on. As a result, I've been doing a fair amount of random coding, and I've come away with a larger-than-average amount of... weird shit. It maybe the flu, the strong drugs I've been taking to keep the symptoms under control, or maybe just the phase of the moon, but I haven't coded up this much madness in quite a while. Let me take you through them. The Proctologist I've been writing some software which has to talk to an XML-RPC server. Not so weird. However, because the system lacks any inherent security, the (strongly) preferred method of communicating with this server is via a Unix socket. That's right, I'm doing XML-RPC over HTTP over... a Unix socket. That, you may think, is weird. Well, it is, but it isn't the curious perversion in and of itself -- for a start, I didn't write that monster, and I'm only blowing my own trumpet in this article. No, the perversity is in how I wrote *my* software to deal with it. See, I'm using Ruby for this software, and the standard Ruby XML-RPC client uses the built-in Net::HTTP library that comes with Ruby (which is a killer little HTTP library, BTW). Because the authors of Net::HTTP were lacking in imagination (or crack pipes) they didn't think to include the native ability to talk to Unix sockets. I mean, really -- isn't that the most important feature in a HTTP library? I think we all know the answer to that. Anyway, despite the lack of forward planning (and crack pipes) on the part of the Net::HTTP authors, I needed to get it to talk to a Unix socket. I could have done the long-winded thing and spend a pile of time putting in handling of pipe:// (crack or otherwise) URLs, but then I would have also had to add support for it to the XML-RPC client library (which did URL validation before passing it on -- good for it). And really, I don't think I could have handled the guffaws of laughter when I attempted to submit the patch upstream. Instead, I put Ruby to it's perfectly-suited use. I simply created the XML-RPC client object (which created the Net::HTTP object internally), then inserted my gloved finger and replaced the default TCP socket object in the Net::HTTP object with a specially crafted Unix socket object pointing to the correct place. "Dear god almighty!" I hear the practitioners of good software engineering practice exclaim. "Doesn't Ruby have protection against such atrocities?" Why, yes, it does. All of the objects I had to play with are private instance variables of their parents, and I can't get access to them normally. However, classes in Ruby are never closed, so I just reopened them and added accessor methods (which, in Ruby, is as simple as attr_accessor :http) so I could do my nasty little thing. I'm quite happy to take the heat for doing what I did. It breaks encapsulation, and makes everything that little bit more complex. But, on the other hand, it let me get the job done -- the language gives you full protection until you say "may I?" and then it gets out of your way. Personally, I reckon that's a nice tradeoff between C-style full control (where even the best programmers blow their foot off on a regular basis) and B&D; languages where you'll never shoot yourself in the foot, but instead you'll gnaw your leg off in frustration. Russian Dolls I'm doing a bunch of interesting things with the Xen hypervisor for work. Of course, you need to have a way to test all this stuff, and despite a number of hints, work still hasn't gotten me that fully-kitted out dual-core Opteron that I want to test (and transcode all my video <grin>) on that I always wanted. So, instead I've installed Linux in a qemu image, and then put Xen on that. Surprisingly, it's worked really well -- I've got Xen running quite happily in the virtual machine, and I can create and run Xen domUs (the guest VMs) in the usual fashion. Now all I need to do is install UML in a Xen domU, and then run some vservers inside that UML, and I'll have the full collection...

11 May 2006

Matthew Palmer: The Pain of CFEngine

So it seems that Steve Kemp is finding out that, whilst being a brilliant idea in theory, CFEngine is just plain weird in practice. I was the person who originally encouraged Steve to look at Puppet when he was originally talking about this stuff about a month ago. I was arguing from a position of weakness then, as I'd never tried Puppet then (although I was already eminently familiar with CFEngine and it's issues). Since then, I have started using Puppet on a project for a client, and let me just say that it is "all that and a bag of potato chips". Luke Kanies, the main man behind Puppet, is immensely supportive, quick to work up new features when suggested (< 24 hour turn around, in some cases) and really knows his systems-management stuff. The configuration language itself is quite easy to learn, it's wonderfully extensible, and the system as a whole doesn't have nearly the same number of "WTF?" moments as CFEngine (and Luke has already, in the week or so I've been using Puppet, fixed up two of them based on my suggestions). There's only one thing in CFEngine that I use that Puppet doesn't have, and that's editfiles. This is by design, apparently -- there is no consensus, even within the CFEngine diehards, that editfiles is a good thing, and Luke isn't really keen on implementing it (it's a big feature, and there's known better ways of solving most of the problems that editfiles solves anyway). I still feel that it's useful to use editfiles in some circumstances, but not having it certainly hasn't cramped my Puppet style excessively so far. Oh, Steve -- about Ruby being "un-perl" -- that's not a bug, it's a feature!

Next.

Previous.