Among other features stack provides a clean and deep dependency management system that even takes care of installing toolchain (ghc, alex, happy, cabal...) in a segregated environment. Building remote propellor with stack would remove the limitation that code should be compilable with stock ghc from package manager. I have done some preliminary work on this feature in my github clone for propellor, currently from 2.17.2 branch (I wanted to reuse existing properties). The code is mostly in Bootstrap and is currently limited to linux systems. Adapting to FreeBsd should be straightforward as this is supported by slack and there are native builds available.
If there is interest in such a feature I would be happy to move it to HEAD and provide a patch.
I've implemented a bootstrapWith property, which can be added to a Host to make it use stack:
& bootstrapWith (Robustly Stack)
So, for a propellor install that uses stack entirely, use
stack install propellor
to install it to your laptop, usepropellor --init
to set up~/.propellor/config,hs
, and in the config file, add the above property to all your Hosts (perhaps usingmap
..).
stack install propellor
is already supported, and whenpropellor --init
detects it was installed that way, it will set up the user's propellor config to also be built using stack locally (viagit config propellor.buildsystem stack
).Supporting using stack to build propellor on the Host too is the missing part, and something I'd take a patch for.
Your patch as it stands discards the cabal support. But, I personally want to continue building propellor with cabal on my Hosts, at least until stack is available in Debian stable, and probably longer. (I use Debian's ghc and haskell packages for other things on my hosts, so using stack would waste disk space.)
I feel there needs to be a way to configure this. It would probably be fine to use stack on the remote host if the local propellor repository has
git config propellor.buildsystem stack
set. Or perhaps it should be configured in the config.hs.OK. Indeed my patch is a bit brutal, that's one reason I have not proposed it straight away
I understand the rationale behind being flexible in how to build locally and remotely. Using a git config property seems pretty straightforward but I don't see how to do it within
config.hs
. Any suggestion?precompiled
branch of Joey's repository.Following spwhitton's idea, this would involve adding a new property which configures the host it's attached to to build propellor using stack.
This can be accomplished by having the property set some Info which can be looked at when propellor is deploying itself to the host, as shown in the precompiled branch.
I guess most people who want to build propellor with stack would want to do that on all hosts. You could have a
[Host] -> [Host]
function that added the stack property to a list of hosts I suppose.