Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combining databases #288

Open
dwincort opened this issue Feb 19, 2019 · 1 comment · May be fixed by #438
Open

Combining databases #288

dwincort opened this issue Feb 19, 2019 · 1 comment · May be fixed by #438

Comments

@dwincort
Copy link

Hi,

I'm trying to set up a local hoogle database for code that I'm working on. I'd like it to include all my dependencies as well as my own code. I can do

hoogle generate --local=. --database local.hoo

to construct a database of my stuff, and I can do

hoogle generate --local --database deps.hoo

to construct a database of my dependencies, but I can't figure out how to do one call to get both. Calling --local without arguments is a special case in the command line argument parsing, so doing:

hoogle generate --local --local=.

fails with the error

Starting generate
hoogle: : getDirectoryContents:openDirStream: does not exist (No such file or directory)

(Note the bonus colon there -- it's trying to find the directory named "".)

Searching online for help reveals that there used to be a combine feature, but it looks like that was removed in Hoogle 5.

Is there a Hoogle 5 way to combine databases? Or, is there a better way to generate a database like what I want?

Thanks!

@ndmitchell
Copy link
Owner

In Hoogle 5 there's no way to combine databases, and likely never will be - they throw away lots of the essential information during construction.

The Hoogle flags for specifying what goes in the database are woefully incomplete. There are comments in https://github.com/ndmitchell/hoogle/blob/master/src/Action/Generate.hs#L40 about a potential design, but it never got finished. Likely as not, you can't merge local and remote information - which is very sad. The part of the code that probably needs changing is https://github.com/ndmitchell/hoogle/blob/master/src/Action/Generate.hs#L200-L203 - observe that the absence of any local_ is used to trigger fetching from the remote. Patches and design ideas most welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants