The failing code is at gexp.scm:901:23, which corresponds to this:
(mlet %store-monad ((obj (lower-object thing system
(derivation-input drv (list output)))
;; Some inputs such as <system-binding> can lower to
;; a self-quoting object that FILTERM will filter
That means (lower-object polkit) returned polkit (the package object)
instead of a derivation, hence ‘match-error’.
This is normally impossible: ‘lower-object’ calls ‘package->derivation’,
which returns a derivation. But maybe something weird is happening when
‘build-derivations’ aborts to the build-handler prompt, or when the
continuation is eventually resumed; maybe the object cache gets
“poisoned” with an incorrect value during that process.
So far the only reproducer we have seems to be along the lines of: grab
the ISO, run ‘guix pull’ (if it’s the 1.3.0 ISO; if it’s a fresh ISO,
that’s not necessary), run ‘guix system init’, watch it crash.
Does anyone have a simpler reproducer?