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 can't install Cabal-3.0.0.0 at runtime in windows #82

Closed
jneira opened this issue Oct 15, 2019 · 4 comments
Closed

cabal-helper can't install Cabal-3.0.0.0 at runtime in windows #82

jneira opened this issue Oct 15, 2019 · 4 comments

Comments

@jneira
Copy link
Collaborator

jneira commented Oct 15, 2019

D:\bin\Programs\stack\x86_64-windows\ghc-8.6.5\bin\ghc.exe --numeric-version
=> 8.6.5

cabal --numeric-version
=> 3.0.0.0

using helper compiled with Cabal from v2-build package-env C:\Users\user\Local Settings\Cache\cabal-helper\ghc-8.6.5.package-envs\Cabal-3.0.0.0.package-env
helper exe does not exist, compiling C:\Users\user\Local Settings\Cache\cabal-helper\cabal-helper-1.0.0.0--Cabal-3.0.0.0--c82cca47f9974858fe3c009873651f1e71ad14c20be7c4b4932a9ed554ec09d2.build\cabal-helper
cabal-helper: Installing a private copy of Cabal because we couldn't
find the right version anywhere on your system. You can set the environment
variable CABAL_HELPER_DEBUG=1 to see where we searched.

Note that this installation might take a little while but it will only
happen once per Cabal library version used in your build-plans.

If you want to avoid this automatic installation altogether install
version 3.0.0.0 of the Cabal library manually, either using cabal or your
system package manager. With cabal you can use the following command:
    $ cabal install Cabal --constraint "Cabal == 3.0.0.0"

FYI the build products and cabal-helper executable cache are all in the
following directory, you can simply delete it if you think something
is broken :
    C:\Users\user\Local Settings\Cache\cabal-helper
Please do report any problems you encounter.

Installing Cabal 3.0.0.0 ...
cabal --numeric-version
=> 3.0.0.0

cd C:\TEMP\; cabal --no-require-sandbox v2-install --with-compiler=D:\bin\Programs\stack\x86_64-windows\ghc-8.6.5\bin\ghc.exe --with-hc-pkg=D:\bin\Programs\stack\x86_64-windows\ghc-8.6.5\bin\ghc-pkg.exe '--package-env=C:\Users\user\Local Settings\Cache\cabal-helper\ghc-8.6.5.package-envs\Cabal-3.0.0.0.package-env' --lib Cabal-3.0.0.0
Resolving dependencies...
Up to date
Distribution\Simple\GHC.hs:1959:5-56: Non-exhaustive patterns in Just ghcPkgProg
  • No C:\Users\user\Local Settings\Cache\cabal-helper is even created (and if it exists it doesnt create ghc-8.6.5.package-envs inside)
@jneira
Copy link
Collaborator Author

jneira commented Oct 15, 2019

With cabal-install-2.4.1.0 in $PATH no private installation of Cabal is triggered and C:\Users\user\Local Settings\Cache\cabal-helper is not created (although the Cabal version installed globally in ghc-8.6.5 is Cabal-2.4.0.1)

I had a previous backup of C:\Users\user\Local Settings\Cache\cabal-helper with ghc-8.6.5.package-envs\Cabal-2.4.1.0.package-env and cabal-helper-1.0.0.0--Cabal-2.4.1.0-hash.build, but no idea how was created.

The contents of ghc-8.6.5.package-envs\Cabal-2.4.1.0.package-env is:

clear-package-db
global-package-db
package-db C:\Users\user\AppData\Roaming\cabal\store\ghc-8.6.5\package.db
package-id ghc-8.6.5
package-id bytestring-0.10.8.2
package-id base-4.12.0.0
package-id time-1.8.0.2
package-id hpc-0.6.0.3
package-id filepath-1.4.2.1
package-id process-1.6.5.0
package-id array-0.5.3.0
package-id integer-gmp-1.0.2.0
package-id containers-0.6.0.1
package-id ghc-boot-8.6.5
package-id binary-0.8.6.0
package-id ghc-prim-0.5.3
package-id ghci-8.6.5
package-id rts
package-id transformers-0.5.6.2
package-id deepseq-1.4.4.0
package-id ghc-boot-th-8.6.5
package-id pretty-1.1.3.6
package-id template-haskell-2.14.0.0
package-id directory-1.3.3.0
package-id text-1.2.3.1
package-id Cabal-2.4.1.0-402b1cba79c424853de8a789c317a675fe742791

but C:\Users\user\AppData\Roaming\cabal\store\ghc-8.6.5\package.db doesn't exist in my system cause i am setting store-dir: D:\csd to avoid max path issues.

@DanielG
Copy link
Owner

DanielG commented Oct 15, 2019

Can you run the cabal v2-install command by hand while adding -v3?

@jneira
Copy link
Collaborator Author

jneira commented Oct 15, 2019

The last output executing the command is:

Warning: Package db
C:\Users\user\AppData\Roaming\cabal\store\ghc-8.6.5\package.db does not exist
yet
Distribution\Simple\GHC.hs:1959:5-56: Non-exhaustive patterns in Just ghcPkgProg

But i had to replace '--package-env=C:\Users\user\Local Settings\Cache\cabal-helper\ghc-8.6.5.package-envs\Cabal-3.0.0.0.package-env'with "--package-env=C:\Users\user\Local Settings\Cache\cabal-helper\ghc-8.6.5.package-envs\Cabal-3.0.0.0.package-env" (note the double quotes)

@jneira
Copy link
Collaborator Author

jneira commented Oct 15, 2019

Thanks to @DanielG help we've founf that i was using a cabal-install-3.0.0.0 version without the fix for haskell/cabal#5941, Downloading the official released version from https://www.haskell.org/cabal/download.html fixed it.

I'll promise next time i will remember to wipe out testing versions!

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