Stop! Tickets are now managed at GitHub.

Please enter new tickets, and find and edit existing tickets there:

Ticket #98 (closed defect: wontfix)

Opened 8 years ago

Last modified 8 years ago

./configure doesn't fully respect --prefix

Reported by: zooko Owned by:
Priority: major Milestone:
Component: (none-specified) Keywords: packaging


I tried to follow these instructions to install the Haskell platform on my Linux system. I have a policy that packages do not get to run an installer with sudo power -- instead I use GNU stow to symlink a package into the system after it has installed itself into a specific --prefix which is just for that one package.

The unix src bundle seems to be not fully prespecting the --prefix option to ./configure:

tar -xzf haskell-platform-2009.2.0.2.tar.gz
cd haskell-platform-2009.2.0.2
./configure --prefix=/usr/local/stow/haskell-platform-2009.2.0.2
sudo mkdir -p /usr/local/stow/haskell-platform-2009.2.0.2
sudo chown `whoami` /usr/local/stow/haskell-platform-2009.2.0.2
make install

This fails with:

Installing mtl-
Installing library in
Writing package registration file: mtl- for mtl-
Reading package info from "mtl-" ... done.
Writing new package config file... ghc-pkg: /var/lib/ghc-6.10.4/./package.conf: you don't have permission to modify this file

Registering the package mtl- failed
make: *** [install] Error 2

Is there a different ./configure option I could use to tell it to use a different location of package.conf? In any case, it seems like the location of that file, like all files, should be controlled by --prefix.


Change History

Changed 8 years ago by zooko

When I said "I tried to follow these instructions", I forgot to include the link to the instructions:

Changed 8 years ago by zooko

It looks like this is a problem that the haskell platform install script inherits because it invokes the cabal install script:

Changed 8 years ago by duncan

  • status changed from new to closed
  • resolution set to wontfix

The problem is that we must register the packages you install with ghc. That is done by modifying a package database. This file does not generally live under the prefix you specify. Therefore we cannot fully respect the prefix you specify (at least if we want it to work).

There are two standard package databases. One is the global one. This is the default one that the ./configure script will use. The other one is the per-user package database. The ./configure script will use this one if you specify --enable-user-install.

The ./configure script usually auto-detects if it should use the global or user package db by checking if the prefix you're using is under $HOME/. However that simple test obviously does not work for your use case.

You will either have to register the package only in the per-user package db, or you will need to do the install step as root so that the global package db can be modified.

Note: See TracTickets for help on using tickets.