From 30d03210f7ac5b12235760f625bac5ff3aa3f85a Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 16 Aug 2023 13:45:40 -0400 Subject: Log and return output to caller The main change here is 'puts' now returns a value, this enables me to collect the value from the conduit source while also doing stuff with it, like printing or logging it as I want. Previously I was running conduit over the source, *and then* kicking off the concurrent processes to wait for the process and collect the output. This would (I think) drain the source before it got to the 'puts' conduit run, and so I wouldn't be able to get the output streamed in real time. It took a lot of refactoring and exploratory programming to get to this relatively-small diff, but now puts works correctly. At least I think it does... it seems to work more reliably from ghci than from the shell. Maybe the shell or TERM is causing nix-store to do some buffering? Maybe I need to use the threaded runtime in GHC? Not sure, but I will look out for this issue and try to identify and fix. Update: yep it was the threaded runtime. I enabled that and now it works in the shell. I squashed that commit into this one. --- Biz/Bild/Deps/Haskell.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'Biz/Bild') diff --git a/Biz/Bild/Deps/Haskell.nix b/Biz/Bild/Deps/Haskell.nix index d8108d7..066fd86 100644 --- a/Biz/Bild/Deps/Haskell.nix +++ b/Biz/Bild/Deps/Haskell.nix @@ -27,6 +27,7 @@ with hpkgs; hashids haskeline hmacaroons + hostname http-types ixset katip -- cgit v1.2.3