diff options
Diffstat (limited to 'doc')
3 files changed, 71 insertions, 0 deletions
diff --git a/doc/forum/Modules_with_Multiple_cmdProperty_causing_build_failures.mdwn b/doc/forum/Modules_with_Multiple_cmdProperty_causing_build_failures.mdwn new file mode 100644 index 00000000..57737b6d --- /dev/null +++ b/doc/forum/Modules_with_Multiple_cmdProperty_causing_build_failures.mdwn @@ -0,0 +1,24 @@ +I have module that I'm trying to write, which is always failing to build when ever I add a second (or more) cmdProperty to it. + +I've tried a variety of ways to write the module but clearly my limited Haskell skills are causing me to reach the barrier of ignorance which I'm failing to penetrate. + +The module is Pebble.hs and can be found here: + +<https://git.mcwhirter.io/craige/propellor-mio/blob/master/src/Propellor/Property/SiteSpecific/Pebble.hs> + +I'm hoping to shape that up into an upstream contribution, at some point :-) + +I've tried quite a few variations of: + + sdk :: Property UnixLike|DebianLike -- (with and without HasInfo) + sdk = propertyList|combineProperties ("Pebble SDK") $ props + +I've compared it over and over again to examples in JoeySites and my own working modules ie: + +<https://git.mcwhirter.io/craige/propellor-mio/blob/master/src/Propellor/Property/SiteSpecific/OwnCloud.hs> + +As I uncomment an additional cmdProperty, the build of Pebble.hs fails. + +At a loss, cluebat blows greatly appreciated. + +Most recent build output is here <https://git.mcwhirter.io/snippets/5> with [Line 95](https://git.mcwhirter.io/snippets/5#L95) being the point of interest, I think. diff --git a/doc/forum/Modules_with_Multiple_cmdProperty_causing_build_failures/comment_1_38050ca3503a6286b60f4bfc640f008e._comment b/doc/forum/Modules_with_Multiple_cmdProperty_causing_build_failures/comment_1_38050ca3503a6286b60f4bfc640f008e._comment new file mode 100644 index 00000000..fd6005a1 --- /dev/null +++ b/doc/forum/Modules_with_Multiple_cmdProperty_causing_build_failures/comment_1_38050ca3503a6286b60f4bfc640f008e._comment @@ -0,0 +1,36 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2016-09-20T15:14:19Z" + content=""" +The compiler error message here is not nice; if +[[todo/use_ghc_8.0_custom_compile_errors]] is able to be implemented some +time, I'd hope for a error message more like: + + Couldn't match Property DebianLike with UncheckedProperty UnixLike + Perhaps you forgot to use `changesFile` or `assume MadeChange`? + +Instead of the current mess which has a lot of bloat from type families. +The meat of the error is here: + + src/Propellor/Property/SiteSpecific/Pebble.hs:29:5: + Couldn't match type ‘Propellor.PropAccum.GetMetaTypes + (CombinedType (UncheckedProperty UnixLike) (Property UnixLike))’ + with ‘Propellor.Types.Singletons.Sing y0’ + The type variable ‘y0’ is ambiguous + Expected type: Propellor.PropAccum.GetMetaTypes + (CombinedType (UncheckedProperty UnixLike) (Property UnixLike)) + Actual type: Propellor.Types.MetaTypes.MetaTypes y0 + +cmdProperty has type UncheckedProperty UnixLike; in order to get +a Property that runs a command, you have to provide some way of checking +if the command made a change to the system. + +Since running tar certianly changes the system, adding `assume MadeChange` +after it should do. + +Running pip install may not alwways change the system; it's up to you if +you want to do a real check for change there or again `assume MadeChange`. + +I think those two changes are all you'll need to get it to compile. +"""]] diff --git a/doc/forum/Systemd_container_pre-setup_properties/comment_2_92d1deb8cb4a913d30cbc94de4177575._comment b/doc/forum/Systemd_container_pre-setup_properties/comment_2_92d1deb8cb4a913d30cbc94de4177575._comment new file mode 100644 index 00000000..f5ceb075 --- /dev/null +++ b/doc/forum/Systemd_container_pre-setup_properties/comment_2_92d1deb8cb4a913d30cbc94de4177575._comment @@ -0,0 +1,11 @@ +[[!comment format=mdwn + username="andrew" + subject="comment 2" + date="2016-09-19T04:29:14Z" + content=""" +I’ve made the changes you’ve suggested, but I think I’ve run into that tricky bit that you were mentioning. I think I’ve figured out how chroots work in propellor, but I’m not seeing how you were thinking of referencing these extra properties. I know that chroots fork off a new propellor instance inside the chroot which get properties via a folder/hostname lookup in the configuration, but these include the systemd container properties as well. Were you thinking of isolating the container properties and move chroot properties to `hostProperties` or just the opposite? + +[Here](https://github.com/arcticwaters/propellor/commit/605af4cdcf76e728290d242675f3fa3fea9309b5) is what I’ve done so far minus much of the mess I made in `Chroot.hs`. + +I should mention that one unintended consequence of my code is that systemd containers now only accept `DebianLike` properties. This is fine for me and an implicit condition in the code, but isn’t strictly correct. I don’t know haskell or the codebase well enough to fix this. I suppose anyone who tried to use container images which weren't debian like already encountered this issue and made changes to the code base manually. +"""]] |
