Why you want to build and install a bunch of libraries? You most likely don't want to do that.
I think I really do. Let's call my build #22 ghc-22export ghc-22 $HOME/code/HEAD-22/_build/stage1/bin/ghc
Then on any one of dozens of 5-line tests, given in tickets, I can sayghc-22 -c Foo.hsand ghc-22 already knows about base, ghc-internal, text, containers etc built by and for ghc-22. They are squirrelled away somewhere in $HOME/code/HEAD-22/_build
It's like "batteries included": I already have `base`
Now some has a test that needs `hspec`. I'd like to add `hspec` to the batteries in $HOME/code/HEAD-22/_build, so that after that I can always sayghc-22 -package hspec Foo.hsand away we go.
Yes I could make a cabal project for a 5-line test, but that's more keystrokes. Is it difficult to just get it to treat `hspec` the same way that it treats `base` or `containers`?
I know this isn't the intended use-case for cabal; it's just the use-case I have.
Thanks
Simon
On Fri, 10 Apr 2026 at 05:01, Oleg Grenrus via ghc-devs <ghc-devs@haskell.org> wrote:
_______________________________________________Why you want to build and install a bunch of libraries? You most likely don't want to do that.
If you want to play with particular GHC version, create an ordinary cabal package with dependencies you need, and point `cabal-install` to use your HOME/code/HEAD-22/_build/stage1/bin/ghc
There is nothing (noteworthy) special about `cabal repl -w $HOME/code/HEAD-22/_build/stage1/bin/ghc`; as long as `cabal-install` is concerned, it's just some GHC build.
- Oleg
On 4/8/26 17:43, Simon Peyton Jones via ghc-devs wrote:
Dear devs
I have thirty or so builds of GHC on my disk. Sometimes I want to use one build to build and install (for that build alone) a bunch of libraries. If I docabal install hspec -w $HOME/code/HEAD-22/_build/stage1/bin/ghcthen Cabal rightly warns me
Warning: The libraries were installed by creating a global GHC environmentfile at:/home/simonpj/.ghc/x86_64-linux-9.15.20260309/environments/default
The presence of such an environment file is likely to confuse or break otherQuestion: how can I install the libraries in the build tree for $HOME/code/HEAD-22?tools because it changes GHC's behaviour: it changes the default package setin ghc and ghci from its normal value (which is "all boot libraries"). GHCenvironment files are little-used and often not tested for.
After all, I think ghc-internal, base etc are all in that build-tree. Surely hspec can be too?
But how?
Thanks!
Simon
_______________________________________________ ghc-devs mailing list -- ghc-devs@haskell.org To unsubscribe send an email to ghc-devs-leave@haskell.org
ghc-devs mailing list -- ghc-devs@haskell.org
To unsubscribe send an email to ghc-devs-leave@haskell.org
_______________________________________________ ghc-devs mailing list -- ghc-devs@haskell.org To unsubscribe send an email to ghc-devs-leave@haskell.org