Patch 2291 make --timings more useful (and 1 more)

Title make --timings more useful (and 1 more)
Superseder Nosy List bfrk
Related Issues
Status accepted Assigned To

Created on 2023-03-27.18:37:50 by bfrk, last changed 2023-07-01.20:00:05 by ganesh.

File name Status Uploaded Type Edit Remove
make-__timings-more-useful.dpatch bfrk, 2023-03-27.18:37:43 application/x-darcs-patch
patch-preview.txt bfrk, 2023-03-27.18:37:43 text/x-darcs-patch
See mailing list archives for discussion on individual patches.
msg23208 (view) Author: bfrk Date: 2023-03-27.18:37:43
2 patches for repository http://darcs.net/screened:

patch e3c419a74904ab499e020df869ce09ded0ce1976
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Mar 12 09:57:11 CET 2023
  * make --timings more useful

  It now prints timestamps relative to program start (more precisely: when
  setTimingsMode is called) in a suitable format (mm:ss.microseconds).

patch dc1f597e0c48fec5a415d6e5f0bcd342f5717331
Author: Ben Franksen <ben.franksen@online.de>
Date:   Sun Mar 12 10:55:16 CET 2023
  * progress reporting: fix for non-native Windows terminals and simplify

  The fix is to not rely on hIsTerminalDevice which does not work correctly on
  Windows with non-native terminals, such as MinTTY used in MSYS and Cygwin
  environments. Instead decide based on the result of the 'size' procedure
  from terminal-size. Also, don't print any progress messages if that returns
  Nothing, instead of falling back to putStrLn.

  The simplification is to print progress messages to stdout rather than
  stderr and to never add timestamps. Rationale: timestamps are for debugging
  and useless in progress reports; whereas progress messages are an indication
  to regular users using an interactive shell.

  Note that if stdout is redirected then it is no longer a terminal device and
  therefore progress messages are automatically turned off, which incidentally
  fixes issue1822. This is important when you run darcs commands from a cron
  job: in that case you do NOT want to redirect stderr, so that the system
  sends you an email when something goes wrong.
msg23357 (view) Author: bfrk Date: 2023-06-23.10:40:35
I am self-accepting this one and will push the second patch to 
reviewed in order to fix issue2706
msg23398 (view) Author: ganesh Date: 2023-06-24.20:11:24
>  * make --timings more useful

> _timingsMode = unsafePerformIO $ newIORef Nothing

I think this needs a {-# NOINLINE #-}

Rest of this looks fine.
msg23430 (view) Author: bfrk Date: 2023-06-25.23:04:29
The NOINLINE pragma is (still) there (after the function definition). 
I think you were confused because 'timingsMode' (without the 
underline) has been removed.
msg23431 (view) Author: ganesh Date: 2023-06-25.23:06:36
Oops, sorry, yes.
Date User Action Args
2023-03-27 18:37:51bfrkcreate
2023-03-27 18:39:49bfrksetstatus: needs-screening -> needs-review
2023-06-23 10:40:36bfrksetmessages: + msg23357
2023-06-24 20:11:25ganeshsetstatus: needs-review -> review-in-progress
messages: + msg23398
2023-06-25 23:04:29bfrksetmessages: + msg23430
2023-06-25 23:06:36ganeshsetstatus: review-in-progress -> accepted-pending-tests
messages: + msg23431
2023-07-01 20:00:05ganeshsetstatus: accepted-pending-tests -> accepted