Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cabal-helper-wrapper fails to install cabal on WSL with "Invalid package ID" #167

Closed
hmemcpy opened this issue Sep 19, 2019 · 4 comments
Closed

Comments

@hmemcpy
Copy link

hmemcpy commented Sep 19, 2019

I've managed to (almost) set up the entire environment on WSL (with Nix). The only problem now seems to be that cabal-helper-wrapper failing to install with the following error:

$ /nix/store/jq8x50rkl3cm7cqkj1zsk6kfbb692iwv-cabal-helper-0.9.0.0/bin/cabal-helper-wrapper "--with-ghc=ghc" "--with-ghc-pkg=ghc-pkg" "--with-cabal=cabal" "v1-style" "/mnt/c/dev/fp-course" "/mnt/c/dev/fp-course/dist-newstyle/build/x86_64-linux/ghc-8.6.5/course-0.1.4" "package-db-stack" "flags" "compiler-version" "ghc-merged-pkg-options" "config-flags" "non-default-config-flags" "ghc-src-options" "ghc-pkg-options" "ghc-lang-options" "ghc-options" "source-dirs" "entrypoints" "needs-build-output"
cabal-helper-wrapper: Installing a private copy of Cabal because we couldn't
find the right version in your global/user package-db, this might take a
while but will only happen once per Cabal version you're using.

If anything goes horribly wrong just delete this directory and try again:
    /home/hmemcpy/.cache/cabal-helper

If you want to avoid this automatic installation altogether install
version 3.0.0.0 of Cabal manually (into your user or global package-db):
    $ cabal install Cabal --constraint "Cabal == 3.0.0.0"

Installing Cabal 3.0.0.0 ...
Unpacking to Cabal-3.0.0.0/
cabal: Invalid package ID: /tmp/cabal-helper-Cabal-source5358/Cabal-3.0.0.0

cabal-helper-wrapper: Installing Cabal version 3.0.0.0 failed.
...

When running just with print-build-platform, I'm getting x86_64-linux as a result.

How is the tmp directory path calculated? What other details can I provide?

@hmemcpy
Copy link
Author

hmemcpy commented Sep 25, 2019

This also happens in this particular repo on Ubuntu proper, same error:

...
Installing Cabal 3.0.0.0 ...
Unpacking to Cabal-3.0.0.0/
cabal: Invalid package ID:
/run/user/1000/cabal-helper-Cabal-source16617/Cabal-3.0.0.0

cabal-helper-wrapper: Installing Cabal version 3.0.0.0 failed.

Any ideas?

@hmemcpy
Copy link
Author

hmemcpy commented Sep 25, 2019

Update: I ran with --verbose, saw it detecting, then trying to run cabal 3.0.0.0, and ultimately failing:

cd /; cabal --package-db=clear --package-db=global --package-db=/home/parallels/.cache/cabal-helper/cabal-helper0.9.0.0-Cabal3.0.0.0-ghc8.4.4.package-db --prefix=/home/parallels/.cache/cabal-helper/cabal-helper0.9.0.0-Cabal3.0.0.0-ghc8.4.4.package-db/prefix --with-ghc=/nix/store/6583ayh403bfila8xccqracxldf72f8y-ghc-8.4.4-with-packages/bin/ghc --with-ghc-pkg=/nix/store/6583ayh403bfila8xccqracxldf72f8y-ghc-8.4.4-with-packages/bin/ghc-pkg --no-require-sandbox install /run/user/1000/cabal-helper-Cabal-source12379/Cabal-3.0.0.0 -v --only-dependencies
CallStack (from HasCallStack):
  die', called at ./Distribution/Client/CmdInstall.hs:376:25 in main:Distribution.Client.CmdInstall
cabal: Invalid package ID:
/run/user/1000/cabal-helper-Cabal-source12379/Cabal-3.0.0.0
...

Investigating...

@jneira
Copy link
Member

jneira commented Sep 25, 2019

It looks very similar to #165 (in NixOS) and i've got the error in native windows too.
I think the cause is the project had been built with cabal-install-3.0.0 but the ghc used (likely 8.6.5) has Cabal-2.4.1.0 installed.
Relevant issue in haskell-ide-engine: haskell/haskell-ide-engine#1376 (comment)

@jneira
Copy link
Member

jneira commented Jan 9, 2020

@hmemcpy hie not longer uses cabal-helper-wrapper so this one should be fixed, feel free to reopen if it is not the case

@jneira jneira closed this as completed Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants