[GHC] #7779: building GHC overwrites the installed package database if GHC_PACKAGE_PATH is set

#7779: building GHC overwrites the installed package database if GHC_PACKAGE_PATH is set -----------------------------+---------------------------------------------- Reporter: heatsink | Owner: Type: bug | Status: new Priority: normal | Component: Build System Version: 7.4.2 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- When building GHC, if `GHC_PACKAGE_PATH` is set to a single path, then the build process will register packages in that path instead of in the build tree. Since `GHC_PACKAGE_PATH` points to the host compiler's package database, the build system overwrites the host compiler's package database, rendering the host compiler unusable. To reproduce: 1. Get a binary distribution of GHC 7.4.1 and a source distribution of GHC 7.4.2 2. Configure the binary distribution to install in a temporary directory: `./configure --prefix=$HOME/workspace1` 3. Install the binary distribution 4. Set up the environment to use only the installed compiler: `export PATH=$HOME/workspace1/bin:$PATH; export GHC_PACKAGE_PATH=$HOME/workspace1/lib/ghc-7.4.1/package.conf.d` 5. Configure the source distribution to install in a different directory: `./configure --prefix=$HOME/workspace2` 6. Build the source distribution: `make` Building will eventually run commands that modify the package database in `GHC_PACKAGE_PATH`. One of these commands is `"inplace/bin/ghc-pkg" update --force rts/package.conf.inplace`. I confirmed that the database is being modified by making `ghc-pkg` print the name of the file it's about to update. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7779 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7779: building GHC overwrites the installed package database if GHC_PACKAGE_PATH is set ---------------------------------+------------------------------------------ Reporter: heatsink | Owner: igloo Type: bug | Status: new Priority: normal | Milestone: 7.8.1 Component: Build System | Version: 7.4.2 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Changes (by igloo): * owner: => igloo * difficulty: => Unknown * milestone: => 7.8.1 Comment: Thanks for the report. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7779#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7779: building GHC overwrites the installed package database if GHC_PACKAGE_PATH is set ---------------------------------+------------------------------------------ Reporter: heatsink | Owner: igloo Type: bug | Status: new Priority: normal | Milestone: 7.8.1 Component: Build System | Version: 7.4.2 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Comment(by igloo): Hmm, having thought about it, isn't that exactly what you'd expect to happen? I wonder if we should just deprecate/remove `GHC_PACKAGE_PATH`. You already can't use `cabal` if it's set (cabal will just fail). -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7779#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7779: building GHC overwrites the installed package database if GHC_PACKAGE_PATH is set ---------------------------------+------------------------------------------ Reporter: heatsink | Owner: igloo Type: bug | Status: new Priority: normal | Milestone: 7.8.1 Component: Build System | Version: 7.4.2 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Comment(by heatsink): I expect building software to pose no risk of breaking any installed software. It is understandable that installing software may break other software, but building should not. I've been using `GHC_PACKAGE_PATH` to install two versions of GHC that both call themselves `ghc-7.4.2`. By default, they both look in the same user package database, which breaks at least one of the two versions because packages are not compatible with both GHCs. Setting `GHC_PACKAGE_PATH` fixes that problem. Cabal works if given options `--global --package-db=$FOO`. If this way of managing paths is deprecated, then I'd like to have an alternative. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7779#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (2)
-
GHC
-
GHC