Ticket #3603 (closed bug: invalid)

Opened 4 years ago

Last modified 4 years ago

cabal-install bootstrap script respects PREFIX inconsistently, fails

Reported by: zooko Owned by:
Priority: normal Milestone:
Component: Compiler Version: 6.10.4
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

The bootstrap.sh script that comes with cabal-install is documented as respecting a PREFIX environment variable, but if you pass one it will ignore it during the installation of the executable:

  ./Setup configure --user "--prefix=${HOME}/.cabal" \
    --with-compiler=${GHC} --with-hc-pkg=${GHC_PKG} \
    ${EXTRA_CONFIGURE_OPTS} ${VERBOSE} \
    || die "Configuring the ${PKG} package failed"

But then respect it during the post-install self-test:

CABAL_BIN="$PREFIX/bin"
if [ -x "$CABAL_BIN/cabal" ]
then

...

else
    echo "Sorry, something went wrong."
fi

Which means that it always emits the "Sorry, something went wrong." message and not the success message when PREFIX was specified. Also that it installed into the wrong directory.

Change History

Changed 4 years ago by zooko

This patch fixes it:

zooko@hanford:~/playground/cabal-install-0.6.2$ diff -u bootstrap.sh.orig  bootstrap.sh
--- bootstrap.sh.orig   2009-10-20 13:33:35.000000000 -0700
+++ bootstrap.sh        2009-10-20 13:33:50.000000000 -0700
@@ -132,7 +132,7 @@
     || die "Compiling the Setup script failed"
   [ -x Setup ] || die "The Setup script does not exist or cannot be run"
 
-  ./Setup configure --user "--prefix=${HOME}/.cabal" \
+  ./Setup configure --user "--prefix=${PREFIX}" \
     --with-compiler=${GHC} --with-hc-pkg=${GHC_PKG} \
     ${EXTRA_CONFIGURE_OPTS} ${VERBOSE} \
     || die "Configuring the ${PKG} package failed"

Changed 4 years ago by duncan

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

Already fixed.  http://hackage.haskell.org/trac/hackage/ticket/541

For future reference, Cabal tickets should be filed in the Cabal/Hackage trac, not the ghc one.

Note: See TracTickets for help on using tickets.