#2630: installed packages should have a src-dirs field, for access to optionally
installed sources
------------------------------+---------------------------------------------
Reporter: claus | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: _|_
Component: GHC API | Version: 6.9
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Architecture: Unknown/Multiple
Os: Unknown/Multiple |
------------------------------+---------------------------------------------
Comment (by claus):
Replying to [comment:7 simonmar]:
> In fact GHC does keep track of the import hierarchy in the .hi files, so
you can do this using the GHC API (perhaps not everything you need is
exposed via the official parts of the API currently though).
Interesting. From `--show-iface`, I got the impression that cross-package
imports weren't tracked?
> > (b) even haddock needs package sources long enough to create its
`*.haddock` files, and if any of the dependencies was installed without
being haddocked, I need to be able to remedy that
>
> I don't buy this as an important use case. You should have Haddocked
the package when you installed it, or it should be possible to download
the package again, 'cabal haddock' and then install just the Haddock docs.
There is no guarantee that all installed packages were haddocked. These
days, one is locked into a specific haddock version, but I used to
experiment with several. When developing packages, I change and reinstall
them often, and I do sometimes keep separate package versions installed
with separate compiler versions, so I'd have to reconstruct the exact
package version and configuration options before trying to add haddocks.
If one wanted to apply the haddock shipping with one version of ghc to
sources hosted in another version of ghc, one would need access to the
sources.
> > For Ghc Api clients like Ghc, I'd hope that extracting the source dirs
from the package database, adding them to the import path and asking for
`-fforce-recomp` would be sufficient, or that `-fforce-recomp` would look
up the sources itself, but that might be optimistic?-)
>
> Sure you can put sources in your import path and then GHC will pick them
up instead of the package modules, no -fforce-recomp necessary. But I
think you're forgetting about the package metadata again - just having the
sources won't be enough in many cases.
I'm not that forgetful;-) cabal calls `ghc --make` after setting things
up, and at that stage, Ghc Api clients either have a chance, or they won't
work with any form of the source.
> > I'm not sure whether it would be sufficient, but is there any reason
not to have a `src-dirs` field in installed packages descriptions?
>
> I'm not convinced it's useful.
The point is to do the source download only once, then to cache the
sources somewhere safe, and to make sure that tools can find the sources
easily.
I don't understand what is wrong with wanting to have the sources of open-
source software available and easily accessible. But if you have
alternative suggestions for helping source-based tools along, I'd be
interested to hear them.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2630#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs