summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs20
-rw-r--r--src/Propellor/Types/OS.hs13
2 files changed, 18 insertions, 15 deletions
diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs
index bd596298..d1771dde 100644
--- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs
+++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs
@@ -25,14 +25,16 @@ builddir = gitbuilderdir </> "build"
type TimeOut = String -- eg, 5h
-autobuilder :: Architecture -> Times -> TimeOut -> Property (HasInfo + DebianLike)
+type ArchString = String
+
+autobuilder :: ArchString -> Times -> TimeOut -> Property (HasInfo + DebianLike)
autobuilder arch crontimes timeout = combineProperties "gitannexbuilder" $ props
& Apt.serviceInstalledRunning "cron"
& Cron.niceJob "gitannexbuilder" crontimes (User builduser) gitbuilderdir
("git pull ; timeout " ++ timeout ++ " ./autobuild")
& rsyncpassword
where
- context = Context ("gitannexbuilder " ++ architectureToDebianArchString arch)
+ context = Context ("gitannexbuilder " ++ arch)
pwfile = homedir </> "rsyncpassword"
-- The builduser account does not have a password set,
-- instead use the password privdata to hold the rsync server
@@ -47,7 +49,7 @@ autobuilder arch crontimes timeout = combineProperties "gitannexbuilder" $ props
then makeChange $ writeFile pwfile want
else noChange
-tree :: Architecture -> Flavor -> Property DebianLike
+tree :: ArchString -> Flavor -> Property DebianLike
tree buildarch flavor = combineProperties "gitannexbuilder tree" $ props
& Apt.installed ["git"]
& File.dirExists gitbuilderdir
@@ -59,7 +61,7 @@ tree buildarch flavor = combineProperties "gitannexbuilder tree" $ props
userScriptProperty (User builduser)
[ "git clone git://git.kitenet.net/gitannexbuilder " ++ gitbuilderdir
, "cd " ++ gitbuilderdir
- , "git checkout " ++ architectureToDebianArchString buildarch ++ fromMaybe "" flavor
+ , "git checkout " ++ buildarch ++ fromMaybe "" flavor
]
`assume` MadeChange
`describe` "gitbuilder setup"
@@ -107,7 +109,7 @@ autoBuilderContainer :: (DebianSuite -> Architecture -> Flavor -> Property (HasI
autoBuilderContainer mkprop suite arch flavor crontime timeout =
Systemd.container name $ \d -> Chroot.debootstrapped mempty d $ props
& mkprop suite arch flavor
- & autobuilder arch crontime timeout
+ & autobuilder (architectureToDebianArchString arch) crontime timeout
where
name = architectureToDebianArchString arch ++ fromMaybe "" flavor ++ "-git-annex-builder"
@@ -122,7 +124,7 @@ standardAutoBuilder suite arch flavor =
& Apt.unattendedUpgrades
& Apt.cacheCleaned
& User.accountFor (User builduser)
- & tree arch flavor
+ & tree (architectureToDebianArchString arch) flavor
stackAutoBuilder :: DebianSuite -> Architecture -> Flavor -> Property (HasInfo + Debian)
stackAutoBuilder suite arch flavor =
@@ -133,7 +135,7 @@ stackAutoBuilder suite arch flavor =
& Apt.unattendedUpgrades
& Apt.cacheCleaned
& User.accountFor (User builduser)
- & tree arch flavor
+ & tree (architectureToDebianArchString arch) flavor
& stackInstalled
-- Workaround https://github.com/commercialhaskell/stack/issues/2093
& Apt.installed ["libtinfo-dev"]
@@ -177,7 +179,7 @@ armAutoBuilder suite arch flavor =
androidAutoBuilderContainer :: Times -> TimeOut -> Systemd.Container
androidAutoBuilderContainer crontimes timeout =
androidAutoBuilderContainer' "android-git-annex-builder"
- (tree ANDROID Nothing) builddir crontimes timeout
+ (tree "android" Nothing) builddir crontimes timeout
-- Android is cross-built in a Debian i386 container, using the Android NDK.
androidAutoBuilderContainer'
@@ -199,7 +201,7 @@ androidAutoBuilderContainer' name setupgitannexdir gitannexdir crontimes timeout
& haskellPkgsInstalled "android"
& Apt.unattendedUpgrades
& buildDepsNoHaskellLibs
- & autobuilder ANDROID crontimes timeout
+ & autobuilder "android" crontimes timeout
where
-- Use git-annex's android chroot setup script, which will install
-- ghc-android and the NDK, all build deps, etc, in the home
diff --git a/src/Propellor/Types/OS.hs b/src/Propellor/Types/OS.hs
index 9e7a412a..9cca56fe 100644
--- a/src/Propellor/Types/OS.hs
+++ b/src/Propellor/Types/OS.hs
@@ -76,12 +76,14 @@ isStable (Stable _) = True
isStable _ = False
type Release = String
+
+-- | Many of these architecture names are based on the names used by
+-- Debian, with a few exceptions for clarity.
data Architecture
- = X86_64
- | X86_32
+ = X86_64 -- ^ 64 bit Intel, called "amd64" in Debian
+ | X86_32 -- ^ 32 bit Intel, called "i386" in Debian
| ARMHF
| ARMEL
- | ANDROID
| PPC
| PPC64
| SPARC
@@ -90,16 +92,15 @@ data Architecture
| MIPSEL
| MIPS64EL
| SH4
- | IA64
+ | IA64 -- ^ Itanium
| S390
| S390X
| ALPHA
| HPPA
| M68K
| ARM64
- | X32
+ | X32 -- ^ New Linux ABI for 64 bit CPUs using 32-bit integers. Not widely used.
deriving (Show, Eq)
--- TODO: remove ANDROID (used in GitAnnexBuilder)
architectureToDebianArchString :: Architecture -> String
architectureToDebianArchString X86_64 = "amd64"