darcs

Patch 447 Generalize withSignalsBlocked and withGu... (and 2 more)

Title Generalize withSignalsBlocked and withGu... (and 2 more)
Superseder Nosy List kerneis
Related Issues
Status obsoleted Assigned To
Milestone

Created on 2010-11-04.14:40:55 by kerneis, last changed 2011-05-10.22:35:48 by darcswatch. Tracked on DarcsWatch.

Files
File name Status Uploaded Type Edit Remove
fix-test-issue1620.patch kerneis, 2010-11-04.15:37:15 text/x-patch
generalize-withsignalsblocked-and-withgutsof.dpatch kerneis, 2010-11-04.14:40:54 text/x-darcs-patch
resolve-issue332_-ask-to-record-if-tests-fail.dpatch kerneis, 2010-11-04.20:20:59 text/x-darcs-patch
unnamed kerneis, 2010-11-04.14:40:54
unnamed kerneis, 2010-11-04.20:20:59
See mailing list archives for discussion on individual patches.
Messages
msg12904 (view) Author: kerneis Date: 2010-11-04.14:40:54
Hi,

these 3 patches solve issue332 (ask to record if test fails).  Solving
this issue has required more work than expected because failing tests
used not to be signaled back to Record.lhs, throwing a generic
ExitFailure instead.

The first patch is used to allow accessing return values through
withSignalsBlocked and withGutsOf.  IMHO, it should be applied
regardless of what happens to the next two patches, but please review it
carefuly in case I got something wrong with the block/unblock couple.

The second patch gives more control on tests in finalizeRepositoryChanges.
Because of issue1988, Florent and I decided on IRC that the best
solution for now was to hide the changes behind an exception wrapper.
Therefore, this patch currently preserves backward-compatibility and
does not expose any new functionnality outside of Internal.hs.

The third patch effectively solves issue332.  Since issue1988 has not
been solved yet, I decided the cleanest way to go was to export the
modified finalizedRepositoryChanges' and use it in Record.lhs only.  The
long-term solution would be to expose the new version and use it
everywhere, but I do not feel confident enough to do that until
issue1988 is solved.  (I have done it for fun in my private repository,
but you really do not want to rely on something based on "grep" to
ensure no case has been forgotten).

I am not sure if the third patch should be included in darcs right now.
And I am not sure if we should keep the compatibility wrapper of the
second patch in the long-term (providing both interfaces) or completely
discard the old one.  But anyway, issue1988 should be fixed first.

This is my first substantial patch to darcs.  I would be glad to get any
feedback on style/effiency/etc.

Best,
              Gabriel

3 patches for repository http://darcs.net:

Thu Nov  4 12:45:45 CET 2010  Gabriel Kerneis <kerneis@pps.jussieu.fr>
  * Generalize withSignalsBlocked and withGutsOf

Thu Nov  4 13:49:38 CET 2010  Gabriel Kerneis <kerneis@pps.jussieu.fr>
  * Allow more control on tests run in finalizeRepositoryChanges
  
  Before this patch, tests run in finalizeRepositoryChanges either passed
  or killed darcs.  This blocked the resolution of issue332.
  
  This patch has two effects:
  - it adds a Bool parameter to finalizeRepositoryChanges to allow
    finalizing without running the tests (even if Test is present in the
    options of the repository),
  - it changes the return type of finalizeRepositoryChanges into IO(Either
    Int ()), where Int is the return code of the test in case it fails.
    The types of testAny, testRecorded and testTentative change
    accordingly.
  
  Note that currently, issue1988 prevents us from using IO(Either) safely.
  As a consequence, those changes are not yet exported. Backward-
  compatibility is preserved through the use of exceptionWrapper.  Once
  issue1988 is fixed, unwrapped finalizeRepositoryChanges' should replace
  finalizeRepositoryChanges.
  

Thu Nov  4 15:01:48 CET 2010  Gabriel Kerneis <kerneis@pps.jussieu.fr>
  * resolve issue332: ask to record if tests fail
  
  This patch is not as clean as possible, because of issue1988: it exports
  finalizeRepositoryChanges' whereas, in an ideal world, it should discard
  finalizeRepositoryChanges instead.  Since this cannot be done safely at
  the moment (ie. without the fear to miss some key compiler warnings), we
  shall live with this half-backed solution in the interim.
Attachments
msg12906 (view) Author: kerneis Date: 2010-11-04.15:37:15
Note that the third patch breaks cabal test:
'issue1620-record-lies-about-leaving-logfile.sh' fails.

The attached patch fixes this.
Attachments
msg12908 (view) Author: kerneis Date: 2010-11-04.20:20:59
On Thu, Nov 04, 2010 at 20:20:17 +0100, Florent Becker wrote:
> Please send such amendments either as a new darcs recorded patch, or
> just resend your old patch amend-recorded.

Here it is.

Best,
              Gabriel

1 patch for repository http://darcs.net:

Thu Nov  4 21:13:09 CET 2010  Gabriel Kerneis <kerneis@pps.jussieu.fr>
  * resolve issue332: ask to record if tests fail
  
  This patch is not as clean as possible, because of issue1988: it exports
  finalizeRepositoryChanges' whereas, in an ideal world, it should discard
  finalizeRepositoryChanges instead.  Since this cannot be done safely at
  the moment (ie. without the fear to miss some key compiler warnings), we
  shall live with this half-backed solution in the interim.
Attachments
msg12931 (view) Author: kerneis Date: 2010-11-06.14:59:08
Do not accept this patch in its current form please, it is being
discussed on IRC/ML to find a cleaner solution.
msg12937 (view) Author: kerneis Date: 2010-11-07.19:40:25
A new version of this patch has been sent separately (based on a
completely different idea).
History
Date User Action Args
2010-11-04 14:40:55kerneiscreate
2010-11-04 14:42:00darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-eb932673cca2538e3b102591a133ff5a08053c1e
2010-11-04 15:37:16kerneissetfiles: + fix-test-issue1620.patch
messages: + msg12906
2010-11-04 20:20:59kerneissetfiles: + resolve-issue332_-ask-to-record-if-tests-fail.dpatch, unnamed
messages: + msg12908
2010-11-04 20:22:16darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-eb932673cca2538e3b102591a133ff5a08053c1e -> http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-6edba876a624eb99df3efc4fcf9764372446bd04
2010-11-06 14:59:08kerneissetstatus: needs-screening -> followup-in-progress
messages: + msg12931
2010-11-07 19:40:25kerneissetstatus: followup-in-progress -> obsoleted
messages: + msg12937
2011-05-10 19:38:05darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-6edba876a624eb99df3efc4fcf9764372446bd04 -> http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-6edba876a624eb99df3efc4fcf9764372446bd04
2011-05-10 22:35:48darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-6edba876a624eb99df3efc4fcf9764372446bd04 -> http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-eb932673cca2538e3b102591a133ff5a08053c1e