Maintainer | Sean Whitton <spwhitton@spwhitton.name> |
---|---|
Safe Haskell | None |
Language | Haskell98 |
Build and maintain schroots for use with sbuild.
For convenience we set up several enhancements, such as ccache and eatmydata. This means we have to make several assumptions:
- you want to build for a Debian release strictly newer than squeeze, or for a Buntish release newer than or equal to trusty
- if you want to build for Debian stretch or newer, you have sbuild 0.70.0 or newer
The latter is due to the migration from GnuPG v1 to GnuPG v2.1 in Debian stretch, which older sbuild can't handle.
Suggested usage in config.hs
:
mybox = host "mybox.example.com" $ props & osDebian (Stable "stretch") X86_64 & Apt.useLocalCacher & sidSchrootBuilt & Sbuild.usableBy (User "spwhitton") & Schroot.overlaysInTmpfs where sidSchrootBuilt = Sbuild.built Sbuild.UseCcache $ props & osDebian Unstable X86_32 & Sbuild.update `period` Weekly (Just 1) & Sbuild.useHostProxy mybox
If you are using sbuild older than 0.70.0, you also need:
& Sbuild.keypairGenerated
To take advantage of the piuparts and autopkgtest support, add to your
~/.sbuildrc
(assumes sbuild 0.71.0 or newer):
$piuparts_opts = [ '--no-eatmydata', '--schroot', '%r-%a-sbuild', '--fail-if-inadequate', ]; $autopkgtest_root_args = ""; $autopkgtest_opts = ["--", "schroot", "%r-%a-sbuild"];
On Debian jessie hosts, you should ensure that sbuild and autopkgtest come from the same suite. This is because the autopkgtest binary changed its name between jessie and stretch. If you have not installed backports of sbuild or autopkgtest, you don't need to do anything. But if you have installed either package from jessie-backports (with Propellor or otherwise), you should install the other from jessie-backports, too.
- data UseCcache
- built :: UseCcache -> Props metatypes -> RevertableProperty (HasInfo + DebianLike) Linux
- update :: Property DebianLike
- useHostProxy :: Host -> Property DebianLike
- keypairGenerated :: Property DebianLike
- keypairInsecurelyGenerated :: Property DebianLike
- usableBy :: User -> Property DebianLike
- userConfig :: User -> Property DebianLike
Creating and updating sbuild schroots
Whether an sbuild schroot should use ccache during builds
ccache is generally useful but it breaks building some packages. This data types allows you to toggle it on and off for particular schroots.
built :: UseCcache -> Props metatypes -> RevertableProperty (HasInfo + DebianLike) Linux Source #
Build and configure a schroot for use with sbuild
The second parameter should specify, at a minimum, the operating system for
the schroot. This is usually done using a property like osDebian
Properties for use inside sbuild schroots
update :: Property DebianLike Source #
Ensure that an sbuild schroot's packages and apt indexes are updated
This replaces use of sbuild-update(1).
useHostProxy :: Host -> Property DebianLike Source #
Ensure that an sbuild schroot uses the host's Apt proxy.
This property is standardly used when the host has useLocalCacher
.
Global sbuild configuration
keypairGenerated :: Property DebianLike Source #
Generate the apt keys needed by sbuild
You only need this if you are using sbuild older than 0.70.0.
keypairInsecurelyGenerated :: Property DebianLike Source #
Generate the apt keys needed by sbuild using a low-quality source of randomness
Note that any running rngd will be killed; if you are using rngd, you should arrange for it to be restarted after this property has been ensured. E.g.
& Sbuild.keypairInsecurelyGenerated `onChange` Systemd.started "my-rngd-service"
Useful on throwaway build VMs.
You only need this if you are using sbuild older than 0.70.0.
usableBy :: User -> Property DebianLike Source #
Add an user to the sbuild group in order to use sbuild
userConfig :: User -> Property DebianLike Source #
Maintain recommended ~/.sbuildrc for a user, and adds them to the sbuild group
You probably want a custom ~/.sbuildrc on your workstation, but this property is handy for quickly setting up build boxes.
On Debian jessie hosts, you should ensure that sbuild and autopkgtest come from the same suite. This is because the autopkgtest binary changed its name between jessie and stretch. If you have not installed backports of sbuild or autopkgtest, you don't need to do anything. But if you have installed either package from jessie-backports (with Propellor or otherwise), you should install the other from jessie-backports, too.