Cabal sandbox install still does not work because "packages are likely to be damaged by reinstallations",

I am trying to create an Elm Platform using the cabal sandbox. However, the installation completes with the message "packages are likely to be damaged by reinstallations." It seems to me that this is contrary to the whole purpose of the sandbox, which, I thought, was supposed to avoid such a mistake.

Can someone explain this error to me, and is it even better to help me get started installing Elm? Can I add --force-reinstalls ?

Here is the sequence of commands that I executed:

 cabal sandbox init cabal update cabal install -j elm-compiler-0.14 elm-package-0.2 elm-make-0.1 elm-reactor-0.2 elm-repl-0.4 

I am using cabal 1.22.0.0 and GHC 7.8.2 on Mac OS 10.10. The full output is as follows:

 Resolving dependencies... In order, the following would be installed: Diff-0.3.0 (new package) HUnit-1.2.5.2 (new package) ansi-terminal-0.6.2.1 (new package) ansi-wl-pprint-0.6.7.1 (new package) async-2.0.2 (new package) blaze-markup-0.6.2.0 (new package) blaze-html-0.7.0.3 (new package) byteable-0.1.1 (new package) bytestring-mmap-0.2.2 (new package) bytestring-trie-0.2.4 (new package) cereal-0.4.1.1 (new package) cmdargs-0.10.12 (new package) concatenative-1.0.1 (new package) cookie-0.4.1.4 (new package) cryptohash-0.11.6 (new package) enumerator-0.4.20 (new package) attoparsec-enumerator-0.3.3 (new package) blaze-builder-enumerator-0.2.0.6 (new package) exceptions-0.6.1 (reinstall) changes: mtl-2.1.3.1 -> 2.2.1, transformers-0.3.0.0 -> 0.4.1.0 extensible-exceptions-0.1.1.4 (new package) hfsevents-0.1.5 (new package) fsnotify-0.1.0.3 (new package) hourglass-0.2.8 (new package) asn1-types-0.3.0 (new package) asn1-encoding-0.9.0 (new package) asn1-parse-0.9.0 (new package) crypto-pubkey-types-0.4.2.3 (new package) http-types-0.8.5 (new package) mime-types-0.1.0.5 (new package) monads-tf-0.1.0.2 (reinstall) changes: transformers-0.3.0.0 -> 0.4.1.0 MonadCatchIO-transformers-0.3.1.3 (new package) network-2.6.0.2 (new version) parsec-3.1.7 (new version) indents-0.3.3 (new package) network-uri-2.6.0.1 (new package) HTTP-4000.2.19 (new version) pem-0.2.2 (new package) prettyclass-1.0.0.0 (new package) language-glsl-0.1.1 (new package) publicsuffixlist-0.1 (new package) regex-base-0.93.2 (new package) regex-posix-0.95.2 (new package) securemem-0.1.4 (new package) crypto-cipher-types-0.0.9 (new package) cipher-aes-0.2.9 (new package) cipher-des-0.0.6 (new package) cipher-rc4-0.1.4 (new package) crypto-random-0.0.8 (new package) cprng-aes-0.6.1 (new package) crypto-numbers-0.2.7 (new package) crypto-pubkey-0.2.7 (new package) socks-0.5.4 (new package) streaming-commons-0.1.8 (new package) http-client-0.3.8.2 (latest: 0.4.6.2) (new package) syb-0.4.4 (new package) tagshare-0.0 (new package) terminfo-0.4.0.0 (new package) haskeline-0.7.1.3 (new package) tf-random-0.5 (new package) QuickCheck-2.7.6 (new package) testing-feat-0.4.0.2 (new package) transformers-compat-0.3.3.4 (new package) optparse-applicative-0.10.0 (latest: 0.11.0.1) (new package) union-find-0.2 (new package) unix-compat-0.4.1.4 (new package) unordered-containers-0.2.5.1 (new package) aeson-0.8.0.2 +old-locale (new package) aeson-pretty-0.7.2 (new package) uniplate-1.6.12 (new package) websockets-0.9.2.2 (new version) wl-pprint-1.1 (new package) language-ecmascript-0.16.2 (latest: 0.17) (new package) elm-compiler-0.14 (new package) x509-1.5.0.1 (new package) x509-store-1.5.0 (new package) x509-system-1.5.0 (new package) x509-validation-1.5.1 (new package) tls-1.2.13 (new package) connection-0.2.3 (new package) http-client-tls-0.2.2 (new package) zip-archive-0.2.3.5 (new version) elm-package-0.2 (latest: 0.2.2) (new package) elm-make-0.1 (new package) elm-repl-0.4 (new package) zlib-enum-0.2.3.1 (new package) snap-core-0.9.6.4 (new package) snap-server-0.9.4.6 (new package) websockets-snap-0.9.0.0 (new package) elm-reactor-0.2 (latest: 0.2.0.1) (new package) cabal: The following packages are likely to be broken by the reinstalls: temporary-1.2.0.3 shellmate-0.1.6 Use --force-reinstalls if you want to install anyway. 

UPDATE:

As requested, the output from cabal exec ghc-pkg list temporary :

 $ cabal exec ghc-pkg list temporary /Applications/ghc-7.8.2.app/Contents/lib/ghc-7.8.2/package.conf.d temporary-1.2.0.3 /Users/nbartlett/Development/Elm-Platform/tmp/.cabal-sandbox/x86_64-osx-ghc-7.8.2-packages.conf.d 
+6
source share
2 answers

You have installed shellmate and temporary (and possibly several other packages - especially their dependencies) in your global package database, which is also visible from sandboxes. The error says that:

  • You are about to install a new version (name it A-2) of an already installed package (call the existing A-1) and
  • you are going to reinstall the existing version (name it B) of a package that updates one of its dependencies from A-1 to A-2 and
  • the new B will obscure the old B and
  • there is a package (call it C), which depends on B.

The result of all this is that C is likely to be damaged after reinstalling B, as it will refer to B, expecting it to drag A-1, but instead of A-2, the drug will be used. In your particular case, the roles of shellmate and temporary play the role of C, and for each of them, at least one of exceptions-0.6.1 or monads-tf-0.1.0.2 plays the role of B

You have many options; The most attractive to me are:

  • Remove shellmate and temporary from your global package database. They will no longer be available, but this method will surely prevent many problems.

     ghc-pkg unregister --global shellmate ghc-pkg unregister --global temporary 
  • Reinstall shellmate and temporary in your global package database with updated dependencies. This may or may not work.

     cabal install --reinstall --global shellmate-0.1.6 temporary-1.2.0.3 mtl-2.2.1 transformers-0.4.1.0 
  • Ignore warnings and forced reinstallations. It is likely that shellmate and temporary will not be available from the built-in sandbox.

     cabal install elm --force-reinstalls # from within the sandbox 
  • Set knitting, matching and temporary everything in the sandbox. It is possible that this will still give you warnings, but they can be safely ignored: in the sandbox, you expect to use versions of the sandbox (therefore, โ€œbrokenโ€ global packages do not matter), and outside the sandbox global packages will not be violated.

     cabal install elm temporary shellmate # possibly with --force-reinstalls 
+5
source

I had the same thing as installing multiple packages at the same time. One package A depended on package B, while A and B depended on different versions of package C. (This is my mental model of the situation).

My specific installation lock was cleared [*], installing the packages separately, and not immediately. Instead of a single command with N packages, I had N teams with one package at a time.

[*] Since Iโ€™m not sure about the cause of my problem, I also canโ€™t know for sure what exactly this resolved.

+1
source

Source: https://habr.com/ru/post/980699/


All Articles