From 4f84aa8c3d06c995a1be9f2bdfac25d804e9255d Mon Sep 17 00:00:00 2001 From: serge1cohen Date: Thu, 31 Oct 2019 22:56:56 +0000 Subject: Added a comment: Using noServices to configure apache before running it... --- ...ent_2_b819efe3a4f00f1b9993d5a31e65f2e9._comment | 99 ++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 doc/forum/installing_apt_packages_without_running_new_services/comment_2_b819efe3a4f00f1b9993d5a31e65f2e9._comment diff --git a/doc/forum/installing_apt_packages_without_running_new_services/comment_2_b819efe3a4f00f1b9993d5a31e65f2e9._comment b/doc/forum/installing_apt_packages_without_running_new_services/comment_2_b819efe3a4f00f1b9993d5a31e65f2e9._comment new file mode 100644 index 00000000..467e55cf --- /dev/null +++ b/doc/forum/installing_apt_packages_without_running_new_services/comment_2_b819efe3a4f00f1b9993d5a31e65f2e9._comment @@ -0,0 +1,99 @@ +[[!comment format=mdwn + username="serge1cohen" + avatar="http://cdn.libravatar.org/avatar/df873622c2eeb5b34222b7af0d47abd0" + subject="Using noServices to configure apache before running it..." + date="2019-10-31T22:56:56Z" + content=""" +Hello there, + +I was typically in this situation : starting an apache server on a specific IP (the other IPs of the machine -on port 80- are used by other server processes), in particular to be able to get a certificate from let's encrypt. + +When using : + + micro_apache :: Domain -> String -> FilePath -> Property DebianLike + micro_apache fqdn ip dr = combineProperties \"Setting a micro apache server running only for interface\" $ props + & Apache.installed + & File.hasContent \"/etc/apache2/ports.conf\" [(\"Listen \" ++ ip ++ \":80\")] + & Apache.siteDisabled \"000-default\" + & Apache.siteEnabled fqdn + [ \"\" + , \"ServerName \" ++ fqdn ++ \":80\" + , \"DocumentRoot \" ++ dr + , \"ErrorLog /var/log/apache2/\" ++ fqdn ++ \"_error.log\" + , \"LogLevel warn\" + , \"CustomLog /var/log/apache2/\" ++ fqdn ++ \"_access.log combined\" + , \"ServerSignature On\" + , \"\" + ] + & Apache.restarted + & Apache.reloaded + +The property is problematic (the initial 'Apache.installed' starts the apache server listening to ALL IPs). +But at least at the end it seems that I get a 'running' service : + + root@d4:~# systemctl status apache2.service + ● apache2.service - The Apache HTTP Server + Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) + Active: active (running) since Thu 2019-10-31 16:59:41 CET; 17min ago + + + +To avoid the transient service wrongly configured (it also messes up with the server serving port 80 on another IP) case I tried : + + micro_apache :: Domain -> String -> FilePath -> Property (HasInfo + DebianLike) + micro_apache fqdn ip dr = combineProperties \"Setting a micro apache server running only for interface\" $ props + & ( Apache.installed `requires` Service.noServices ) -- => Needs to change type to Property (HasInfo + DebianLike) + & File.hasContent \"/etc/apache2/ports.conf\" [(\"Listen \" ++ ip ++ \":80\")] + & Apache.siteDisabled \"000-default\" + & Apache.siteEnabled fqdn + [ \"\" + , \"ServerName \" ++ fqdn ++ \":80\" + , \"DocumentRoot \" ++ dr + , \"ErrorLog /var/log/apache2/\" ++ fqdn ++ \"_error.log\" + , \"LogLevel warn\" + , \"CustomLog /var/log/apache2/\" ++ fqdn ++ \"_access.log combined\" + , \"ServerSignature On\" + , \"\" + ] + & ( revert Service.noServices `before` Apache.restarted ) -- => Needs to change type to Property (HasInfo + DebianLike) + +But then the configuration leads to having apache in an \"ghost state\", neither started nor stopped : + + root@d4:~# systemctl status apache2 + ● apache2.service - The Apache HTTP Server + Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) + Active: inactive (dead) + Docs: https://httpd.apache.org/docs/2.4/ + +Which leads to an unavailable http service, and as a consequence to a failure in ACME / let's encrypt. +Indeed it seems that the service is started using the 'old' Service system. The nice thing is that this makes it possible to use the 'noServices' property. The problem is that the systemd module is in a state not working anymore with 'Service'. + +Finally I had to mix the 'noServices' property with a couple of 'Systemd' properties so that the server is properly restarted once the configuration is correct. This leads to a bit longer property but at least it works : + + micro_apache :: Domain -> String -> FilePath -> Property (HasInfo + DebianLike) + micro_apache fqdn ip dr = combineProperties \"Setting a micro apache server running only for interface\" $ props + & ( Apache.installed `requires` Service.noServices ) -- => Needs to change type to Property (HasInfo + DebianLike) + & Systemd.stopped \"apache2\" -- 'clean' of the systemd module + & File.hasContent \"/etc/apache2/ports.conf\" [(\"Listen \" ++ ip ++ \":80\")] + & Apache.siteDisabled \"000-default\" + & Apache.siteEnabled fqdn + [ \"\" + , \"ServerName \" ++ fqdn ++ \":80\" + , \"DocumentRoot \" ++ dr + , \"ErrorLog /var/log/apache2/\" ++ fqdn ++ \"_error.log\" + , \"LogLevel warn\" + , \"CustomLog /var/log/apache2/\" ++ fqdn ++ \"_access.log combined\" + , \"ServerSignature On\" + , \"\" + ] + & ( revert Service.noServices -- => Needs to change type to Property (HasInfo + DebianLike) + `before` Systemd.running \"apache2\" ) -- restarting through systemd + +With this done, it seems to work. + +Notice, however, that if apache was completely avoiding the 'old service' system, then we could not even benefit from the 'noService' in the first place. Would there be another solution to reach the same result ? + +Hope this might help + +Serge. +"""]] -- cgit v1.2.3 From 363b626d71402d22c4f5247392a8b96d2e808747 Mon Sep 17 00:00:00 2001 From: serge1cohen Date: Fri, 1 Nov 2019 15:34:27 +0000 Subject: --- doc/forum/Conceptual_:_HostName_vs._Domain.mdwn | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 doc/forum/Conceptual_:_HostName_vs._Domain.mdwn diff --git a/doc/forum/Conceptual_:_HostName_vs._Domain.mdwn b/doc/forum/Conceptual_:_HostName_vs._Domain.mdwn new file mode 100644 index 00000000..334c9d82 --- /dev/null +++ b/doc/forum/Conceptual_:_HostName_vs._Domain.mdwn @@ -0,0 +1,22 @@ +Hello, + +Writing properties, I often hesitate between using types `HostName` or `Domain` for the FQDN of a machine. +This is not 'very important' since both are "just" `String`, but the type carries semantics and I'd rather keep consistent (helps understanding the code better). + +Here are the docs : + +http://hackage.haskell.org/package/propellor-5.9.1/docs/Propellor-Types-OS.html#t:HostName +http://hackage.haskell.org/package/propellor-5.9.1/docs/Propellor-Types-Dns.html#t:Domain + +So `HostName` documentation to me looks like really corresponding to a machine's FQDN, but may also be the IP of the machine. +Conversely `Domain` is not documented (in its module) but it is used in the 'domain part of the FQDN' in some modules; eg. in Propellor/Property/Hostname.hs +Even clearer is the `Propellor.Property.DNS` module in which I clearly understand the choice of `Domain` vs. `HostName`. + +Still it seems to me that sometimes one sees `Domain` where a `HostName` would be expected. One such example is in `LetsEncrypt` +Maybe I am just to confused by a few places where `Domain` is used while I would (maybe wrongly) expect `HostName` ? + +What am I missing ? + +Cheers, + +Serge. -- cgit v1.2.3 From a7e0eff8bb4147049266a9ed79008fcb2a0b57d2 Mon Sep 17 00:00:00 2001 From: serge1cohen Date: Tue, 5 Nov 2019 16:54:17 +0000 Subject: --- doc/forum/Setting_altenative___63__.mdwn | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/forum/Setting_altenative___63__.mdwn diff --git a/doc/forum/Setting_altenative___63__.mdwn b/doc/forum/Setting_altenative___63__.mdwn new file mode 100644 index 00000000..b40d1fe0 --- /dev/null +++ b/doc/forum/Setting_altenative___63__.mdwn @@ -0,0 +1,7 @@ +Everything is in the title : is there a property to ensure that the 'alternative' is set in a given way ? + +I guess the simplest otherwise would be to use a `Cmd` to do it (through usage of `update-alternative`), but I am wondering if there is already a property to do that… + +Thanks in advance, + +Serge -- cgit v1.2.3 From 3e26654c5827e3d46d7545aeeae3be6c9aa20e1c Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 11 Nov 2019 13:23:50 -0400 Subject: comment --- .../comment_1_cc9f01e46e6cc2940382309cd17b3575._comment | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 doc/forum/Setting_altenative___63__/comment_1_cc9f01e46e6cc2940382309cd17b3575._comment diff --git a/doc/forum/Setting_altenative___63__/comment_1_cc9f01e46e6cc2940382309cd17b3575._comment b/doc/forum/Setting_altenative___63__/comment_1_cc9f01e46e6cc2940382309cd17b3575._comment new file mode 100644 index 00000000..741326f6 --- /dev/null +++ b/doc/forum/Setting_altenative___63__/comment_1_cc9f01e46e6cc2940382309cd17b3575._comment @@ -0,0 +1,7 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2019-11-11T17:23:24Z" + content=""" +There is not. I'd welcome a property submission. +"""]] -- cgit v1.2.3 From 596bfcd2e26d6120e190519fca1946b613e002ec Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 11 Nov 2019 13:41:17 -0400 Subject: comment --- ...ment_1_6a80853161714e19cdae006ec19097fb._comment | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 doc/forum/Conceptual_:_HostName_vs._Domain/comment_1_6a80853161714e19cdae006ec19097fb._comment diff --git a/doc/forum/Conceptual_:_HostName_vs._Domain/comment_1_6a80853161714e19cdae006ec19097fb._comment b/doc/forum/Conceptual_:_HostName_vs._Domain/comment_1_6a80853161714e19cdae006ec19097fb._comment new file mode 100644 index 00000000..86c38d79 --- /dev/null +++ b/doc/forum/Conceptual_:_HostName_vs._Domain/comment_1_6a80853161714e19cdae006ec19097fb._comment @@ -0,0 +1,21 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2019-11-11T17:26:24Z" + content=""" +I think LetsEncrypt's use of Domain is intentional; a certificate is for a +domain and you can't get one for eg a bare IP address or an unqualified +hostname. + +AFAICS, Domain is a FQDN. + +(Propellor.Property.Hostname has to deal with details of /etc/hosts, +but it does not actually use the Domain type anywhere.) + +More generally, it's common for a propellor module to have some +`type Foo = String` that's only used to make parameters more self-documenting +and doesn't have any particular meaning beyond whatever string a Property might +use. One shouldn't worry if two modules have data types that seem to +overlap in content when that's all they're used for. Of course it's nicer to +have less stringy data types, via ADTs or smart constructors, when possible. +"""]] -- cgit v1.2.3 From 3632a07142dca7422c3343e98de33f2abec629aa Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 11 Nov 2019 15:44:12 -0400 Subject: Changed the ChrootBootstrapper type class's buildchroot method to take a Info parameter, instead of Maybe System. The System can be extracted from the Info; this also allows the chroot's Info to be introspected for eg, the apt mirror. (API change) --- debian/changelog | 4 ++++ src/Propellor/Property/Chroot.hs | 11 ++++++++--- src/Propellor/Types/Info.hs | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3031d05a..da528717 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,10 @@ propellor (5.10.1) UNRELEASED; urgency=medium * Localdir.hasOriginUrl: Type changed from UnixLike to DebianLike because Git.installed is not implemented for other unixes. (API change) + * Changed the ChrootBootstrapper type class's buildchroot method + to take a Info parameter, instead of Maybe System. + (The System can be extracted from the Info.) + (API change) -- Joey Hess Thu, 08 Aug 2019 11:33:37 -0400 diff --git a/src/Propellor/Property/Chroot.hs b/src/Propellor/Property/Chroot.hs index 48d96dcf..5be39bd6 100644 --- a/src/Propellor/Property/Chroot.hs +++ b/src/Propellor/Property/Chroot.hs @@ -60,7 +60,11 @@ class ChrootBootstrapper b where -- | Do initial bootstrapping of an operating system in a chroot. -- If the operating System is not supported, return -- Left error message. - buildchroot :: b -> Maybe System -> FilePath -> Either String (Property Linux) + buildchroot + :: b + -> Info -- ^ info of the Properties of the chroot + -> FilePath -- ^ where to bootstrap the chroot + -> Either String (Property Linux) -- | Use this to bootstrap a chroot by extracting a tarball. -- @@ -91,7 +95,7 @@ extractTarball target src = check (isUnpopulated target) $ data Debootstrapped = Debootstrapped Debootstrap.DebootstrapConfig instance ChrootBootstrapper Debootstrapped where - buildchroot (Debootstrapped cf) system loc = case system of + buildchroot (Debootstrapped cf) info loc = case system of (Just s@(System (Debian _ _) _)) -> Right $ debootstrap s (Just s@(System (Buntish _) _)) -> Right $ debootstrap s (Just (System ArchLinux _)) -> Left "Arch Linux not supported by debootstrap." @@ -99,6 +103,7 @@ instance ChrootBootstrapper Debootstrapped where Nothing -> Left "Cannot debootstrap; OS not specified" where debootstrap s = Debootstrap.built loc s cf + system = fromInfoVal (fromInfo info) -- | Defines a Chroot at the given location, built with debootstrap. -- @@ -143,7 +148,7 @@ provisioned' c@(Chroot loc bootstrapper infopropigator _) systemdonly caps = setup = propellChroot c (inChrootProcess (not systemdonly) c) systemdonly caps `requires` built - built = case buildchroot bootstrapper (chrootSystem c) loc of + built = case buildchroot bootstrapper (containerInfo c) loc of Right p -> p Left e -> cantbuild e diff --git a/src/Propellor/Types/Info.hs b/src/Propellor/Types/Info.hs index b941cc8f..27633712 100644 --- a/src/Propellor/Types/Info.hs +++ b/src/Propellor/Types/Info.hs @@ -63,6 +63,7 @@ addInfo (Info l) v = Info (l++[InfoEntry v]) toInfo :: IsInfo v => v -> Info toInfo = addInfo mempty +-- | Extracts a value from an Info. fromInfo :: IsInfo v => Info -> v fromInfo (Info l) = mconcat (mapMaybe extractInfoEntry l) -- cgit v1.2.3 From a85d01661501b16da6bf97e543ce88e4f4f1fd77 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 12 Nov 2019 14:55:41 -0700 Subject: introduce propsInfo Code from Joey by private e-mail. --- src/Propellor/Types/Core.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Propellor/Types/Core.hs b/src/Propellor/Types/Core.hs index 88c749b3..9f4dc519 100644 --- a/src/Propellor/Types/Core.hs +++ b/src/Propellor/Types/Core.hs @@ -109,3 +109,6 @@ instance IsProp ChildProperty where getInfo (ChildProperty _ _ i _) = i toChildProperty = id getSatisfy (ChildProperty _ a _ _) = a + +propsInfo :: Props metatypes -> Info +propsInfo (Props l) = mconcat (map getInfo l) -- cgit v1.2.3 From 0ce27912fb2371590e6a1c44f76f51f408d9b79f Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 12 Nov 2019 14:55:42 -0700 Subject: Chroot.debootstrapped: respect chroot's Apt.proxy and Apt.mirror Closes: https://propellor.branchable.com/todo/Debootstrap_module_should_respect_a_configured_Apt.proxy/ Signed-off-by: Sean Whitton --- src/Propellor/Property/Chroot.hs | 26 +++++++++++++++++++++++++- src/Propellor/Property/Debootstrap.hs | 22 ++++++++++++++++++++-- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/src/Propellor/Property/Chroot.hs b/src/Propellor/Property/Chroot.hs index 5be39bd6..ddb7f884 100644 --- a/src/Propellor/Property/Chroot.hs +++ b/src/Propellor/Property/Chroot.hs @@ -26,6 +26,7 @@ import Propellor.Types.Container import Propellor.Types.Info import Propellor.Types.Core import Propellor.Property.Chroot.Util +import qualified Propellor.Property.Apt as Apt import qualified Propellor.Property.Debootstrap as Debootstrap import qualified Propellor.Property.Systemd.Core as Systemd import qualified Propellor.Property.File as File @@ -102,8 +103,22 @@ instance ChrootBootstrapper Debootstrapped where (Just (System (FreeBSD _) _)) -> Left "FreeBSD not supported by debootstrap." Nothing -> Left "Cannot debootstrap; OS not specified" where - debootstrap s = Debootstrap.built loc s cf + debootstrap s = Debootstrap.built loc s + (cf <> proxyConf <> mirrorConf) system = fromInfoVal (fromInfo info) + -- If the chroot has a configured apt proxy and/or mirror, pass + -- these on to debootstrap. Note that Debootstrap.built does + -- not get passed the Chroot, so the info inspection has to + -- happen here, not there + proxyConf = case (fromInfoVal . fromInfo) info of + Just (Apt.HostAptProxy u) -> + Debootstrap.DebootstrapProxy u + Nothing -> mempty + mirrorConf = case (fromInfoVal . fromInfo) info of + Just (Apt.HostMirror u) -> + Debootstrap.DebootstrapMirror u + Nothing -> mempty + -- | Defines a Chroot at the given location, built with debootstrap. -- @@ -111,6 +126,11 @@ instance ChrootBootstrapper Debootstrapped where -- add a property such as `osDebian` to specify the operating system -- to bootstrap. -- +-- If @conf@ does not include a 'DebootstrapProxy' entry, and the Chroot has a +-- defined 'Apt.proxy', then the Chroot's apt proxy will be used by debootstrap +-- in creating the Chroot, too. Similarly if the @conf@ does not include a +-- 'DebootstrapMirror' and the Chroot has a defined 'Apt.mirror'. +-- -- > debootstrapped Debootstrap.BuildD "/srv/chroot/ghc-dev" $ props -- > & osDebian Unstable X86_64 -- > & Apt.installed ["ghc", "haskell-platform"] @@ -120,6 +140,10 @@ debootstrapped conf = bootstrapped (Debootstrapped conf) -- | Defines a Chroot at the given location, bootstrapped with the -- specified ChrootBootstrapper. +-- +-- Like 'Chroot.debootstrapped', if the ChrootBootstrapper is Debootstrap, this +-- property respects the Chroot's configured Apt.proxy and Apt.mirror, if either +-- exists. bootstrapped :: ChrootBootstrapper b => b -> FilePath -> Props metatypes -> Chroot bootstrapped bootstrapper location ps = c where diff --git a/src/Propellor/Property/Debootstrap.hs b/src/Propellor/Property/Debootstrap.hs index 6336e775..adf0879b 100644 --- a/src/Propellor/Property/Debootstrap.hs +++ b/src/Propellor/Property/Debootstrap.hs @@ -32,6 +32,8 @@ data DebootstrapConfig | BuilddD | DebootstrapParam String | UseEmulation + | DebootstrapProxy Url + | DebootstrapMirror Url | DebootstrapConfig :+ DebootstrapConfig deriving (Show) @@ -48,6 +50,8 @@ toParams MinBase = [Param "--variant=minbase"] toParams BuilddD = [Param "--variant=buildd"] toParams (DebootstrapParam p) = [Param p] toParams UseEmulation = [] +toParams (DebootstrapProxy _) = [] +toParams (DebootstrapMirror _) = [] toParams (c1 :+ c2) = toParams c1 <> toParams c2 useEmulation :: DebootstrapConfig -> Bool @@ -55,6 +59,16 @@ useEmulation UseEmulation = True useEmulation (a :+ b) = useEmulation a || useEmulation b useEmulation _ = False +debootstrapProxy :: DebootstrapConfig -> Maybe Url +debootstrapProxy (DebootstrapProxy u) = Just u +debootstrapProxy (a :+ b) = debootstrapProxy a <|> debootstrapProxy b +debootstrapProxy _ = Nothing + +debootstrapMirror :: DebootstrapConfig -> Maybe Url +debootstrapMirror (DebootstrapMirror u) = Just u +debootstrapMirror (a :+ b) = debootstrapMirror a <|> debootstrapMirror b +debootstrapMirror _ = Nothing + -- | Builds a chroot in the given directory using debootstrap. -- -- The System can be any OS and architecture that debootstrap @@ -99,11 +113,15 @@ built' installprop target system@(System _ arch) config = [ Param $ "--arch=" ++ architectureToDebianArchString arch , Param suite , Param target - ] + ] ++ case debootstrapMirror config of + Just u -> [Param u] + Nothing -> [] cmd <- if useEmulation config then pure "qemu-debootstrap" else fromMaybe "debootstrap" <$> programPath - de <- standardPathEnv + de <- case debootstrapProxy config of + Just u -> addEntry "http_proxy" u <$> standardPathEnv + Nothing -> standardPathEnv ifM (boolSystemEnv cmd params (Just de)) ( return MadeChange , return FailedChange -- cgit v1.2.3 From e7e94a8f57dd6a54213cbc1365928110e95f8947 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 12 Nov 2019 14:55:43 -0700 Subject: move Sbuild.useHostProxy -> Chroot.useHostProxy Now that the apt proxy is respected by Chroot.debootstrapped, users will probably want to apply useHostProxy to more chroots than just sbuild schroots. Unfortunately, we can't have a corresponding Chroot.useHostMirror property, because the only sensible way to set the chroot's apt mirror is to use the Apt.mirror pure info property, but we can't ensure properties with info. Suggested-by: Joey Hess Signed-off-by: Sean Whitton --- src/Propellor/Property/Chroot.hs | 16 ++++++++++++++++ src/Propellor/Property/Sbuild.hs | 17 +---------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/Propellor/Property/Chroot.hs b/src/Propellor/Property/Chroot.hs index ddb7f884..971fd8ba 100644 --- a/src/Propellor/Property/Chroot.hs +++ b/src/Propellor/Property/Chroot.hs @@ -10,6 +10,7 @@ module Propellor.Property.Chroot ( Debootstrapped(..), ChrootTarball(..), exposeTrueLocaldir, + useHostProxy, -- * Internal use provisioned', propagateChrootInfo, @@ -333,3 +334,18 @@ propagateHostChrootInfo :: Host -> InfoPropagator propagateHostChrootInfo h c pinfo p = propagateContainer (hostName h) c pinfo $ p `setInfoProperty` chrootInfo c + +-- | Ensure that a chroot uses the host's Apt proxy. +-- +-- This property is often used for 'Sbuild.built' chroots, when the host has +-- 'Apt.useLocalCacher'. +useHostProxy :: Host -> Property DebianLike +useHostProxy h = property' "use host's apt proxy" $ \w -> + -- Note that we can't look at getProxyInfo outside the property, + -- as that would loop, but it's ok to look at it inside the + -- property. Thus the slightly strange construction here. + case getProxyInfo of + Just (Apt.HostAptProxy u) -> ensureProperty w (Apt.proxy' u) + Nothing -> noChange + where + getProxyInfo = fromInfoVal . fromInfo . hostInfo $ h diff --git a/src/Propellor/Property/Sbuild.hs b/src/Propellor/Property/Sbuild.hs index 1562f80e..3242014d 100644 --- a/src/Propellor/Property/Sbuild.hs +++ b/src/Propellor/Property/Sbuild.hs @@ -31,7 +31,7 @@ Suggested usage in @config.hs@: > & osDebian Unstable X86_32 > & Sbuild.osDebianStandard > & Sbuild.update `period` Weekly (Just 1) -> & Sbuild.useHostProxy mybox +> & Chroot.useHostProxy mybox If you are using sbuild older than 0.70.0, you also need: @@ -65,7 +65,6 @@ module Propellor.Property.Sbuild ( built, -- * Properties for use inside sbuild schroots update, - useHostProxy, osDebianStandard, -- * Global sbuild configuration -- blockNetwork, @@ -268,20 +267,6 @@ osDebianStandard = propertyList "standard Debian sbuild properties" $ props update :: Property DebianLike update = Apt.update `before` Apt.upgrade `before` Apt.autoRemove --- | Ensure that an sbuild schroot uses the host's Apt proxy. --- --- This property is typically used when the host has 'Apt.useLocalCacher'. -useHostProxy :: Host -> Property DebianLike -useHostProxy h = property' "use host's apt proxy" $ \w -> - -- Note that we can't look at getProxyInfo outside the property, - -- as that would loop, but it's ok to look at it inside the - -- property. Thus the slightly strange construction here. - case getProxyInfo of - Just (Apt.HostAptProxy u) -> ensureProperty w (Apt.proxy' u) - Nothing -> noChange - where - getProxyInfo = fromInfoVal . fromInfo . hostInfo $ h - aptCacheLine :: String aptCacheLine = "/var/cache/apt/archives /var/cache/apt/archives none rw,bind 0 0" -- cgit v1.2.3 From 67449c0c197bdea5d6aa488b74023e93400dbb6f Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 12 Nov 2019 14:55:44 -0700 Subject: update changelog Signed-off-by: Sean Whitton --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index da528717..4b79f8ab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ propellor (5.10.1) UNRELEASED; urgency=medium + [ Joey Hess ] * Localdir.hasOriginUrl: Depend on Git.installed. * Localdir.hasOriginUrl: Type changed from UnixLike to DebianLike because Git.installed is not implemented for other unixes. @@ -9,6 +10,11 @@ propellor (5.10.1) UNRELEASED; urgency=medium (The System can be extracted from the Info.) (API change) + [ Sean Whitton ] + * Chroot.{de,}bootstrapped uses the chroot's configured apt proxy and + mirror, if these exist, when debootstrapping the chroot. + * Rename Sbuild.useHostProxy -> Chroot.useHostProxy. (API change) + -- Joey Hess Thu, 08 Aug 2019 11:33:37 -0400 propellor (5.9.1) unstable; urgency=medium -- cgit v1.2.3 From a7b4aa3dee30b51713ca0a952ab3289a33842074 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 13 Nov 2019 10:25:29 -0400 Subject: minor style tweak I'm not fond of the foo . bar $ v construct, not entirely sure why. --- src/Propellor/Property/Chroot.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Propellor/Property/Chroot.hs b/src/Propellor/Property/Chroot.hs index 971fd8ba..1a2fd6c8 100644 --- a/src/Propellor/Property/Chroot.hs +++ b/src/Propellor/Property/Chroot.hs @@ -344,8 +344,8 @@ useHostProxy h = property' "use host's apt proxy" $ \w -> -- Note that we can't look at getProxyInfo outside the property, -- as that would loop, but it's ok to look at it inside the -- property. Thus the slightly strange construction here. - case getProxyInfo of + case getProxyInfo h of Just (Apt.HostAptProxy u) -> ensureProperty w (Apt.proxy' u) Nothing -> noChange where - getProxyInfo = fromInfoVal . fromInfo . hostInfo $ h + getProxyInfo = fromInfoVal . fromInfo . hostInfo -- cgit v1.2.3 From 7eaec4824aa67871a693febfa43c3aa88796ec95 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 13 Nov 2019 10:28:29 -0400 Subject: close --- doc/todo/Debootstrap_module_should_respect_a_configured_Apt.proxy.mdwn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/todo/Debootstrap_module_should_respect_a_configured_Apt.proxy.mdwn b/doc/todo/Debootstrap_module_should_respect_a_configured_Apt.proxy.mdwn index 8887f438..fc817415 100644 --- a/doc/todo/Debootstrap_module_should_respect_a_configured_Apt.proxy.mdwn +++ b/doc/todo/Debootstrap_module_should_respect_a_configured_Apt.proxy.mdwn @@ -27,3 +27,5 @@ so tried on my own to my opinion the schroot config file generated by Sbuild property does something wrong. Cheers + +> [[done]]; I merged patches from spwhitton. --[[Joey]] -- cgit v1.2.3 From 64cea570e4e82edec6016cbcb1463b3891b094e3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 13 Nov 2019 10:29:38 -0400 Subject: remove horizontal alignment --- src/Propellor/Property/Chroot.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Propellor/Property/Chroot.hs b/src/Propellor/Property/Chroot.hs index 1a2fd6c8..df5307e4 100644 --- a/src/Propellor/Property/Chroot.hs +++ b/src/Propellor/Property/Chroot.hs @@ -114,12 +114,11 @@ instance ChrootBootstrapper Debootstrapped where proxyConf = case (fromInfoVal . fromInfo) info of Just (Apt.HostAptProxy u) -> Debootstrap.DebootstrapProxy u - Nothing -> mempty + Nothing -> mempty mirrorConf = case (fromInfoVal . fromInfo) info of - Just (Apt.HostMirror u) -> + Just (Apt.HostMirror u) -> Debootstrap.DebootstrapMirror u - Nothing -> mempty - + Nothing -> mempty -- | Defines a Chroot at the given location, built with debootstrap. -- -- cgit v1.2.3 From 89daa9b2e904e3fc6a95b05b792aa9b3d7fca76a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 13 Nov 2019 10:41:03 -0400 Subject: improve haddocks particularly, remove @conf@ reference as that variable name is not visible in the haddock docs unless source is viewed. Also tightened up the language and linkified more, and fixed a typo in the name of Debootstrapped. --- src/Propellor/Property/Chroot.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Propellor/Property/Chroot.hs b/src/Propellor/Property/Chroot.hs index df5307e4..13511902 100644 --- a/src/Propellor/Property/Chroot.hs +++ b/src/Propellor/Property/Chroot.hs @@ -126,10 +126,10 @@ instance ChrootBootstrapper Debootstrapped where -- add a property such as `osDebian` to specify the operating system -- to bootstrap. -- --- If @conf@ does not include a 'DebootstrapProxy' entry, and the Chroot has a --- defined 'Apt.proxy', then the Chroot's apt proxy will be used by debootstrap --- in creating the Chroot, too. Similarly if the @conf@ does not include a --- 'DebootstrapMirror' and the Chroot has a defined 'Apt.mirror'. +-- If the 'Debootstrap.DebootstrapConfig' does not include a +-- 'Debootstrap.DebootstrapMirror', +-- any 'Apt.mirror' property of the chroot will configure debootstrap. +-- Same for 'Debootstrap.DebootstrapProxy' and 'Apt.proxy'. -- -- > debootstrapped Debootstrap.BuildD "/srv/chroot/ghc-dev" $ props -- > & osDebian Unstable X86_64 @@ -141,9 +141,9 @@ debootstrapped conf = bootstrapped (Debootstrapped conf) -- | Defines a Chroot at the given location, bootstrapped with the -- specified ChrootBootstrapper. -- --- Like 'Chroot.debootstrapped', if the ChrootBootstrapper is Debootstrap, this --- property respects the Chroot's configured Apt.proxy and Apt.mirror, if either --- exists. +-- Like 'Chroot.debootstrapped', if the 'ChrootBootstrapper' is +-- 'Debootstrapped', this property respects the Chroot's +-- 'Apt.proxy' and 'Apt.mirror' properties. bootstrapped :: ChrootBootstrapper b => b -> FilePath -> Props metatypes -> Chroot bootstrapped bootstrapper location ps = c where -- cgit v1.2.3 From 8cbb6fa07faee57beedc8beda8ff890e85e56402 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 15 Nov 2019 13:26:09 -0400 Subject: clean up after merge --- config.hs | 2 +- privdata/relocate | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 privdata/relocate diff --git a/config.hs b/config.hs index 97d90636..ec313725 120000 --- a/config.hs +++ b/config.hs @@ -1 +1 @@ -joeyconfig.hs \ No newline at end of file +config-simple.hs \ No newline at end of file diff --git a/privdata/relocate b/privdata/relocate deleted file mode 100644 index 271692d8..00000000 --- a/privdata/relocate +++ /dev/null @@ -1 +0,0 @@ -.joeyconfig -- cgit v1.2.3 From 569e3afff6198edb06d9f17778b5725ebce18543 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 15 Nov 2019 13:26:57 -0400 Subject: releasing package propellor version 5.10.1 --- debian/changelog | 4 ++-- propellor.cabal | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4b79f8ab..6d52685a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -propellor (5.10.1) UNRELEASED; urgency=medium +propellor (5.10.1) unstable; urgency=medium [ Joey Hess ] * Localdir.hasOriginUrl: Depend on Git.installed. @@ -15,7 +15,7 @@ propellor (5.10.1) UNRELEASED; urgency=medium mirror, if these exist, when debootstrapping the chroot. * Rename Sbuild.useHostProxy -> Chroot.useHostProxy. (API change) - -- Joey Hess Thu, 08 Aug 2019 11:33:37 -0400 + -- Joey Hess Fri, 15 Nov 2019 13:26:19 -0400 propellor (5.9.1) unstable; urgency=medium diff --git a/propellor.cabal b/propellor.cabal index 17b9510b..152c59da 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -1,5 +1,5 @@ Name: propellor -Version: 5.9.1 +Version: 5.10.1 Cabal-Version: 1.20 License: BSD2 Maintainer: Joey Hess -- cgit v1.2.3 From 4058c30b7f9ec06a7507b676e71d171beb6ae8bd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 15 Nov 2019 13:27:25 -0400 Subject: add news item for propellor 5.10.1 --- doc/news/version_5.10.1.mdwn | 15 +++++++++++++++ doc/news/version_5.6.1.mdwn | 4 ---- 2 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 doc/news/version_5.10.1.mdwn delete mode 100644 doc/news/version_5.6.1.mdwn diff --git a/doc/news/version_5.10.1.mdwn b/doc/news/version_5.10.1.mdwn new file mode 100644 index 00000000..797664be --- /dev/null +++ b/doc/news/version_5.10.1.mdwn @@ -0,0 +1,15 @@ +propellor 5.10.1 released with [[!toggle text="these changes"]] +[[!toggleable text=""" + * [ Joey Hess ] + * Localdir.hasOriginUrl: Depend on Git.installed. + * Localdir.hasOriginUrl: Type changed from UnixLike to DebianLike + because Git.installed is not implemented for other unixes. + (API change) + * Changed the ChrootBootstrapper type class's buildchroot method + to take a Info parameter, instead of Maybe System. + (The System can be extracted from the Info.) + (API change) + * [ Sean Whitton ] + * Chroot.{de,}bootstrapped uses the chroot's configured apt proxy and + mirror, if these exist, when debootstrapping the chroot. + * Rename Sbuild.useHostProxy -> Chroot.useHostProxy. (API change)"""]] \ No newline at end of file diff --git a/doc/news/version_5.6.1.mdwn b/doc/news/version_5.6.1.mdwn deleted file mode 100644 index 739d49f7..00000000 --- a/doc/news/version_5.6.1.mdwn +++ /dev/null @@ -1,4 +0,0 @@ -propellor 5.6.1 released with [[!toggle text="these changes"]] -[[!toggleable text=""" - * fix Libvirt.hs haddock build - Thanks, Sean Whitton"""]] \ No newline at end of file -- cgit v1.2.3 From 450ba940b755675d9822594a4226c4043494c40e Mon Sep 17 00:00:00 2001 From: eugen Date: Thu, 21 Nov 2019 09:34:05 +0000 Subject: --- doc/forum/etckeeper_made_obsolete_by_propellor__63__.mdwn | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/forum/etckeeper_made_obsolete_by_propellor__63__.mdwn diff --git a/doc/forum/etckeeper_made_obsolete_by_propellor__63__.mdwn b/doc/forum/etckeeper_made_obsolete_by_propellor__63__.mdwn new file mode 100644 index 00000000..b35d49c9 --- /dev/null +++ b/doc/forum/etckeeper_made_obsolete_by_propellor__63__.mdwn @@ -0,0 +1 @@ +I'm still learning about these two programs. I haven't use them yet, but I will (at least propellor). It seems to me there exists a bit of functionality overlapping between them: propellor's config file might be enough to describe all your changes you want to /etc for a host..? In this case, etckeeper would appear to be useful just as a "change log".. What's your thoughts on this? Do you use both propellor and etckeeper? -- cgit v1.2.3 From 8e550276b75b618533e73b8f033e302803d24905 Mon Sep 17 00:00:00 2001 From: eugen Date: Thu, 21 Nov 2019 09:43:13 +0000 Subject: --- doc/forum/etckeeper_made_obsolete_by_propellor__63__.mdwn | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/forum/etckeeper_made_obsolete_by_propellor__63__.mdwn b/doc/forum/etckeeper_made_obsolete_by_propellor__63__.mdwn index b35d49c9..ea605ef4 100644 --- a/doc/forum/etckeeper_made_obsolete_by_propellor__63__.mdwn +++ b/doc/forum/etckeeper_made_obsolete_by_propellor__63__.mdwn @@ -1 +1,2 @@ I'm still learning about these two programs. I haven't use them yet, but I will (at least propellor). It seems to me there exists a bit of functionality overlapping between them: propellor's config file might be enough to describe all your changes you want to /etc for a host..? In this case, etckeeper would appear to be useful just as a "change log".. What's your thoughts on this? Do you use both propellor and etckeeper? +-- eugen -- cgit v1.2.3 From 6c86e7a7edc03c45566f60bcff7b521529bd6852 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 21 Nov 2019 11:09:18 -0400 Subject: comment --- .../comment_1_008690e4e3828123a2c47a4b1abc413e._comment | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 doc/forum/etckeeper_made_obsolete_by_propellor__63__/comment_1_008690e4e3828123a2c47a4b1abc413e._comment diff --git a/doc/forum/etckeeper_made_obsolete_by_propellor__63__/comment_1_008690e4e3828123a2c47a4b1abc413e._comment b/doc/forum/etckeeper_made_obsolete_by_propellor__63__/comment_1_008690e4e3828123a2c47a4b1abc413e._comment new file mode 100644 index 00000000..752bbd01 --- /dev/null +++ b/doc/forum/etckeeper_made_obsolete_by_propellor__63__/comment_1_008690e4e3828123a2c47a4b1abc413e._comment @@ -0,0 +1,14 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2019-11-21T14:57:57Z" + content=""" +I use both. To be fully described by the propellor configuration, it would +need to pin the system to a specific version of every package installed on +it, and that's generally not practical because there are new security +updates all the time. It's useful to have etckeeper keeping track of +changes made to configuration during upgrades. + +I do find etckeeper generally less useful on those type of systems, but it +still more than pays for itself. +"""]] -- cgit v1.2.3 From da220782f7f43bfc68d8c3cb58238633e494ca00 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 21 Nov 2019 11:20:44 -0400 Subject: comment --- .../comment_2_41084ce268e4aa667b1c59f8352aa774._comment | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 doc/forum/etckeeper_made_obsolete_by_propellor__63__/comment_2_41084ce268e4aa667b1c59f8352aa774._comment diff --git a/doc/forum/etckeeper_made_obsolete_by_propellor__63__/comment_2_41084ce268e4aa667b1c59f8352aa774._comment b/doc/forum/etckeeper_made_obsolete_by_propellor__63__/comment_2_41084ce268e4aa667b1c59f8352aa774._comment new file mode 100644 index 00000000..84c22a04 --- /dev/null +++ b/doc/forum/etckeeper_made_obsolete_by_propellor__63__/comment_2_41084ce268e4aa667b1c59f8352aa774._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 2""" + date="2019-11-21T15:16:36Z" + content=""" +Also, when the propellor configuration is changed, it's very useful to have +a record of how that change affected the host. While etckeeper's record is +limited to /etc, that does cover a large percentage of such changes. +"""]] -- cgit v1.2.3 From 8fe1a635afc45c78c424f82b5114544ece66cff4 Mon Sep 17 00:00:00 2001 From: eugen Date: Thu, 21 Nov 2019 20:29:20 +0000 Subject: Added a comment --- .../comment_3_ab42e31ff116bf56dca6cdff9bba2d29._comment | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 doc/forum/etckeeper_made_obsolete_by_propellor__63__/comment_3_ab42e31ff116bf56dca6cdff9bba2d29._comment diff --git a/doc/forum/etckeeper_made_obsolete_by_propellor__63__/comment_3_ab42e31ff116bf56dca6cdff9bba2d29._comment b/doc/forum/etckeeper_made_obsolete_by_propellor__63__/comment_3_ab42e31ff116bf56dca6cdff9bba2d29._comment new file mode 100644 index 00000000..eb8abfb3 --- /dev/null +++ b/doc/forum/etckeeper_made_obsolete_by_propellor__63__/comment_3_ab42e31ff116bf56dca6cdff9bba2d29._comment @@ -0,0 +1,10 @@ +[[!comment format=mdwn + username="eugen" + avatar="http://cdn.libravatar.org/avatar/7e7e5700d7017735fd00c2dfcd3f91e4" + subject="comment 3" + date="2019-11-21T20:29:20Z" + content=""" +Indeed, I can see how etckeeper provides a very easy way to check exactly what has changed to /etc (also) after a propellor spin. When I'm manually editing an /etc file I know what the changes are, but not so when a tool does it for me. So, it's important to verify, for example, that propellor did indeed what I *thought* I told it to do (not sure if propellor has an option to report the /etc changes it did). + +By using both etckeeper and propellor, which one do you consider to have the authoritative status (power?) over /etc? Do you still manually edit /etc files? +"""]] -- cgit v1.2.3 From 3afba757248a9844a7f9d86d8a1ab80c70670e76 Mon Sep 17 00:00:00 2001 From: balu Date: Wed, 27 Nov 2019 16:28:41 +0000 Subject: Added a comment --- .../comment_8_6a7a6a3acce0b0865e2a389e60c46179._comment | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 doc/todo/spin_without_remote_compilation/comment_8_6a7a6a3acce0b0865e2a389e60c46179._comment diff --git a/doc/todo/spin_without_remote_compilation/comment_8_6a7a6a3acce0b0865e2a389e60c46179._comment b/doc/todo/spin_without_remote_compilation/comment_8_6a7a6a3acce0b0865e2a389e60c46179._comment new file mode 100644 index 00000000..1325399d --- /dev/null +++ b/doc/todo/spin_without_remote_compilation/comment_8_6a7a6a3acce0b0865e2a389e60c46179._comment @@ -0,0 +1,8 @@ +[[!comment format=mdwn + username="balu" + avatar="http://cdn.libravatar.org/avatar/2ec9dd5a234ce82f117bd81d1e44f2cb" + subject="comment 8" + date="2019-11-27T16:28:41Z" + content=""" +I am very interested in having this feature in the debian package of propellor and would like to help. What is missing to accomplish that? +"""]] -- cgit v1.2.3 From db284b939bec18ad7e45a3ce1af1e77c6452524e Mon Sep 17 00:00:00 2001 From: https://launchpad.net/~barthelemy Date: Fri, 3 Jan 2020 20:10:41 +0000 Subject: --- .../using_propellor_on_low_RAM_devices__63__.mdwn | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 doc/forum/using_propellor_on_low_RAM_devices__63__.mdwn diff --git a/doc/forum/using_propellor_on_low_RAM_devices__63__.mdwn b/doc/forum/using_propellor_on_low_RAM_devices__63__.mdwn new file mode 100644 index 00000000..7bcbd0cc --- /dev/null +++ b/doc/forum/using_propellor_on_low_RAM_devices__63__.mdwn @@ -0,0 +1,18 @@ +I'm trying to use propellor (and to learn haskell!) to manage my laptop and a small server, both running debian stable. + +The server is a lime2 soc [1], with only 1GiB of RAM, and no swap (I think this is the default setup from the freedombox image). + +propellor --spin failed when targeting the server: on the server, ghc got killed by the OOM killer. + +I then simplified my config.hs and successfully ran "cabal build -j1" from the server. +At some point during the successful build, ghc was using 400MiB of memory. +This is 40% of the whole memory, I fear the OOM killer will strike again if I don't change something. +I'll probably try to enable swap. + +Propellor seems designed with embedded devices in mind (eg. with the image builder), I'm surprised it demands that much RAM. +Am I missing something? +Do people cross-compile propellor to avoid the issue? + +Cheers! + +[1] https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXino-LIME2 -- cgit v1.2.3 From 8d62df87bb8bc667f6b38177fddcac38f8102e61 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 4 Jan 2020 15:14:53 -0400 Subject: comment --- .../comment_1_fc192587233c3cda7d0f78f67311de49._comment | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 doc/forum/using_propellor_on_low_RAM_devices__63__/comment_1_fc192587233c3cda7d0f78f67311de49._comment diff --git a/doc/forum/using_propellor_on_low_RAM_devices__63__/comment_1_fc192587233c3cda7d0f78f67311de49._comment b/doc/forum/using_propellor_on_low_RAM_devices__63__/comment_1_fc192587233c3cda7d0f78f67311de49._comment new file mode 100644 index 00000000..af019cf6 --- /dev/null +++ b/doc/forum/using_propellor_on_low_RAM_devices__63__/comment_1_fc192587233c3cda7d0f78f67311de49._comment @@ -0,0 +1,12 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2020-01-04T19:02:08Z" + content=""" +500 mb seems a bit higher than typical; my own config.hs (500 lines) +needs 416 mb to build, and the example config.hs included in propellor +needs 245 mb. + +I typically install swapspace on systems with 1 gb or less and it works +fine. I think the smallest system I've used propellor with was 500 mb. +"""]] -- cgit v1.2.3 From 60966e0625b63751b26d0d01ed6c5cf08de16c47 Mon Sep 17 00:00:00 2001 From: https://launchpad.net/~barthelemy Date: Tue, 7 Jan 2020 00:38:09 +0000 Subject: Added a comment --- ...comment_2_b58e57d9edb7c574ff8a72dbcd24d1b7._comment | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 doc/forum/using_propellor_on_low_RAM_devices__63__/comment_2_b58e57d9edb7c574ff8a72dbcd24d1b7._comment diff --git a/doc/forum/using_propellor_on_low_RAM_devices__63__/comment_2_b58e57d9edb7c574ff8a72dbcd24d1b7._comment b/doc/forum/using_propellor_on_low_RAM_devices__63__/comment_2_b58e57d9edb7c574ff8a72dbcd24d1b7._comment new file mode 100644 index 00000000..9356298b --- /dev/null +++ b/doc/forum/using_propellor_on_low_RAM_devices__63__/comment_2_b58e57d9edb7c574ff8a72dbcd24d1b7._comment @@ -0,0 +1,18 @@ +[[!comment format=mdwn + username="https://launchpad.net/~barthelemy" + nickname="barthelemy" + avatar="http://cdn.libravatar.org/avatar/e99cb15f6029de3225721b3ebdd0233905eb69698e9b229a8c4cc510a4135438" + subject="comment 2" + date="2020-01-07T00:38:09Z" + content=""" +Hi Joey, + +thank you for the feedback. I'm glad to know it is supposed to work in those cases. +It seems freedombox uses btrfs and swapfiles do not work on btrfs partitions. I thus tried with zram (apt get install zram-tools, which set up a 256 MiB swap). + +I could then run propellor --spin to the server, it passed. +Then I rm -rf /usr/local/propellor on server and ran propellor --spin again. +The build passed again (it took ~75 minute and at some point ghc took 570MiB but it succeedded). + +I'm back on track, thank you again! +"""]] -- cgit v1.2.3 From 04eaacf5f670c6d308b6085382ac5eff2cc442d6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 16 Feb 2020 12:37:34 -0400 Subject: changelog --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index 6d52685a..ae7502dc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +propellor (5.10.2) UNRELEASED; urgency=medium + + * Bootstrap: Fix typo in Arch Linux dependencies. + Thanks, Robin Munn + + -- Joey Hess Sun, 16 Feb 2020 12:37:10 -0400 + propellor (5.10.1) unstable; urgency=medium [ Joey Hess ] -- cgit v1.2.3 From 50a6796d179e630bb8ac867de16f24dfe76b0672 Mon Sep 17 00:00:00 2001 From: rmunn@24f62461074e9165181dd6ec6ac66473353a24e9 Date: Mon, 17 Feb 2020 09:18:45 +0000 Subject: Describe three different Haskell issues with bootstrapping on Archlinux --- ...ootstrapping_with_Cabal_on_Archlinux_fails.mdwn | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 doc/forum/Bootstrapping_with_Cabal_on_Archlinux_fails.mdwn diff --git a/doc/forum/Bootstrapping_with_Cabal_on_Archlinux_fails.mdwn b/doc/forum/Bootstrapping_with_Cabal_on_Archlinux_fails.mdwn new file mode 100644 index 00000000..0ff23880 --- /dev/null +++ b/doc/forum/Bootstrapping_with_Cabal_on_Archlinux_fails.mdwn @@ -0,0 +1,46 @@ +Bootstrapping Propellor with Cabal is currently failing for me on Archlinux, for several reasons. + +## Dynamic linking + +The `ghc` package in Archlinux [uses dynamic linking](https://wiki.archlinux.org/index.php/Haskell#Problems_with_linking) for the GHC boot libraries. This means that the `cabal install` and `cabal build` steps in src/Propellor/Bootstrap.hs need the `--ghc-options=-dynamic` option added. I don't know if it's safe to do that for all OSes, or if this is something that Bootstrap.hs will need to do only on Arch. + +## GHC 8.8 + +Archlinux, being a rolling-release distro, has version 8.8.1 of GHC available. This means that once I add the `--ghc-options=-dynamic` option to the `cabal install` and `cabal build` steps, Propellor now fails to build on my Archlinux system with the GHC compiler complaining about src/Propellor/Property/Installer/Target.hs. Specifically, the `UserInput i` line in the definition of `targetInstalled` produces an "Illegal polymorphic type" error: + +``` +src/Propellor/Property/Installer/Target.hs:137:12: error: + • Illegal polymorphic type: + forall metatypes. + (Combines + (RevertableProperty metatypes metatypes) + (RevertableProperty metatypes metatypes), + CombinedType + (RevertableProperty metatypes metatypes) + (RevertableProperty metatypes metatypes) + ~ RevertableProperty metatypes metatypes) => + Propellor.Property.Versioned.VerSpec v metatypes + -> RevertableProperty metatypes metatypes + Perhaps you intended to use RankNTypes + • In the expansion of type synonym ‘Propellor.Property.Versioned.VersionedBy’ + In the expansion of type synonym ‘Versioned’ + In the type signature: + targetInstalled :: UserInput i => + Versioned v Host + -> v + -> i + -> TargetPartTable + -> RevertableProperty (HasInfo + DebianLike) (HasInfo + + DebianLike) + | +137 | :: UserInput i + | ^^^^^^^^^^^^... +``` + +This appears to be due to [stricter type synonym validity-checking in GHC 8.8](https://gitlab.haskell.org/ghc/ghc/wikis/migration/8.8#stricter-type-synonym-validity-checking). I had to add the `RankNTypes`, `TypeFamilies`, and `FlexibleContexts` extensions to Target.hs in order to make GHC 8.8 happy. (That's a minimal set: removing any one of those three produced one of three different compiler errors, which I won't reproduce here for brevity's safe). This appears to be safe on all OSes, since Propellor compiled happily on my laptop, which is running a Buntish variant called Linux Mint (where GHC 8.0.2 is what Apt gave me). (Though do note that I only tested that on Arch and Mint, and didn't do any testing on Debian to see whether GHC 7.x or earlier is still happy with those extensions being present in the source file). + +## New-style cabal + +Once I added the `--ghc-options=-dynamic` option to Cabal, and added those three extensions to the first line of Target.hs, I was then faced with another error: the `ln -sf` step failed because `dist/build/propellor-config/propellor-config` didn't exist. The version of Cabal that comes with Archlinux has apparently switched to [Nix-style local builds](https://cabal.readthedocs.io/en/latest/nix-local-build-overview.html) as the default action when you run `cabal build`, and the `propellor-config` binary ended up in `/usr/local/propellor/dist-newstyle/build/x86_64-linux/ghc-8.8.1/propellor-5.10.1/x/propellor-config/build/propellor-config/propellor-config`. + +This is the point where, not being a Haskell programmer myself, my ability to Google the problem was exhausted. I'm sure there's a way to get Cabal to tell you where it will put the files it's about to build (similar to `stack path --dist-dir`), but at this point, I needed to get back to working on other things. So I punted and just added `& bootstrapWith (Robustly Stack)` to the properties of my Archlinux host. :-) Bootstrapping with Stack was successful, BTW. -- cgit v1.2.3 From d0fd234785f99f4cfe2042958c034359d0372d6e Mon Sep 17 00:00:00 2001 From: rmunn@24f62461074e9165181dd6ec6ac66473353a24e9 Date: Tue, 18 Feb 2020 04:50:58 +0000 Subject: Added a comment: One more thing --- .../comment_1_80326b7fe6ea0f301872a02bb2462a5d._comment | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 doc/forum/Bootstrapping_with_Cabal_on_Archlinux_fails/comment_1_80326b7fe6ea0f301872a02bb2462a5d._comment diff --git a/doc/forum/Bootstrapping_with_Cabal_on_Archlinux_fails/comment_1_80326b7fe6ea0f301872a02bb2462a5d._comment b/doc/forum/Bootstrapping_with_Cabal_on_Archlinux_fails/comment_1_80326b7fe6ea0f301872a02bb2462a5d._comment new file mode 100644 index 00000000..5d1fab2d --- /dev/null +++ b/doc/forum/Bootstrapping_with_Cabal_on_Archlinux_fails/comment_1_80326b7fe6ea0f301872a02bb2462a5d._comment @@ -0,0 +1,13 @@ +[[!comment format=mdwn + username="rmunn@24f62461074e9165181dd6ec6ac66473353a24e9" + nickname="rmunn" + avatar="http://cdn.libravatar.org/avatar/5fb7a86e278e5b3b427f3b9a3cda71e1" + subject="One more thing" + date="2020-02-18T04:50:58Z" + content=""" +I haven't yet prepared a patch for this, but in src/Propellor/Bootstrap.hs, the `archlinuxdeps Cabal` list of should have `\"haskell-type-errors\"` added to it. That's the name of the Archlinux package for [https://hackage.haskell.org/package/type-errors](https://hackage.haskell.org/package/type-errors). Without that package, Cabal has to download type-errors and its dependencies before building Propellor, but with that package added, Archlinux's package manager can manage that package (and keep it up-to-date) instead. + +With that one change, the `archlinuxdeps Cabal` list is complete (at least as of yesterday when I tested it). + +I'll prepare a patch for this and submit it to propellor@joeyh.name soon. +"""]] -- cgit v1.2.3 From ad4753cb34aa055b8163d7a9176ea08b89f7c95a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 20 Feb 2020 14:14:40 -0400 Subject: comment --- ...ent_2_ee81823a34396b98cda15282019dcafc._comment | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 doc/forum/Bootstrapping_with_Cabal_on_Archlinux_fails/comment_2_ee81823a34396b98cda15282019dcafc._comment diff --git a/doc/forum/Bootstrapping_with_Cabal_on_Archlinux_fails/comment_2_ee81823a34396b98cda15282019dcafc._comment b/doc/forum/Bootstrapping_with_Cabal_on_Archlinux_fails/comment_2_ee81823a34396b98cda15282019dcafc._comment new file mode 100644 index 00000000..c5b85e05 --- /dev/null +++ b/doc/forum/Bootstrapping_with_Cabal_on_Archlinux_fails/comment_2_ee81823a34396b98cda15282019dcafc._comment @@ -0,0 +1,30 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 2""" + date="2020-02-20T17:47:46Z" + content=""" +Seems odd that the way Arch has installed ghc would +make `cabal install` fail without additional options being added very time. +That does not strike me as a good decision if it's the case. I guess that +the -dynamic should only be set on Arch, since only it has inflicted this +problem on itself. + +Would appreciate a patch with the ghc 8.8 fixes. + +I would not be surprised if cabal new-build does not provide any good way +to find out where the executable was put, because after all cabal build +doesn't either (just it's easier to guess there). Cabal expects a workflow +where that's followed by cabal install, or cabal run. + +This might be one way: `cabal new-install --symlink-bindir=.` +But with my older version of cabal, that seems to not actually work, +indeed I can't get it to install the binaries anywhere. Maybe it does +work with the newer cabal where new-install is the default. + +Needing to detect whether new-build was used or not is an added +complication. + +Best way I've found: + + find dist-newstyle/ -executable -type f |grep 'propellor$' +"""]] -- cgit v1.2.3 From 981a8d03fd2336e07b2ee23f68109626d0b2b614 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Tue, 25 Feb 2020 13:45:35 +0700 Subject: Allow building with GHC 8.8 --- src/Propellor/Property/Installer/Target.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Propellor/Property/Installer/Target.hs b/src/Propellor/Property/Installer/Target.hs index c6889dc5..ce4bfed5 100644 --- a/src/Propellor/Property/Installer/Target.hs +++ b/src/Propellor/Property/Installer/Target.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE TypeOperators, RankNTypes, TypeFamilies, FlexibleContexts #-} -- | Installation to a target disk. -- -- cgit v1.2.3 From c6d1482a2b6552a21903d3d4e3dccc39131a17e8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 25 Feb 2020 17:08:52 -0400 Subject: changelog --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index ae7502dc..31826ca6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,7 @@ propellor (5.10.2) UNRELEASED; urgency=medium + * Fix build with ghc 8.6.3. + Thanks, Robin Munn * Bootstrap: Fix typo in Arch Linux dependencies. Thanks, Robin Munn -- cgit v1.2.3 From 97714fbd7ff635545348ef78d3c763f79db07dc4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 25 Feb 2020 17:29:56 -0400 Subject: comment --- .../comment_3_41d73c97ed105aad773027d64e66cc38._comment | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 doc/forum/Bootstrapping_with_Cabal_on_Archlinux_fails/comment_3_41d73c97ed105aad773027d64e66cc38._comment diff --git a/doc/forum/Bootstrapping_with_Cabal_on_Archlinux_fails/comment_3_41d73c97ed105aad773027d64e66cc38._comment b/doc/forum/Bootstrapping_with_Cabal_on_Archlinux_fails/comment_3_41d73c97ed105aad773027d64e66cc38._comment new file mode 100644 index 00000000..f742280f --- /dev/null +++ b/doc/forum/Bootstrapping_with_Cabal_on_Archlinux_fails/comment_3_41d73c97ed105aad773027d64e66cc38._comment @@ -0,0 +1,13 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 3""" + date="2020-02-25T21:22:22Z" + content=""" +Ghc 8.8 is fixed thanks to your patch. + +I was curious how cabal build failed w/o -dynamic, and found +this +which includes a simple change that the archlinux maintainers +could make if they didh't want this to be a self-inflicted wound +on their users. +"""]] -- cgit v1.2.3 From 61b26e25263d2864a9a77447670c529e15706ed8 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Thu, 5 Mar 2020 10:33:52 +0700 Subject: Add haskell-type-errors package on Arch Linux --- src/Propellor/Bootstrap.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Propellor/Bootstrap.hs b/src/Propellor/Bootstrap.hs index 746cf54e..d772d7c7 100644 --- a/src/Propellor/Bootstrap.hs +++ b/src/Propellor/Bootstrap.hs @@ -201,6 +201,7 @@ depsCommand bs msys = "( " ++ intercalate " ; " (go bs) ++ ") || true" , "haskell-stm" , "haskell-text" , "haskell-hashable" + , "haskell-type-errors" ] archlinuxdeps Stack = [ "gnupg" -- cgit v1.2.3 From cc3289f70f09d2fa061cc21e47ea44d4b374dadd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 5 Mar 2020 00:15:38 -0400 Subject: changelog --- debian/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/changelog b/debian/changelog index 31826ca6..22987327 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ propellor (5.10.2) UNRELEASED; urgency=medium Thanks, Robin Munn * Bootstrap: Fix typo in Arch Linux dependencies. Thanks, Robin Munn + * Bootstrap: Add haskell-type-errors package on Arch Linux. + Thanks, Robin Munn -- Joey Hess Sun, 16 Feb 2020 12:37:10 -0400 -- cgit v1.2.3