Russ Allbery: Review: Why We Sleep
| Publisher: | Scribner |
| Copyright: | October 2017 |
| ISBN: | 1-5011-4433-2 |
| Format: | Kindle |
| Pages: | 341 |
| Publisher: | Scribner |
| Copyright: | October 2017 |
| ISBN: | 1-5011-4433-2 |
| Format: | Kindle |
| Pages: | 341 |
For many years now, I have been driving a diesel based VW Passat Estate. It
has served me very well and been as reliable as I might have hoped given how
awful I am with cars. Sadly Gunther was reaching the point where it was
going to cost more per year to maintain than the car was worth, and also I've
been being more and more irked by not having a car from the future.
I spent many months doing spreadsheets, trying to convince myself I could
somehow afford a Tesla of some variety. Sadly I never quite managed it. As
such I set my sights on the more viable BEVs such as the Nissan Leaf. For a
while, nothing I saw was something I wanted. I am quite unusual it seems, in
that I don't want a car which is a "Look at me, I'm driving an electric car"
fashion statement. I felt like I'd never get something which looked like a
normal car, but happened to be a BEV.
Then along came the Hyundai Ioniq. Hybrid, Plug-in Hybrid, and BEV all looking
basically the same, and not in-your-face-special. I began to covet.
Eventually I caved and arranged a test drive of an Ioniq plug-in hybrid because
the BEV was basically on 9 month lead. I enjoyed the drive and was instantly
very sad because I didn't want a plug-in hybrid, I wanted a BEV. Despondent,
I left the dealership and went home.
I went online and found a small number of second-hand Ioniq BEVs but as I
scrolled through the list, none seemed to be of the right trim level. Then,
just as I was ready to give up hope, I saw a new listing, no photo, of the
right thing. One snag, it was 200 miles away. No matter, I rang the place,
confirmed it was available, and agreed to sleep on the decision.
The following morning, I hadn't decided to not buy, so I called them up, put
down a deposit to hold the car until I could test drive it, and then began the
long and awkward process of working out how I would charge the car given I have
no off-street parking so I can't charge at home. (Yeah yeah, you'd think I'd
have checked that first, but no I'm just not that sensible). Over the week
I convinced myself I could do it, I ordered RFID cards for various schemes,
signed up with a number of services, and then, on Friday last week, I drove
down to a hotel near the dealership and had a fitful night's sleep.
I rocked up to the dealership exactly as they opened for business, shook the
hand of the very helpful salesman who had gone through the purchase process
with me over the phone during the week, and got to see the car. Instant want
coursed through me as I sat in it and decided "Yes, this somehow feels right".
I took the car for about a 45 minute test drive just to see how it felt
relative to the plug-in hybrid I'd driven the week before and it was like night
and day. The BEV felt so much better to drive. I was hooked. Back to the
dealership and we began the paperwork. Emptying Gunther of all of the bits
and bobs scattered throughout his nooks and crannies took a while and gave me a
chance to say goodbye to a car which, on reflection, had actually been a
pleasure to own, even when its expensive things went wrong, more than once.
But once I'd closed the Passat for the last time, and handed the keys over, it
was quite a bittersweet moment as the salesman drove off in what still felt
like my car, despite (by this point) it not being so.
Sitting in the Ioniq though, I headed off for the 200 mile journey back home.
With about 90% charge left after the test drive, I had two stops planned at
rapid chargers and I headed toward my first.
Unfortunately disaster struck, the rapid (50KW) charger refused to initialise,
and I ended up with my car on the slower (7KW) charger to get enough juice into
it to drive on to the next rapid charger enabled service station. When I got
the message that my maximum charge period (45m) had elapsed, I headed back to
the car to discover I couldn't persuade it to unlock from the car. Much hassle
later, and an AA man came and together we learned that it takes 2 to tango, one
to pull the emergency release in the boot, the other to then unplug the cable.
Armed with this knowledge, I headed on my way to a rapid charger I'd found on
the map which wasn't run by the same company. Vainly hoping that this would
work better, I plugged the car in, set the charger going, and headed into the
adjacent shop for a rest break. I went back to the car about 20 minutes later
to see the charger wasn't running. Horror of horrors. I imagined maybe some
nasty little oik had pressed 'stop' so I started the charger up again, and sat
in the car to read my book. After about 3 minutes, the charge stopped. Turns
out that charger was slightly iffy and couldn't cope with the charge current
and kept emergency-stopping as a result. The lovely lady I spoke to about it
directed me to a nearby (12 miles or so, easily done with the charge I had)
charger in the grounds of a gorgeous chateau hotel. That one worked perfectly
and I filled up. I drove on to my second planned stop and that charge went
perfectly too. In fact, every charge since has gone flawlessly. So perhaps my
baptism of failed charges has hardened me to the problems with owning a BEV.
I've spent the past few days trying different charge points around Manchester
enjoying my free charge capability, and trying different names for the car
before I finally settled on which is a reasonable Korean boy's name
(since the car is Korean I even got to set that as the bluetooth ID) and it's
roughly pronounced sock/gin which are two wonderful things in life.
I'm currently sat in a pub, eating a burger, enjoying myself while suckles
on the teat of "free" electricity to make up for the fact that I've developed a
non-trivial habit of leaving Audi drivers in the dust at traffic lights.
Further updates may happen as I play with Android Auto and other toys in an
attempt to eventually be able to ask the car to please "freeze my buttocks"
(a feature it has in the form of air-conditioned seats.)
Today it s my first day working at the Wikimedia Foundation, the
non-profit foundation behind well-known projects like Wikipedia and others.
This is a full-time, remote job as part of the
Wikimedia Cloud Services team, as Operations Engineer.
I will be working with modern infrastructure/hosting technologies such as
OpenStack and Kubernetes to provide support to the Wikimedia movement and
community. All contributors of the movement that provide value to the
Wikimedia movement are welcome to use our resources.
The recruitment process took several months and was really challenging, 6 or
7 interviews with different people with, of course, heavy technical checks.
The Wikimedia Foundation has been always in my radar due to 2 facts:
This post has it all. Flotillas of sailboats, peer-to-peer wikis, games,
and de-frogging. But, I need to start by talking about some tech you may not
have heard of yet...
True and a hash of the definition of what
True is can both be treated the same by Annah's compiler.True and False. Continue this until
I've built up enough Annah code to write some almost useful programs.
Annah can't do any IO on its own (though it can model IO similarly to how
Haskell does), so for programs to be actually useful, there needs to be
Scuttlebutt client support. The way typing works in Annah, a program's type
can be expressed as a Scuttlebutt link. So a Scuttlebutt client that wants
to run Annah programs of a particular type can pick out programs that link
to that type, and will know what type of data the program consumes and
produces.
Here are a few ideas of what could be built, with fairly simple client-side
support for different types of Annah programs...
Dashboard, and display its output like a Scuttlebutt
message, in a dashboard window. The dashboard message gets updated
whenever other Scuttlebutt messages come in. The Annah program picks out
the messages it's interested in, and generates the dashboard message.
So, send a message updating your boat's position, and everyone sees it
update on the map. Send a message with updated weather forecasts as
they're received, and everyone can see the storm developing.
Send another message updating a waypoint to avoid the storm,
and steady as you go...
The coders, meanwhile, probably tweak their dashboard's code every day.
As they add git-ssb repos, they make the dashboard display an
overview of their bugs. They get CI systems hooked in and feeding
messages to Scuttlebutt, and make the dashboard go green or red. They
make the dashboard A-B test itself to pick the right shade of red.
And so on...
The dashboard program is stored in Scuttlebutt so everyone is on the same
page, and the most recent version of it posted by a team member gets
used. (Just have the old version of the program notice when there's a
newer version, and run that one..)
(Also could be used in disaster response scenarios, where the data
and visualization tools get built up on the fly in response to local needs,
and are shared peer-to-peer in areas without internet.)Filtered Message. It can leave a message unchanged, or filter it out,
or perhaps minimize its display. I publish the Annah program on my feed,
and tell my Scuttlebutt client to filter all messages through it before
displaying them to me.
I published the program in my Scuttlebutt feed, and so my friends
can use it too. They can build other filtering functions for other
stuff (such an an excess of orange in photos), and integrate my
frog filter into their filter program by simply composing the two.
If I like their filter, I can switch my client to using it. Or not.
Filtering is thus subjective, like Scuttlebutt, and the subjectivity is
expressed by picking the filter you want to use, or developing a
better one.Edit which gets posted to the user's feed. Rendering the
page is just a matter of finding the Edit messages for it from
people who are allowed to edit it, and combining them.
Anyone can fork a wiki page by posting an Edit to their feed. And can
then post a smart link to their fork of the page.
And anyone can merge other forks into their wiki page (this posts a
control message that makes the Annah program implementing the wiki accept
those forks' Edit messages). Or grant other users permission to edit
the wiki page (another control message). Or grant other users
permissions to grant other users permissions.
There are lots of different ways you might want your wiki to work.
No one wiki implementation, but lots of Annah programs. Others
can interact with your wiki using the program you picked, or fork it and
even switch the program used. Subjectivity again.Game,
and generates a tab with a list of available games.
The players of a particular game all experience the same game interface,
because the code for it is part of their shared Scuttlebutt message pool,
and the code to use gets agreed on at the start of a game.
To play a game, the Scuttlebutt client runs the Annah program, which
generates a description of the current contents of the game board.
So, for chess, use Annah to define a ChessMove data type,
and the Annah program takes the feeds of the two players, looks
for messages containing a ChessMove, and builds up a description
of the chess board.
As well as the pieces on the game board, the game board description
includes Annah functions that get called when the user moves a
game piece. That generates a new ChessMove which gets recorded
in the user's Scuttlebutt feed.
This could support a wide variety of board games. If you don't mind the
possibility that your opponent might cheat by peeking at the random seed,
even games involving things like random card shuffles and dice rolls
could be built. Also there can be games like Core Wars where the gamers
themselves write Annah programs to run inside the game.
Variants of games can be developed by modifying and reusing game
programs. For example, timed chess is just the chess program
with an added check on move time, and time clock display.
It has been ages that I haven t updated the MegaUpdate package for Kobo. Now that a new and seemingly rather bug-free and quick firmware release (4.6.9995) has been released, I finally took the time to update the whole package to the latest releases of all the included items. The update includes all my favorite patches and features: Kobo Start Menu, koreader, coolreader, pbchess, ssh access, custom dictionaries, and some side-loaded fonts.
So what are all these items:
Custom left & right margins
Fix three KePub fullScreenReading bugs
Change dicthtml strings to micthtml
Default ePub monospace font (Courier)
Custom reading footer style
Dictionary pop-up frame size increase
Increase The Cover Size In Library
Increasing The View Details Container
New home screen increasing cover size
Reading stats/Author name cut when the series is showing bug fix
New home screen subtitle custom font
Custom font to Collection and Authors names
If you need/want different patches, you need to do the patching yourself.
IP Address: 192.168.1.NNtelnet 192.168.1.NNroot::0:0:root:/root:/bin/sh[root@(none) ~]# mkdir /etc/dropbear
[root@(none) ~]# cd /etc/dropbear
[root@(none) ~]# dropbearkey -t dss -f dropbear_dss_host_key
[root@(none) ~]# dropbearkey -t rsa -f dropbear_rsa_host_keyssh root@192.168.1.NN[root@(none) ~]# exit[root@(none) ~]# passwd
Debian has generally always had, as a rule, sane
defaults and no surprises . This was completely shattered for me when
Vim decided to hijack the mouse from my terminal and
break all copy/paste functionality. This has occured since the release of
Debian 9.
I expect for my terminal to behave consistently, and this is broken every time
I log in to a Debian 9 system where I have not configured Vim to disable this
functionality. I also see I m not alone in this frustration.
To fix this, in your .vimrc:
if !has("gui_running")
set mouse=
endif
(This will check to see if your using GVim or similar, where it would be
reasonable to expect the mouse to work.)
This is perhaps not aggresive enough though. I never want to have console
applications trying to use the mouse. I ve configured rxvt to do things like
open URLs in Firefox, etc. that I always want to work, and I always want my
local clipboard to be used so I can copy/paste between remote machines.
I ve found a small
patch that
would appear to disable mouse reporting for rxvt, but unfortunately I cannot do
this through an Xresources option. If someone is looking for something to do
for Hacktoberfest, I d love to see
this be an option for rxvt without re-compiling:
diff --git a/src/rxvt.h b/src/rxvt.h
index 5c7cf66..2751ba3 100644
--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -646,7 +646,7 @@ enum
#define PrivMode_ExtMouseRight (1UL<<24) // xterm pseudo-utf-8, but works in non-utf-8-locales
#define PrivMode_BlinkingCursor (1UL<<25)
-#define PrivMode_mouse_report (PrivMode_MouseX10 PrivMode_MouseX11 PrivMode_MouseBtnEvent PrivMode_MouseAnyEvent)
+#define PrivMode_mouse_report 0 /* (PrivMode_MouseX10 PrivMode_MouseX11 PrivMode_MouseBtnEvent PrivMode_MouseAnyEvent) */
#ifdef ALLOW_132_MODE
# define PrivMode_Default (PrivMode_Autowrap PrivMode_ShiftKeys PrivMode_VisibleCursor PrivMode_132OK)
strings struct member is always valid. This isn't, strictly
speaking, a correctness fix, since all the checks were correct, but after
some thought, I decided that humans might have the same problem that the
static analyzer had. It's a lot easier to reason about a field that's
never NULL. Similarly, the replacement function for a missing
reallocarray now does an allocation of size 1 if given a size of 0,
just to avoid edge case behavior. (I'm sure the behavior of a realloc
with size 0 is defined somewhere in the C standard, but if I have to look
it up, I'd rather not make a human reason about it.)
I started on, but didn't finish, making rra-c-util compile without Clang
warnings (at least for a chosen set of warnings). By far the hardest
problem here are the Clang warnings for comparisons between unsigned and
signed integers. In theory, I like this warning, since it's the cause of
a lot of very obscure bugs. In practice, gah does C ever do this all over
the place, and it's incredibly painful to avoid. (One of the biggest
offenders is write, which returns a ssize_t that you almost
always want to compare against a size_t.) I did a bunch of
mechanical work, but I now have a lot of bits of code like:
if (status < 0)
return;
written = (size_t) status;
if (written < avail)
buffer->left += written;
which is ugly and unsatisfying. And I also have a ton of casts, such as
with:
buffer_resize(buffer, (size_t) st.st_size + used);since
st.st_size is an off_t, which may be signed. This is
all deeply unsatisfying and ugly, and I think it makes the code moderately
harder to read, but I do think the warning will potentially catch bugs and
even security issues.
I'm still torn. Maybe I can find some nice macros or programming styles
to avoid the worst of this problem. It definitely requires more thought,
rather than just committing this huge mechanical change with lots of ugly
code.
Mostly, this kind of nonsense makes me want to stop working on C code and
go finish learning Rust....
Anyway, apart from work, the biggest thing I managed to do last month that
was vaguely related to free software was upgrading my personal servers to
stretch (finally). That mostly went okay; only a few things made it
unnecessarily exciting.
The first was that one of my systems had a very tiny / partition that was
too small to hold the downloaded debs for the upgrade, so I had to resize
it (VM disk, partition, and file system), and that was a bit exciting
because it has an old-style DOS partition table that isn't aligned (hmmm,
which is probably why disk I/O is so slow on those VMs), so I had to use
the obsolete fdisk -c=dos mode because I wasn't up for replacing
the partition right then.
The second was that my first try at an upgrade died with a segfault during
the libc6 postinst and then every executable segfaulted. A mild panic and
a rescue disk later (and thirty minutes and a lot of swearing), I tracked
the problem down to libc6-xen. Nothing in the dependency structure
between jessie and stretch forces libc6-xen to be upgraded in lockstep or
removed, but it's earlier in the search path. So ld.so gets upgraded, and
then finds the old libc6 from the libc6-xen package, and the mismatch
causes immediate segfaults. A chroot dpkg --purge from the rescue
disk solved the problem as soon as I knew what was going on, but that was
a stressful half-hour.
The third problem was something I should have known was going to be an
issue: an old Perl program that does some internal stuff for one of the
services I ran had a defined @array test that has been warning for
eons and that I never fixed. That became a full syntax error with the
most recent Perl, and then I fixed it incorrectly the first time and had a
bunch of trouble tracking down what I'd broken. All sorted out now, and
everything is happily running stretch. (ejabberd, which other folks had
mentioned was a problem, went completely smoothly, although I suspect I
now have too many of the plugin packages installed and should do a
purging.)
Here s my weekly report for week 41 of 2017. In this week I have explored some
Java 8
features, looked at automatic
updates in a few Linux distributions and decided that
actually I don t need swap anymore.
systemctl instead of service where appropriate (#23048
).
When a Tor relay is less than 2 years old, an alert will now appear on
Atlas to link to the new relay
lifecycle blog post (#23767
). This should hopefully help new relay operators understand why
their relay is not immediately fully loaded but instead it takes some time to
ramp up.
I have gone through the tickets for Tor Cloud
and did not find any tickets that contain any important information that would
be useful to someone reviving the project. I have closed out these tickets and
the Tor Cloud
component
no longer has any non-closed tickets (#7763, #8544, #8768, #9064, #9751, #10282, #10637, #11153, #11502, #13391, #14035, #14036, #14073, #15821
).
I ve continued to work on turning the Atlas application into an integrated part
of Tor Metrics (#23518
) and you can see some progress
here.
Finally, I ve continued hacking on a Twitter bot to tweet factoids about the public
Tor network and you can now enjoy some JavaDoc
documentation if you d like to
learn a little about its internals. I am still waiting for a git repository to
be created (#23799
) but will be publishing the sources shortly
after that ticket is actioned.
Using the Software-As-A-Service (SAAS) model, Slack basic version is free, and users pay for options. Slack is now considered by the Github generation like the new main enterprise communication tool.
As I did in my previous article on the Github threat, this one won t promote Slask s advantages, as many other articles have already covered all these points ad nauseam, but to show the other side and to warn the companies using this service about its inherent risks. So far, these risks have been ignored, sometimes voluntary in the name of the It works ideology. Neglecting all economic and safety consideration, neglecting all threat to privacy and individual freedom. We ll see about them below.

