sensei
sensei copied to clipboard
`autospec` doesn't pick up new packages in the package database
If you install a new package into the used package database while autospec
is running it doesn't pick up this new package. I guess this is because ghci
has to be restarted to scan the package database anew.
I'm not sure how this could be solved or if it should be solved at all. Restarting autospec
seems easy enough. It's just somewhat confusing if you're not aware of the behaviour.
Maybe autospec
could monitor the package database through inotify
.
Do you think there is a reliable way to determine the used package database?
Sent from my iPhone
On 18 Apr 2015, at 3:54 pm, Sönke Hahn [email protected] wrote:
If you install a new package into the used package database while autospec is running it doesn't pick up this new package. I guess this is because ghci has to be restarted to scan the package database anew.
I'm not sure how this could be solved or if it should be solved at all. Restarting autospec seems easy enough. It's just somewhat confusing if you're not aware of the behaviour.
Maybe autospec could monitor the package database through inotify.
— Reply to this email directly or view it on GitHub.
I don't know if there is a 100% reliable way. There is also the issue (as you mentioned offline) of packages installed by package managers. The thing is that it is not harmful to trigger restarts too often. So autospec
could just look in the usual places for package databases, i.e. in sandboxes in the current directory and ~/.ghc
.
I think I found a way to do this:
https://github.com/liqd/thentos/commit/5b45a6e38db2fd2dbcc9de70d869fbb7b0163cdb
It is not pretty, but I think it works:
- remove the packages you want to watch from the package database
- add cabal
Path_*
modules as explained in http://neilmitchell.blogspot.de/2008/02/adding-data-files-using-cabal.html - use
-i
to add source trees to the current package.