Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Dynamic status indicator for parallel install #975

Open
23Skidoo opened this Issue · 2 comments

2 participants

@23Skidoo
Collaborator

While the output of cabal install in the parallel case was improved recently, it can still be made better. As described in #440, we want to implement a dynamically-updated status indicator (similar to Gentoo's emerge UI) that would show the number of packages that are being processed, that are already installed and that have failed; possibly also their names.

If we opt to also use the dynamic status indicator for sequential install, we'll have to get rid of or modify the internal setup method since it doesn't support build logging.

One related issue that @dcoutts mentions here is that printing of the last 10 lines of the build log for each failed package should be done during the post-install step (currently it's done in executeInstallPlan).

@23Skidoo
Collaborator

Related: #1062

@23Skidoo 23Skidoo was assigned
@dag
dag commented

Just in case not everyone was aware; the simplest way to do this is by printing carriage returns. On terminals this moves the cursor to the beginning of the line without starting a new line, and you can then write over the previous content. It's also best to pad it with spaces to the length of the previous content.

I have no idea if this works in cmd.exe though.

@ghorn ghorn referenced this issue from a commit in ghorn/cabal
@ghorn ghorn put executeInstallPlan into newly created Shell monad (#975)
The Shell monad is basically an IO monad which carries around the state
of the parallel install. It is an instance of MonadIO but you print output
through with special commands warn', notice', info', etc which will in the
future be redirected to write a nice UI.

Shell can also be forked with forkIO'.

This adds dependencies on transformers (which was already implied by the mtl
dependency) and exceptions (which is new but has no additional dependencies).
0a3e9c6
@ghorn ghorn referenced this issue from a commit in ghorn/cabal
@ghorn ghorn put executeInstallPlan into newly created Shell monad (#975)
The Shell monad is basically an IO monad where you print output to the terminal
through with special commands warn', notice', info', etc. It is an instance of
MonadIO but you must not use this to print to the terminal.

Shell can be forked with forkIO'.

This adds dependencies on transformers (which was already implied by the mtl
dependency) and exceptions (which is new but has no additional dependencies).

This commit does the boring liftIO stuff, and puts Verbosity in Shell
as a ReaderT-like value. The commands warn', notice', info', etc are just
wrappers around the old values.
2c6629e
@ghorn ghorn referenced this issue from a commit in ghorn/cabal
@ghorn ghorn Shell tracks package-level progress in parallel builds (#975)
This only uses existing cabal machinery to track package-level progress.
Nothing here tracks module-level progress.
71e7af5
@ghorn ghorn referenced this issue from a commit in ghorn/cabal
@ghorn ghorn add module-level progress to Shell (#975)
Because we call ghc --make, I am making a sort of tee and parsing
the output for package-level progress. Parse failures are handled
as described in the comments on `parseBuildLine`
b169d00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.