Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Head: f9610a2 Updated to support Cabal-1.16 #35

Closed
wants to merge 2 commits into from

3 participants

@dybber

Now uses --package-db flag instead of the GHC_PACKAGE_PATH variable. I haven't updated the Emacs-Lisp.

@dybber

Woops, I didn't test that anything else than "cabal install" works, so this breaks "cabal update" etc. I might get time to write a fix soon

@dybber

Sorry for the delay, but with this new addition I think it is working okay. I have been using it for the last week without problems.

@alexanderkjeldaas

I just hit this issue. It would be great to have this pulled.

@rlpowell

Does GHC itself still work, though, with these changes?

Another way to handle this, at least for older GHC, is to have GHC_PACKAGE_PATH in the environment, but have the cabal wrapper unset it; that way everything else should keep working.

-Robin

@rlpowell

Yeah, I've confirmed that while cabal works this way, ghc (7.4.2 at least) definitely does not. This can be fixed by setting GHC_PACKAGE_PATH as before, but adding "unset GHC_PACKAGE_PATH" just before running cabal (and having the --package-db= bits for cabal, of course).

-Robin

@rlpowell

Ugh. It's way more complicated than that. Given the missing maintainer, I'm moving this discussion to https://github.com/tmhedberg/hsenv

-Robin

@zxq9 zxq9 referenced this pull request in haskell-hub/hub-src
Open

Use of GHC_PACKAGE_PATH prevents cabal updates #17

@Paczesiowa Paczesiowa referenced this pull request from a commit
@tmhedberg tmhedberg Merge remote-tracking branch 'github/dybber/master'
This merge enables compatibility with cabal-install v1.16, according to the
pull request discussion at #35.
0476c47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 9, 2012
  1. @dybber

    Updated to support Cabal-1.16 (now uses --package-db= instead of the …

    dybber authored
    …GHC_PACKAGE_PATH variable)
Commits on Oct 17, 2012
  1. @dybber
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 2 deletions.
  1. +2 −1  skeletons/activate
  2. +11 −1 skeletons/cabal
View
3  skeletons/activate
@@ -45,7 +45,8 @@ PATH_PREPENDIX="$(cat <HSENV_DIR>/path_var_prependix)"
export PATH="${PATH_PREPENDIX}:${PATH}"
unset -v PATH_PREPENDIX
-export GHC_PACKAGE_PATH="$(cat <HSENV_DIR>/ghc_package_path_var)"
+GHC_PACKAGE_PATH_REPLACEMENT="$(cat <HSENV_DIR>/ghc_package_path_var)"
+export PACKAGE_DB=--package-db=`echo ${GHC_PACKAGE_PATH_REPLACEMENT} | sed s/:/\ --package-db=/`
export PS1="(${HSENV_NAME})${PS1}"
if [ -n "$BASH" -o -n "$ZSH_VERSION" ]; then
View
12 skeletons/cabal
@@ -34,4 +34,14 @@ for CABAL_BUILDABLE_COMMAND in ${CABAL_BUILDABLE_COMMANDS}; do
fi
done
-exec "${ORIG_CABAL_BINARY}" --config-file="${CABAL_CONFIG}" ${CABAL_BUILDDIR_ARG} "${@}"
+CABAL_CONFIGURE_COMMANDS="configure install upgrade"
+
+for CABAL_CONFIGURE_COMMAND in ${CABAL_CONFIGURE_COMMANDS}; do
+ if [ "${CABAL_CONFIGURE_COMMAND}" = "${CABAL_COMMAND}" ]; then
+ CABAL_BUILDDIR_ARG="${CABAL_BUILDDIR_ARG} ${PACKAGE_DB}"
+ fi
+done
+
+exec "${ORIG_CABAL_BINARY}" \
+ --config-file="${CABAL_CONFIG}" \
+ ${CABAL_BUILDDIR_ARG} "${@}"
Something went wrong with that request. Please try again.