Github, a software forge as a SAAS, with all the advantage but also all the risk of its economic model

The search bar, well-known by Slack users

Edward Snowden, an individual and corporate freedom fighter

Yahoo, the company which suffered the largest recorded cyberattack regarding the compromised account numbers
Mattermost is another service which has the advantages of proximity and of compatibility with Slack. It offers numerous features including the main expected by this type of software. It also offers numerous apps and plug-ins to interact with online services, software forges, and continuous integration tools.
Watch out for future events in Prishtina, the pizzas are huge, but that didn't stop them disappearing before we finished the photos:
A while ago I played with a Twitter bot that
would track radio amateurs using
a packet radio position reporting system, tweet
their location and a picture from Flickr that was taken near to their location
and a link to their packet radio activity on aprs.fi. It s
really not that hard to put these things together and they can be a lot of fun.
The tweets looked like this:
This isn t about building a system that serves any critical purpose, it s about fun. As the radio stations were chosen essentially at random, there could be some cool things showing up that you wouldn t otherwise have seen. Maybe you d spot a callsign of a station you ve spoken to before on HF or perhaps you d see stations in areas near you or in cool places. On Friday evening I took a go at hacking together a bot for Tor relays. The idea being to have regular snippets of information from the Tor network and perhaps you ll spot something insightful or interesting. Not every tweet is going to be amazing, but it wasn t running for very long before I spotted a relay very close to its 10th birthday:VK4CVL is mobile near Chapel Hill, Australia http://t.co/2dqvuqjJxQ http://t.co/q88OhtcPTX #hamradio #hamr pic.twitter.com/5gBVw3ebvq HamLocator (@HamLocator) June 12, 2015
The relays are chosen at random, and tweet templates are chosen at random too. So far, tweets about individual relays can be about age or current bandwidth contribution to the Tor network. There are also tweets about how many relays run in a particular autonomous system (again, chosen at random) and tweets about the total number of relays currently running. The total relays tweets come with a map:esko in Finland started contributing bandwidth to the #Tor network 9 years and 51 weeks ago https://t.co/4K7aj9Jf6C Tor Atlas (@TorAtlas) October 7, 2017
The maps are produced using xplanet. The Earth will rotate to show the current side in daylight at the time the tweet is posted. Unfortunately, the bot currently cannot tweet as the account has been suspended. You should still be able to follow @TorAtlas though and tweets will begin appearing again once I ve resolved the suspension. I plan to rewrite the mess of cron-activated Python scripts into a coherent Python (maybe Java) application and publish the sources soon. There are also a number of new templates for tweets I d like to explore, including number of relays and bandwidth contributed per family and statistics on operating system diversity. Update (2017-10-08): The @TorAtlas account should now be unsuspended.There are currently 6638 #Tor relays running. https://t.co/uySyX7AlAH pic.twitter.com/BbgNGpoNtY Tor Atlas (@TorAtlas) October 7, 2017
At work, I help maintain a smartcard
middleware that is provided to
Belgian citizens who want to use their electronic ID card to, e.g., log
on to government websites. This middleware is a piece of software that
hooks into various browsers and adds a way to access the smartcard in
question, through whatever APIs the operating system and the browser in
question provide for that purpose. The details of how that is done
differ between each browser (and in the case of Google Chrome, for the
same browser between different operating systems); but for Firefox (and
Google Chrome on free operating systems), this is done by way of a
PKCS#11 module.
For Firefox 57, mozilla decided to overhaul much of their browser. The
changes are large and massive, and in some ways revolutionary. It's no
surprise, therefore, that some of the changes break compatibility with
older things.
One of the areas in which breaking changes were made is in the area of
extensions to the browser. Previously, Firefox had various APIs
available for extensions; right now, all APIs apart from the
WebExtensions API are considered "legacy" and support for them will be
removed from Firefox 57 going forward.
Since installing a PKCS#11 module manually is a bit complicated, and
since the legacy APIs provided a way to do so automatically provided the
user would first install an add-on (or provided the installer of the
PKCS#11 module sideloads it), most parties who provide a PKCS#11 module
for use with Firefox will provide an add-on to automatically install it.
Since the alternative involves entering the right values in a dialog box
that's hidden away somewhere deep in the preferences screen, the add-on
option is much more user friendly.
I'm sure you can imagine my dismay when I found out that there was no
WebExtensions API to provide the same functionality. So, after asking
around a bit, I filed bug
1357391 to get a
discussion started. While it took some convincing initially to get
people to understand the reasons for wanting such an API, eventually the
bug was assigned the "P5" priority -- essentially, a "we understand the
need and won't block it, but we don't have the time to implement it.
Patches welcome, though" statement.
Since having an add-on was something that work really wanted, and since
I had the time, I got the go-ahead from management to look into
implementing the required code myself. I made it obvious rather quickly
that my background in Firefox was fairly limited, though, and so was
assigned a mentor to help me through the process.
Having been a Debian Developer for the past fifteen years, I do
understand how to develop free software. Yet, the experience was
different enough that still learned some new things about free software
development, which was somewhat unexpected.
Unfortunately, the process took much longer than I had hoped, which
meant that the patch was not ready by the time Firefox 57 was branched
off mozilla's "central" repository. The result of that is that while my
patch has been merged into what will eventually become Firefox 58, it
looks strongly as though it won't make it into Firefox 57. That's going
to cause some severe headaches, which I'm not looking forward to; and
while I can certainly understand the reasons for not wanting to grant
the exception for the merge into 57, I can't help but feeling like this
is a missed opportunity.
Anyway, writing code for the massive Open Source project that mozilla is
has been a load of fun, and in the process I've learned a lot -- not
only about Open Source development in general, but also about this weird
little thing that Javascript is. That might actually be useful for this
other project that I've got running
here.
In closing, I'd like to thank Tomislav 'zombie' Jovanovic for mentoring
me during the whole process, without whom it would have been doubtful if
I would even have been ready by now. Apologies for any procedural
mistakes I've made, and good luck in your future endeavours!
87 to stretch-backports.
--env-build option for testing different env vars. (In-progress,
requires the python-rstr package awaiting entry into Debian.)--source-pattern option to restrict copying of source_root.--auto-build.dpkg-source extract to different build dir iff varying the
build-path.--debug to diffoscope if verbosity >= 2.--exclude-directory-metadata to diffoscope(1) by default.
Debian
devscripts
Before deciding to take an indefinite hiatus from devscripts, I prepared one more upload merging various contributed patches and a bit of last minute cleanup.
Build-Arch- Conflicts,Depends to build-rdeps. (adc87981)remote.<name>.push-url when using debcheckout to clone a git repository. (Debian bug #753838)gpg --with-colons, instead of manually parsing gpg -K output.
Aside from being the Right Way to get machine parseable information out of gpg, it fixed completion when gpg is a 2.x version. (Debian bug #837380)DEB_BUILD_PROFILES and using a separate, minimal docker image for running autopkgtests.
unibilium
A few short weeks after the more substantial 0.0.9 release of RcppAnnoy, we have a quick bug-fix update.
RcppAnnoy is our Rcpp-based R integration of the nifty Annoy library by Erik. Annoy is a small and lightweight C++ template header library for very fast approximate nearest neighbours.
Micha l Benesty noticed that our getItemsVector() function didn't, ahem, do much besides crashing. Simple bug, they happen--now fixed, and a unit test added.
Changes in this version are summarized here:
Courtesy of CRANberries, there is also a diffstat report for this release.Changes in version 0.0.10 (2017-09-25)
- The
getItemsVector()function no longer crashes (#24)
This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.
I fixed a bug in Launchpad recently that led me deeper than I expected.
Launchpad uses Buildout as its build system for
Python packages, and it s served us well for many years. However, we re
using 1.7.1, which doesn t support ensuring that packages required using
setuptools setup_requires
keyword
only ever come from the local index URL when one is specified; that s an
essential constraint we need to be able to impose so that our build system
isn t immediately sensitive to downtime or changes in PyPI. There are
various issues/PRs about this in Buildout (e.g.
#238), but even if those
are fixed it ll almost certainly only be in Buildout v2, and upgrading to
that is its own kettle of fish for other reasons. All this is a serious
problem for us because newer versions of many of our vital dependencies
(Twisted and
testtools, to name but two) use
setup_requires to pull in pbr, and so
we ve been stuck on old versions for some time; this is part of why
Launchpad doesn t yet support newer SSH key types, for instance. This
situation obviously isn t sustainable.
To deal with this, I ve been working for some time on switching to
virtualenv and
pip. This is harder than you might think:
Launchpad is a long-lived and complicated project, and it had quite a number
of explicit and implicit dependencies on Buildout s configuration and
behaviour. Upgrading our infrastructure from Ubuntu 12.04 to 16.04 has
helped a lot (12.04 s baseline virtualenv and pip have some deficiencies
that would have required a more complicated bootstrapping procedure). I ve
dealt with most of these: for example, I had to reorganise a lot of our
helper scripts
(1,
2,
3),
but there are still a few more things to go.
One remaining problem was that our Buildout configuration relied on building
several different environments with different Python paths for various
things. While this would technically be possible by way of building
multiple virtualenvs, this would inflate our build time even further (we re
already going to have to cope with some slowdown as a result of using
virtualenv, because the build system now has to do a lot more than
constructing a glorified link farm to a bunch of cached eggs), and it seems
like unnecessary complexity. The obvious thing to do seemed to be to
collapse these into a single environment, since there was no obvious reason
why it should actually matter if
txpkgupload and
txlongpoll were carefully kept
off the path when running most of Launchpad: so I did
that.
Then our build system got very
sad.
Hmm, I thought. To keep our test times somewhat manageable, we run them in
parallel across 20 containers, and we randomise the order in which they run
to try to shake out test isolation bugs. It s not completely unknown for
there to be some oddities resulting from that. So I ran it again. Nope,
but slightly differently sad this
time.
Furthermore, I couldn t reproduce these failures locally no matter how hard
I tried. Oh dear. This was obviously not going to be a good day.
In fact I spent a while on various different guesswork-based approaches. I
found bug 571334 in
Ampoule, an AMP-based process pool implementation that we use for some job
runners, and proposed a
fix
for that, but cherry-picking that fix into Launchpad didn t help matters. I
tried backing out subsets of my changes and determined that if both
txlongpoll and txpkgupload were absent from the Python module path in
the context of the tests in question then everything was fine. I tried
running strace locally and staring at the output for some time in the hope
of enlightenment: that reminded me that the two packages in question install
modules under twisted.plugins, which did at least establish a reason they
might affect the environment that was more plausible than magic, but nothing
much more specific than that.
On Friday I was fiddling about with this again and trying to insert some
more debugging when I noticed some interesting behaviour around plugin
caching.
If I caused the txpkgupload plugin to raise an exception when loaded, the
Twisted plugin system would remove its dropin.cache (because it was stale)
and not create a new one (because there was now no content to put in it).
After that, running the relevant tests would fail as I d seen in our
buildbot. Aha! This meant that I could also reproduce it by doing an even
cleaner build than I d previously tried to do, by removing the cached
txpkgupload and txlongpoll eggs and allowing the build system to
recreate them. When they were recreated, they didn t contain
dropin.cache, instead allowing that to be created on first use.
Based on this clue I was able to get to the answer relatively quickly.
Ampoule has a specialised bootstrapping sequence for its worker processes
that starts by doing this:
from twisted.application import reactors
reactors.installReactor(reactor)
twisted.application.reactors.installReactor calls
twisted.plugin.getPlugins, so the very start of this bootstrapping
sequence is going to involve loading all plugins found on the module path (I
assume it s possible to write a plugin that adds an alternative reactor
implementation). If dropin.cache is up to date, then it will just get the
information it needs from that; but if it isn t, it will go ahead and import
the plugin. If the plugin happens (as Twisted code often does) to run from
twisted.internet import reactor at some point while being imported, then
that will install the platform s default reactor, and then
twisted.application.reactors.installReactor will raise
ReactorAlreadyInstalledError. Since Ampoule turns this into an info-level
log message for some reason, and the tests in question only passed through
error-level messages or higher, this meant that all we could see was that a
worker process had exited non-zero but not why.
The Twisted documentation
recommends
generating the plugin cache at build time for other reasons, but we weren t
doing that. Fixing
that
makes everything work again.
There are still a few more things needed to get us onto pip, but we re now
pretty close. After that we can finally start bringing our dependencies up
to date.
make release with SOURCE_DATE_EPOCH patch)comparators/*:
presenters.html:
difference.py:
armhf build node that had been disabled due to
performance issues, but works linux 4.14-rc1 now! #876212__init__.py and remove obsolete earlier code.--variations flag to support parameters to
certain variations like user_group, and document examples in README.--vary flag for the new syntax and deprecate --dont-vary.--extra-build flag.artifact_pattern to avoid arbitrary shell execution.Next.