haskell-vim-now icon indicating copy to clipboard operation
haskell-vim-now copied to clipboard

hoogle data consumes a lot of space

Open harendra-kumar opened this issue 9 years ago • 11 comments

Installing haskell-vim-now consumed several GB of space on my VM. Most of it due to hoogle database creation. Should hoogle database creation be left to the user instead?

harendra-kumar avatar Feb 11 '16 23:02 harendra-kumar

That's odd, the hoogle database on my system is only 8.8mb.

One thing that takes up space is Stack's sandbox. It contains the packages needed to build the helper binaries for haskell-vim-now. However you'll need to build a Stack sandbox at some point anyway if you want to create haskell programs.

Can you supply more information about exactly which files/folders take up the most space and how much it is?

begriffs avatar Feb 12 '16 01:02 begriffs

I had stack installed and in heavy use already so I expected that it wouldn't consume any more space. I have seen the hoogle problem before as well. Here goes some du output:

cueball:~/.stack/snapshots/x86_64-linux/lts-5.2/7.10.3/share/x86_64-linux-ghc-7.10.3/hoogle-4.2.43(master)*$ du -sm databases/
1328    databases/
cueball:~/.stack/snapshots/x86_64-linux/lts-5.2/7.10.3/share/x86_64-linux-ghc-7.10.3/hoogle-4.2.43/databases(master)*$ du -sm downloads/
1293    downloads/

1.3 G in databases dir. Out of that almost all is in downloads. Let's see what's inside:

cueball:~/.stack/snapshots/x86_64-linux/lts-5.2/7.10.3/share/x86_64-linux-ghc-7.10.3/hoogle-4.2.43/databases/downloads(master)*$ du -sm *
1   base.txt
1   base.txt.cache
604 cabal
3   cabal.index
218 cabal.tar
11  cabal.tar.gz
278 hoogle
1   hoogle.index
153 hoogle.tar
27  hoogle.tar.gz
1   keyword.htm
1   keyword.htm.cache
1   platform.cabal
1   platform.cabal.cache

harendra-kumar avatar Feb 12 '16 02:02 harendra-kumar

I see what you mean!

$ du -d 1 -h ~/.stack/snapshots/x86_64-osx/lts-5.12/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases
 20K    ./snapshots/x86_64-osx/lts-5.12/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases/.shake
936M    ./snapshots/x86_64-osx/lts-5.12/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases/downloads
971M    ./snapshots/x86_64-osx/lts-5.12/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases

Oddly the .hoo databases aren't very big, it's that huge downloads directory. Maybe there's a way to find it and clean it up during haskell-vim-now install.

begriffs avatar May 25 '16 04:05 begriffs

It looks like Stack will soon handle hoogle. When this is merged https://github.com/commercialhaskell/stack/pull/1939 then we can add a key binding to run stack hoogle -- generate --local and remove the hoogle data from our installer.

begriffs avatar May 25 '16 04:05 begriffs

Will this be able to provide a "jump to definition" functionality? I'm really looking forward to that.

schell avatar Jul 13 '16 16:07 schell

Actually this functionality already exists. If you press ,tg (aka "leader Tag Generate") it uses codex to create a ctags file for your project and all the dependencies. If you then press CTRL-] on a symbol it will jump you to the definition, even in library files.

begriffs avatar Jul 13 '16 17:07 begriffs

YES! I was really hoping you were going to say that!

Coincidentally I had tried CTRL-] right before my first reply, but I had missed the ,tg step. This is great :)

schell avatar Jul 13 '16 18:07 schell

Do you think the ,tg step could be better communicated in the readme? If so, care to send a pull request to improve that?

begriffs avatar Jul 13 '16 18:07 begriffs

Done ;)

schell avatar Jul 13 '16 18:07 schell

Another thing to note is that ,tg does not work unless your current directory is the one which has .cabal file.

We can look for a .cabal in the parent dirs and generate tags if we find one rather than forcing the user to be in that same directory for generating tags.

harendra-kumar avatar Jul 14 '16 02:07 harendra-kumar

Thanks - I didn't run into that problem because other bad things happen when I start my editor in a directory other than the one with the .cabal file, so it's habitual that I always run vim from the project root.

schell avatar Jul 14 '16 04:07 schell