intellij-haskell icon indicating copy to clipboard operation
intellij-haskell copied to clipboard

Better progress reporting during initial tool setup

Open ForNeVeR opened this issue 3 years ago • 13 comments

On my machine, initial Haskell tool setup (after I've opened my first Haskell project) has taken about half an hour, and during all this time the only thing I was able to see was this spinning progress bar: image

I do believe we could improve the initial experience by:

  • separating this progress into stages (e.g. if, say, 7 libraries should be installed — then it should have 7 stages)
  • providing more useful information on every stage (I saw that stack usually prints the total progress to the console; IntelliJ-Haskell could extract this information and draw more accurate progress)
  • providing the real console output from the build tools (as I said, stack is pretty okay at reporting progress, and, as a user, I feel that I'm being "robbed" of this information by not providing me the standard console, and only utilizing this less informative progress spinner)

I use IntelliJ-Haskell 1.0.0.-beta74 build on Windows, with the latest release Stack version.

IntelliJ IDEA 2020.3 Snapshot (Ultimate Edition)
Build #IU-203.833, built on July 4, 2020
IntelliJ IDEA EAP User
Expiration date: August 3, 2020
Runtime version: 11.0.7+10-b974.1 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1450M
Cores: 8
Non-Bundled Plugins: Rider UI Theme Pack, com.jetbrains.embeddedProjectJdk, intellij.haskell, Jetbrains TeamCity Plugin, com.jetbrains.intellij.api.watcher

ForNeVeR avatar Jul 10 '20 15:07 ForNeVeR

Thanks for reporting!

separating this progress into stages (e.g. if, say, 7 libraries should be installed — then it should have 7 stages)

This is completely up to Stack, the plugin has no control. The only thing that plugin can do is parse the output of Stack.... and from that draw more detailed stages.

providing more useful information on every stage (I saw that stack usually prints the total progress to the console; IntelliJ-Haskell could extract this information and draw more accurate progress)

I don't see how to implement this, see also previous point.

providing the real console output from the build tools (as I said, stack is pretty okay at reporting progress, and, as a user, I feel that I'm being "robbed" of this information by not providing me the standard console, and only utilizing this less informative progress spinner)

The information in the progress bar of the background task is directly from Stack. I don't remove information from the Stack output.

Btw, I accept pull requests 😉

rikvdkleij avatar Jul 10 '20 17:07 rikvdkleij

Btw, I accept pull requests 😉

Which exactly was my intention. Thanks for answer!

ForNeVeR avatar Jul 11 '20 05:07 ForNeVeR

@ForNeVeR Do you intend to work on this? Otherwise I would suggest to close this issue.

rikvdkleij avatar Dec 20 '20 12:12 rikvdkleij

Why? Was the progress somehow improved? If not, it is still a big issue (I heard other users complaining about it), disregard if I intend to work on it or not.

(Though I still do.)

ForNeVeR avatar Dec 20 '20 13:12 ForNeVeR

Well, I don't know how to improve this because currently the output of Stack is shown to the user. The plugin doesn't remove info from the Stack output.

The Background task shows the information from Stack.

To see the output in a better way, one has enable the Event log.

rikvdkleij avatar Dec 20 '20 13:12 rikvdkleij

The plugin doesn't remove info from the Stack output.

That was already your point before, but I see better progress reporting if I run Stack in terminal than when I run it in the IntelliJ.

And I'm sure this should be improved. Initial installation can take hours on some machines. We definitely shouldn't leave the user without any clues on the progress for hours; this is nonsense.

Probably Stack either hides some useful information itself when it feels it's running in a non-interactive mode (which we should be able to beat e.g. by running it in a PTY), or interferes with the way IntelliJ-Haskell reads its optput (which would be the most positive, since is easy to fix), or has some command-line options for programmatic progress reporting (which we'll have to check).

If nothing else helps, we'll have to raise a feature request at Stack, at least.

ForNeVeR avatar Dec 20 '20 15:12 ForNeVeR

@ForNeVeR Thanks for your feedback!

Initial installation can take hours on some machines.

An option is increase the number of cores of the Stack command which installs the tools, see here http://github.com/rikvdkleij/intellij-haskell/blob/49a015e267ff3d241c12fa21cca0258754027525/src/main/scala/intellij/haskell/external/execution/StackCommandLine.scala#L82-L82. But I don't know if it will have negative side-effects on all kind of machines in general (making e.g. IntelliJ unresponsive).

The user has also the option to install the Haskell tools himself. E.g. by using Nix.

rikvdkleij avatar Dec 20 '20 15:12 rikvdkleij

but I see better progress reporting if I run Stack in terminal than when I run it in the IntelliJ.

That's weird. Also if you compare this output with the Event log? I never noticed this but I will pay attention to this.

rikvdkleij avatar Dec 20 '20 15:12 rikvdkleij

Just tested this with HLint. I don't see a difference in output between stack install hlint on the command line and the output I see in the Event log when I delete the cache. I'm using Ubuntu.

rikvdkleij avatar Dec 20 '20 16:12 rikvdkleij

An option is increase the number of cores of the Stack command which installs the tools, see here http://github.com/rikvdkleij/intellij-haskell/blob/49a015e267ff3d241c12fa21cca0258754027525/src/main/scala/intellij/haskell/external/execution/StackCommandLine.scala#L82-L82. But I don't know if it will have negative side-effects on all kind of machines in general (making e.g. IntelliJ unresponsive).

:+1: :+1: Oh yes, please can we do this (or have it an option)? :pray:

e.g. my new(ish) CPU has 24 (virtual) cores and using only 2 for big builds seems a real shame.

declension avatar Jul 16 '21 11:07 declension

@declension I can change the number of cores to use the half of the available cores?

rikvdkleij avatar Jul 31 '21 18:07 rikvdkleij

@declension I can change the number of cores to use the half of the available cores?

Yes this sounds like a great start! Probably 0.75 would be a safe number too, but let's start with half?

declension avatar Aug 02 '21 09:08 declension

@declension done in beta88, https://github.com/rikvdkleij/intellij-haskell/releases/tag/v1.0.0-beta88

rikvdkleij avatar Oct 02 '21 15:10 rikvdkleij