Week 15: Onion ordering
The week started badly: I had for a long while now a dead 'e' key on my keyboard, but I didn't care that much… I just remapped CAPSLOCK, retrained my fingers and be done with it [I have some fucked up typing style anyhow]. All good, but at this week additional keys started to give up. You have no idea how annoying it is to not be able use the arrow keys. Many things I work with have at least the vim-keybindings, but even in vim picking an autocompletion becomes a nightmare (or navigating shell history)… So, replacement keyboard please! That took a while, especially replacing it as my laptop makes that extra hard it seems but oh well. All working again now! The c-key is actually working a bit too good (you have to only touch it now, which had me worried as it started out with producing and endless stream of 'c' out-of-the-box before I removed the cap once) but so be it for now.
As you might guess that wasn't the ideal work-environment and slowed me down (beside being annoying), so what I intended to do as a sideproject turned out to be covering most of the week. Mergeback of apt-transport-tor into apt? Yes, no, maybe? The first few responses by mail & IRC are in regards to the plan, but that still had the need for a lots of code to be written and refactored. I have to say, implementing SOCKS5 proxy support in apt was kinda fun and not nearly as hard as I had imagined. Slightly harder it was to get a setup working in which I could test it properly. Everyone knows netcat, but that really targets more text-based protocols, not binary ones like SOCKS5. Still, I managed to figure out how to do it with socat eventually, resulting in a testscript we can at least run manually (as it requires a specific port. Not every tool is as nice as our webserver which can be started on port 0 and reports the port it eventually picked for real). Playful as I am I even compared my implementation to others like curl, which our https method is using, where I ended up reporting minor bugs.
But why and why now you might ask: apt-transport-tor can be (surprise surprise) used to let apt talk to Tor network. Conceptionally that isn't incredibly hard: The Tor software provides a SOCKS5 proxy an application can connect to be done. Two years ago then apt-transport-tor was introduced only our curl-backed https method could do that & the intention was be able to make backports of that transport available, too, so even through I wasn't all that happy about it, we ended up with a modified copy of our https method named tor in the archive and as it is with most modified copies of code, they aren't really kept in sync with the original. I really want to get this resolved for stretch, so it slowly gets hightime to start this as if it turns out that I need to take over maintenance for it without previous-maintainer consent there is quiet a bit of waiting involved stuff like this should really not be changed last-minute before the freeze… you will find more details in the mentioned mail on the reasons for proposing this solution in the mail.
Beside, SOCKS support is actually a so much requested feature that the internet actually believes apt would support it already via Acquire::socks::proxy … which is and will also be in future wrong as there is no socks method we would configure a proxy for – if at all you configure a method like http to use a socks proxy…
Of course, bundled with this comes a bunch of other things like better redirection handling across methods and stuff, but that isn't really user visible, so I skip it here and instead refer you to the git branches if you are really interested. A few things I will surely also mention then the relevant code is in the archive so that interested peers can test…
On my actual battle front, the ordering progress was insignificant. I got lots of manual testing and review done, but not much new stuff. The problem is mostly that ordering is easy as long as the problem is easy, but as soon as Pre-Depends are entering the picture you suddenly have to account for all kinds of strange things like temporal removals, loops conflicting or-groups, … stuff you don't want to loose hair over while losing hair over your broken keyboard already. 😉
This week for realz, although target is now really more to merge the current stuff for apt 1.3. A new ordering algorithm is as detailed in the initial proposal buster material anyhow – and given all the changes in terms of trigger delaying and pending calls you are likely not to recognize our "old" ordering anymore, but more on this in the next two weeks as that will be the end of GSoC and hence I am going to look back at "the good old times" before GSoC compared to what we have now. 🙂
P.S.: This weeks weekend marks the start of a big wine festival in our state capital my family is one of the founding members of. I am "just" going to help building the booth through, so no giant timesink this time – just a couple hours – just in case you hear me saying something about wine again on IRC.