summaryrefslogtreecommitdiff
path: root/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable
diff options
context:
space:
mode:
Diffstat (limited to 'doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable')
-rw-r--r--doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_10_eb58216ef1172ee5b882090dab7219ce._comment32
-rw-r--r--doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_11_bee4b2397dfb28a3791081a83d725daf._comment7
-rw-r--r--doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_12_1e09f5a3f4565a9392d7b50b703a8a69._comment17
-rw-r--r--doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_13_54de6d1c5351e9303c190edda7e7a33f._comment7
-rw-r--r--doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_1_88f5d79b8cd6064d1a65dec445819afe._comment14
-rw-r--r--doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_2_23cb35130719bf1657652b76c0791947._comment10
-rw-r--r--doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_3_5759b4fddf360e8a777c0339c5426b40._comment9
-rw-r--r--doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_4_cd49645ff94d9ccec74ff72a836cd1f7._comment20
-rw-r--r--doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_5_33744064a8b224d6e44e2cf8081f6a56._comment9
-rw-r--r--doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_6_db48a08bc6eece590aebd41691623665._comment7
-rw-r--r--doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_7_9c45f473cbc432a32bd64bbbf048fae4._comment21
-rw-r--r--doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_8_7069f68888663fef109b82a044aeb5e1._comment9
-rw-r--r--doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_9_5694c0bec217d3513aa8e80f55482d75._comment17
13 files changed, 179 insertions, 0 deletions
diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_10_eb58216ef1172ee5b882090dab7219ce._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_10_eb58216ef1172ee5b882090dab7219ce._comment
new file mode 100644
index 00000000..3799a012
--- /dev/null
+++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_10_eb58216ef1172ee5b882090dab7219ce._comment
@@ -0,0 +1,32 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 10"""
+ date="2015-12-03T15:05:21Z"
+ content="""
+
+ trivial (trivial p `changesFile` f) `changesFile` f'
+
+The parenthesized property here is all marked trivial, so a change to f
+won't result in MadeChange, though a change to f' will.
+
+The only way propellor might intercept the output of a program is if you're
+using the new Concurrent module. In that case it should buffer program output
+and display it all at once. There could potentially be a bug there that
+hid program output. I certianly can't reproduce changesFile hiding the output
+of a program:
+
+ *Propellor.Property.Apt> runPropellor (Host "localhost" [] mempty) $ ensureProperty $ trivial (buildDep ["git-annex"]) `changesFile` "/var/lib/dpkg/status"
+ Reading package lists... Done
+ Building dependency tree
+ Reading state information... Done
+ 0 upgraded, 0 newly installed, 0 to remove and 707 not upgraded.
+ NoChange
+
+ *Propellor.Property.Apt Propellor.Property.Concurrent> withConcurrentOutput $ runPropellor (Host "localhost" [] mempty) $ ensureProperty $ (trivial (buildDep ["git-annex"]) `changesFile` "/var/lib/dpkg/status") `concurrently` cmdProperty "echo" ["hi"]
+ hi
+ Reading package lists...
+ Building dependency tree...
+ Reading state information...
+ 0 upgraded, 0 newly installed, 0 to remove and 707 not upgraded.
+ MadeChange
+"""]]
diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_11_bee4b2397dfb28a3791081a83d725daf._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_11_bee4b2397dfb28a3791081a83d725daf._comment
new file mode 100644
index 00000000..f4df5527
--- /dev/null
+++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_11_bee4b2397dfb28a3791081a83d725daf._comment
@@ -0,0 +1,7 @@
+[[!comment format=mdwn
+ username="spwhitton"
+ subject="comment 11"
+ date="2015-12-03T23:29:57Z"
+ content="""
+Thank you for your feedback. I'll think about how I might rewrite `changeIfChanges` to avoid that problem with `trivial`, and I'll try to pin down the hiding of apt's output.
+"""]]
diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_12_1e09f5a3f4565a9392d7b50b703a8a69._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_12_1e09f5a3f4565a9392d7b50b703a8a69._comment
new file mode 100644
index 00000000..3db6fd1b
--- /dev/null
+++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_12_1e09f5a3f4565a9392d7b50b703a8a69._comment
@@ -0,0 +1,17 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 12"""
+ date="2015-12-05T22:52:42Z"
+ content="""
+I had a thought about this;
+[[trivial is a code smell|type-level_trivial_avoidance]] and adding
+UncheckedProperty type avoids needing to use trivial.
+
+So, now cmdProperty, runApt, and other things that make a Property but
+can't really detect when it MadeChange can instead make an
+UncheckedProperty, and changesFile is one of the ways to convert that into
+a Property.
+
+My implementation also allows applying changesFile multiple times, to
+detect a change to multiple files.
+"""]]
diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_13_54de6d1c5351e9303c190edda7e7a33f._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_13_54de6d1c5351e9303c190edda7e7a33f._comment
new file mode 100644
index 00000000..72f6bf40
--- /dev/null
+++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_13_54de6d1c5351e9303c190edda7e7a33f._comment
@@ -0,0 +1,7 @@
+[[!comment format=mdwn
+ username="spwhitton"
+ subject="comment 13"
+ date="2015-12-06T17:17:34Z"
+ content="""
+Very nice. Thank you for writing it up in full so Haskell beginners like me can learn about the flexibilities and limitations of programming with Haskell types.
+"""]]
diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_1_88f5d79b8cd6064d1a65dec445819afe._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_1_88f5d79b8cd6064d1a65dec445819afe._comment
new file mode 100644
index 00000000..209b62a3
--- /dev/null
+++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_1_88f5d79b8cd6064d1a65dec445819afe._comment
@@ -0,0 +1,14 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2015-11-26T11:14:37Z"
+ content="""
+Looks like Build-Depends-Index is not handled, nor are 'a | b' build deps,
+or arch-specific build deps. Since versions are skipped, if a build dep
+needed a newer version, the property also wouldn't try to upgrade to it
+after this change.
+
+I feel that parsing build deps is too complex for propellor.
+
+It might work to somehow detect if apt has made any changes.
+"""]]
diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_2_23cb35130719bf1657652b76c0791947._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_2_23cb35130719bf1657652b76c0791947._comment
new file mode 100644
index 00000000..ace80098
--- /dev/null
+++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_2_23cb35130719bf1657652b76c0791947._comment
@@ -0,0 +1,10 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 2"""
+ date="2015-11-26T12:48:25Z"
+ content="""
+How about simply checking if /var/lib/dpkg/status is changed?
+
+I added a `changesFile` property combinator which should be helpful for
+that.
+"""]]
diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_3_5759b4fddf360e8a777c0339c5426b40._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_3_5759b4fddf360e8a777c0339c5426b40._comment
new file mode 100644
index 00000000..86f4d1de
--- /dev/null
+++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_3_5759b4fddf360e8a777c0339c5426b40._comment
@@ -0,0 +1,9 @@
+[[!comment format=mdwn
+ username="spwhitton"
+ subject="comment 3"
+ date="2015-11-26T14:39:31Z"
+ content="""
+I was hoping your deep knowledge of Apt would be able to help with this!
+
+Before I proceed, how would you feel about catching the output of apt and only printing it if apt did make changes? Although that would make the output weirdly appear all at once when the build deps are actually installed, on the other hand it would mean no output if they're not, when we detect no changes to /var/lib/dpkg/status.
+"""]]
diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_4_cd49645ff94d9ccec74ff72a836cd1f7._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_4_cd49645ff94d9ccec74ff72a836cd1f7._comment
new file mode 100644
index 00000000..30149a4c
--- /dev/null
+++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_4_cd49645ff94d9ccec74ff72a836cd1f7._comment
@@ -0,0 +1,20 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 4"""
+ date="2015-11-30T16:57:45Z"
+ content="""
+I think it would probably depend on the user when that makes sense to do.
+If I'm installing build deps over a slow network connection, I'd like to
+see the output.
+
+It would be awesome if this transformation could be applied to any
+arbitrary Property. I don't immediately know how to do that, although it
+seems useful that all process spawning already goes through
+concurrent-output, which can buffer the output and display it only when the
+command finishes.
+
+Perhaps an extension to concurrent-ouput could let it buffer the output
+of all commands run by a property and then discard the buffer if the
+property finished with NoChange. But I don't see a way to make this work
+when multiple properties are being run concurrently.
+"""]]
diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_5_33744064a8b224d6e44e2cf8081f6a56._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_5_33744064a8b224d6e44e2cf8081f6a56._comment
new file mode 100644
index 00000000..b0283161
--- /dev/null
+++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_5_33744064a8b224d6e44e2cf8081f6a56._comment
@@ -0,0 +1,9 @@
+[[!comment format=mdwn
+ username="spwhitton"
+ subject="comment 5"
+ date="2015-12-02T04:46:14Z"
+ content="""
+I've made a property combinator `noChangeIfUnchanged` and applied it to Apt.buildDep in my `builddepfix` branch. Please take a look.
+
+In my testing of this, Propellor hides the output if the build deps are already installed i.e. if the property returns NoChange. So it looks like you've already implemented your awesome at some point :)
+"""]]
diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_6_db48a08bc6eece590aebd41691623665._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_6_db48a08bc6eece590aebd41691623665._comment
new file mode 100644
index 00000000..85c91d65
--- /dev/null
+++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_6_db48a08bc6eece590aebd41691623665._comment
@@ -0,0 +1,7 @@
+[[!comment format=mdwn
+ username="spwhitton"
+ subject="comment 6"
+ date="2015-12-02T04:57:57Z"
+ content="""
+Seems I blanked on your `changesFile` combinator when I sat down to write mine. Taking a look now, my approach is much more direct for cases like `Apt.buildDep` when the problem is registering a change when there should be NoChange, whereas I think the intention of your changesFile is the opposite case. Though it might be nice to combine them. Let me know what you think.
+"""]]
diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_7_9c45f473cbc432a32bd64bbbf048fae4._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_7_9c45f473cbc432a32bd64bbbf048fae4._comment
new file mode 100644
index 00000000..e2611fd5
--- /dev/null
+++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_7_9c45f473cbc432a32bd64bbbf048fae4._comment
@@ -0,0 +1,21 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 7"""
+ date="2015-12-02T16:10:34Z"
+ content="""
+The two combinators are indeed very similar. The reason I wrote
+changesFile the way I did is that that allows it to be applied repeatedly
+when a property can change any of several files.
+
+ trivial someprop
+ `changesFile` "foo"
+ `changesFile` "bar"
+
+That seems fairly likely to come up, while it would be unusual for a
+property to have to change multiple files at once to be considered
+to make a change at all, which is what multiple applications of
+`noChangeIfUnchanged` leads to.
+
+But neither combinator causes apt's output to not be displayed,
+which is what I thought we were talking about.
+"""]]
diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_8_7069f68888663fef109b82a044aeb5e1._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_8_7069f68888663fef109b82a044aeb5e1._comment
new file mode 100644
index 00000000..c05d6255
--- /dev/null
+++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_8_7069f68888663fef109b82a044aeb5e1._comment
@@ -0,0 +1,9 @@
+[[!comment format=mdwn
+ username="spwhitton"
+ subject="comment 8"
+ date="2015-12-02T21:44:37Z"
+ content="""
+My original goal was to have `Apt.buildDep` return NoChange if the build deps are already installed. As a welcome but unexplained side-effect, on my system `noChangeIfUnchanged` *does* cause apt's output not to be displayed.
+
+I'll think about ways to combine our two combinators.
+"""]]
diff --git a/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_9_5694c0bec217d3513aa8e80f55482d75._comment b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_9_5694c0bec217d3513aa8e80f55482d75._comment
new file mode 100644
index 00000000..5783dd7b
--- /dev/null
+++ b/doc/todo/pull_request:_patch_Apt.buildDep_to_only_proceed_if_installable/comment_9_5694c0bec217d3513aa8e80f55482d75._comment
@@ -0,0 +1,17 @@
+[[!comment format=mdwn
+ username="spwhitton"
+ subject="comment 9"
+ date="2015-12-03T02:08:58Z"
+ content="""
+I can get what I want if I use `trivial` and `changesFile` in the way you described. So please consider adding your method as a combinator:
+
+ p `changeIfChanges` f = (trivial p) `changesFile` f
+
+which is okay because `trivial` is idempotent so `changeIfChanges` may be applied more than once (I've got this in my branch with a decent docstring and I've applied it to `Apt.buildDep`).
+
+I think that this ought to be its own combinator, rather than just a recommendation to use `trivial` and `changesFile` in such cases, because this doesn't follow the semantics of `trivial`: it's not necessarily the case that it is the same amount of work to check if the property needs to be ensured as it is to ensure it.
+
+(In this language, my `noChangeIfUnchanged` could be called `changeOnlyIfChanges`. I agree that it's very unlikely to useful.)
+
+(Again, on my machine, applying `changeIfChanges` to `Apt.buildDep` magically hides apt's output if the build-deps are already installed.)
+"""]]