haskell-ide-engine icon indicating copy to clipboard operation
haskell-ide-engine copied to clipboard

README could use some information about compilation

Open flip111 opened this issue 4 years ago • 4 comments

I use visual studio code, i noticed in the debug window that a lot of stuff was being compiled by hie. The readme could mention that things needs to be compiled, that it takes some time, that it uses some disk space and where the compiled artifacts are being stored. Is this compilation sandboxed or does it interfere with regular project compilation ?

hie_compile_log.txt

There is probably some noise in that logfile from another project that was open in another window.

flip111 avatar Feb 04 '20 18:02 flip111

FYI, it uses either stack snapshots or the global cabal store, and unless there is a bug in either of them, it does not interfere with any other project.

fendor avatar Feb 04 '20 18:02 fendor

Well, it still changes the local .stack-work or dist-newstyle and potentially could change the previous manual build config. So the builds triggered by hie are not sandboxed and could affect local build dirs like a manual build. @flip111 do you think README should be updated with that info?

jneira avatar Feb 27 '20 06:02 jneira

I think it should because it raises a lot of questions for me.

  1. When compilation starts? Once? Always? Only when the project was not compiled before?
  2. Which compilation flags are used?

Especially when you want to use profiling in ghc, it's already a difficult situation because stack might not always rebuild when some flags are changed (there are discussions about this in stack github).

Now it's not clear how to compilation by hie can affect normal compilation of your project. If there are no effects the description in the readme can be minimal of course.

Further question is: why is compilation necessary ?


Maybe near, or instead, of this text from the readme

HIE will attempt to automatically detect your project configuration and set up the environment for GHC.

(what does "set up the environment" mean here??)

Something like this can be written:

HIE will attempt to automatically detect your project configuration and compile your program once to get all the type information. If you want to build the project with some specific flags you must do this before hie reads your project / stack clear and rebuild with the correct flags after / pass the flags into the hie configuration. If you have not build your project before manually first time usage of hie can be slow because the entire project needs to be compiled.

All things in highlight i don't know what it should be, but can be a suggestion for how to expand a little bit on this topic.

flip111 avatar Feb 27 '20 12:02 flip111

Ok, it is clear that we should add it to README to avoid unpleasant surprises, thanks for pointing it out!

jneira avatar Feb 27 '20 13:02 jneira