I would like to define my propellor configuration using propellor as a library dependency, which removes the need to fork source repo, merge...
I encounter an issue when trying to use propellor in that way: Everything under Utility/
is not exported by the propellor, so cannot be used from my own properties. This is annoying because there are interesting things to build properties, like running processes...
Would you consider exposing those modules, maybe through some other module like Propellor.Utility
?
The Utility.* modules are shared amoung several of my projects (git-annex, propeller, github-backup, ..), but I'm not really happy enough with them to make them a proper haskell library.
For one thing, there's no unifying principle; it's just whatever bits of code I happened to write that were refactorable out of the main program. I don't want to end up with another MissingH like tarball library here.
And for another thing, I don't think I want to commit to api stability, or even api versioning for all of that stuff.
Some parts of it, I'm somewhat happier with, and hope to eventually break out into proper haskell libraries. For example, Utility.Scheduled is pretty good (and mostly re-exported from Propellor.Property.Scheduled anyway).
OTOH, Utility.Process .. not happy with that at all from a design POV. I'd recommend you just use System.Process, or Data.Streaming.Process. Although there is the problem that
PROPELLOR_DEBUG
relies on Utility.Process adding calls to debugging functions, so you'd need to do that by hand.Maybe what makes sense is for some part of propellor to re-export qualified subsets of
Utility.*
, on a case-by-case basis as users find need for them. I counted the Utility imports inside Propellor.Property, they are:So, I'm inclined to have Propellor.Property.Cmd re-export Utility.SafeCommand, and leave it at that for now. It makes sense that propellor export a primitive that runs a command to a Bool, does any requested debug output, for use by the many Properties that involve running commands.
(If you want to break out some part of Utility into a separate library and maintain it, I'd be ok with that too.)
boolSystem
fromUtility.SafeCommand
. We also usetranscript
to retrieve output of a process. So you say it is better to use directlySystem.Process
?I have made Propellor.Property.Cmd re-export the wrapped createProcess that does debug logging.
I can see how processTranscript would be useful. I'm on the fence about re-exporting that one.
I am reviving that old thread because I upgraded my configuration to use recent propellor and moved some part of our system to use propellor as a library, and it failed building propellor on the remote configured host due to dependencies version conflict. Here is the output:
Am I missing something?