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

Installing discrimination violates stack invariant #3378

Closed
reactormonk opened this issue Aug 22, 2017 · 9 comments · Fixed by commercialhaskell/stackage#2792
Closed

Installing discrimination violates stack invariant #3378

reactormonk opened this issue Aug 22, 2017 · 9 comments · Fixed by commercialhaskell/stackage#2792
Milestone

Comments

@reactormonk
Copy link

Steps to reproduce

On lts-9.0, 9.1, 8.21:

stack install discrimination

Expected

Should warm my room and return.

Actual

$ stack install discrimination

Error: While constructing the build plan, the following exceptions were encountered:

In the dependencies for discrimination-0.2.1:
    promises must match >=0.2 && <0.4, but the stack configuration has no specified version (latest applicable is 0.3)
needed for unknown reason - stack invariant violated.

Recommended action: try adding the following to your extra-deps in /home/tass/.stack/global-project/stack.yaml:
- promises-0.3

You may also want to try the 'stack solver' command
Plan construction failed.

Stack version

$ stack --version
Version 1.5.0 x86_64
Compiled with:
- Cabal-1.24.2.0
- Glob-0.7.14
- HUnit-1.6.0.0
- MonadRandom-0.5.1
- QuickCheck-2.10.0.1
- SHA-1.6.4.2
- StateVar-1.1.0.4
- aeson-1.2.1.0
- aeson-compat-0.3.7.1
- annotated-wl-pprint-0.7.0
- ansi-terminal-0.6.3.1
- ansi-wl-pprint-0.6.8.1
- array-0.5.1.1
- asn1-encoding-0.9.5
- asn1-parse-0.9.4
- asn1-types-0.3.2
- async-2.1.1.1
- attoparsec-0.13.2.0
- attoparsec-iso8601-1.0.0.0
- auto-update-0.1.4
- base-4.9.1.0
- base-compat-0.9.3
- base-orphans-0.6
- base16-bytestring-0.1.1.6
- base64-bytestring-1.0.0.1
- bifunctors-5.4.2
- binary-0.8.3.0
- binary-tagged-0.1.4.2
- bitarray-0.0.1.1
- blaze-builder-0.4.0.2
- blaze-html-0.9.0.1
- blaze-markup-0.8.0.0
- byteable-0.1.1
- bytestring-0.10.8.1
- call-stack-0.1.0
- case-insensitive-1.2.0.10
- cereal-0.5.4.0
- clock-0.7.2
- comonad-5.0.2
- conduit-1.2.11
- conduit-extra-1.1.16
- connection-0.2.8
- constraints-0.9.1
- containers-0.5.7.1
- contravariant-1.4
- cookie-0.4.2.1
- cryptohash-0.11.9
- cryptohash-sha256-0.11.100.1
- cryptonite-0.24
- cryptonite-conduit-0.2.0
- data-default-class-0.1.2.0
- deepseq-1.4.2.0
- digest-0.0.1.2
- directory-1.3.0.0
- distributive-0.5.3
- dlist-0.8.0.3
- easy-file-0.2.1
- echo-0.1.3
- ed25519-0.0.5.0
- either-4.4.1.1
- errors-2.2.1
- exceptions-0.8.3
- extra-1.5.3
- fast-logger-2.4.10
- file-embed-0.0.10
- filelock-0.1.1.2
- filepath-1.4.1.1
- foundation-0.0.13
- free-4.12.4
- fsnotify-0.2.1.1
- generic-deriving-1.11.2
- generics-sop-0.3.1.0
- ghc-boot-th-8.0.2
- ghc-prim-0.5.0.0
- gitrev-1.3.1
- hackage-security-0.5.2.2
- hashable-1.2.6.1
- hastache-0.6.1
- hinotify-0.3.9
- hourglass-0.2.10
- hpack-0.17.1
- hpc-0.6.0.3
- hspec-2.4.4
- hspec-core-2.4.4
- hspec-discover-2.4.4
- hspec-expectations-0.8.2
- hspec-smallcheck-0.4.2
- http-api-data-0.3.7.1
- http-client-0.5.7.0
- http-client-tls-0.3.5.1
- http-conduit-2.2.3.2
- http-types-0.9.1
- ieee754-0.8.0
- integer-gmp-1.0.0.1
- integer-logarithms-1.0.2
- lifted-async-0.9.3
- lifted-base-0.2.3.11
- logict-0.6.0.2
- memory-0.14.6
- microlens-0.4.8.1
- microlens-mtl-0.1.11.0
- microlens-th-0.4.1.1
- mime-types-0.1.0.7
- mintty-0.1.1
- mmorph-1.1.0
- monad-control-1.0.2.2
- monad-logger-0.3.25
- monad-loops-0.4.3
- monad-unlift-0.2.0
- mono-traversable-1.0.2.1
- mtl-2.2.1
- network-2.6.3.2
- network-uri-2.6.1.0
- old-locale-1.0.0.7
- old-time-1.1.0.3
- open-browser-0.2.1.0
- optparse-applicative-0.13.2.0
- optparse-simple-0.0.3
- parsec-3.1.11
- path-0.6.1
- path-io-1.3.3
- path-pieces-0.2.1
- pem-0.2.2
- persistent-2.7.0
- persistent-sqlite-2.6.2
- persistent-template-2.5.2
- pid1-0.1.2.0
- prelude-extras-0.4.0.3
- pretty-1.1.3.3
- primitive-0.6.2.0
- process-1.4.3.0
- profunctors-5.2.1
- project-template-0.2.0
- quickcheck-io-0.2.0
- random-1.1
- regex-applicative-0.3.3
- regex-applicative-text-0.1.0.1
- resource-pool-0.2.3.2
- resourcet-1.1.9
- retry-0.7.4.2
- rts-1.0
- safe-0.3.15
- safe-exceptions-0.1.6.0
- scientific-0.3.5.1
- semigroupoids-5.2.1
- semigroups-0.18.3
- setenv-0.1.1.3
- silently-1.2.5
- smallcheck-1.1.2
- socks-0.5.5
- split-0.2.3.2
- stm-2.4.4.1
- stm-chans-3.0.0.4
- store-0.4.3.1
- store-core-0.4.1
- streaming-commons-0.1.18
- syb-0.7
- tagged-0.8.5
- tar-0.5.0.3
- template-haskell-2.11.1.0
- temporary-1.2.1.1
- text-1.2.2.2
- text-binary-0.2.1.1
- text-metrics-0.2.0
- tf-random-0.5
- th-expand-syns-0.4.3.0
- th-lift-0.7.7
- th-lift-instances-0.1.11
- th-orphans-0.13.4
- th-reify-many-0.1.8
- th-utilities-0.2.0.1
- time-1.6.0.1
- time-locale-compat-0.1.1.3
- tls-1.4.0
- transformers-0.5.2.0
- transformers-base-0.4.4
- transformers-compat-0.5.1.4
- unexceptionalio-0.3.0
- unicode-transforms-0.3.2
- unix-2.7.2.1
- unix-compat-0.4.3.1
- unix-time-0.3.7
- unordered-containers-0.2.8.0
- uri-bytestring-0.2.3.3
- uuid-types-1.0.3
- vector-0.12.0.1
- vector-algorithms-0.7.0.1
- vector-binary-instances-0.2.3.5
- void-0.7.2
- x509-1.7.2
- x509-store-1.6.5
- x509-system-1.6.6
- x509-validation-1.6.9
- yaml-0.8.23.3
- zip-archive-0.3.1.1
- zlib-0.6.1.2

Method of installation

  • Arch package
@decentral1se
Copy link
Member

decentral1se commented Aug 23, 2017

Looks like you just need to add the following to your stack.yaml:

extra-deps:
- promises-0.3

The promises package isn't included in any of those LTS snapshots.

@mgsloan mgsloan added this to the P1: Must milestone Aug 23, 2017
@mgsloan
Copy link
Contributor

mgsloan commented Aug 23, 2017

Invariant violated message is definitely a bug though. Will put this on my queue of things to look into.

Feel free to work on figuring this out @lwm or @reactormonk or anyone else

@snoyberg
Copy link
Contributor

@reactormonk I think this may be resolved on Stack master; would you be able to try upgrading with stack upgrade --git and reporting back? I'm unable to repro on my system.

@reactormonk
Copy link
Author

Newest git seems to work fine.

@reactormonk
Copy link
Author

... now it doesn't anymore, and I don't know why.

Downloaded lts-9.1 build plan.    
Populated index cache.    

Error: While constructing the build plan, the following exceptions were encountered:
       
       In the dependencies for discrimination-0.2.1:
           promises must match >=0.2 && <0.4, but the stack configuration has no specified version
                    (latest applicable is 0.3)
       needed for unknown reason - stack invariant violated.
       
       Recommended action: try adding the following to your extra-deps in /home/tass/.stack/script/lts-9.1/config.yaml:
       - promises-0.3
       
       You may also want to try the 'stack solver' command
stack --version
Version 1.5.1, Git revision 89d34af1addf6c02cefef970e2fa395a96a30483 x86_64 hpack-0.18.1

@reactormonk reactormonk reopened this Aug 27, 2017
@snoyberg
Copy link
Contributor

That looks legitimate and unrelated: discrimination depends on promises, and promises isn't available in LTS 9.1. You can work around this by manually adding promises to the build plan with stack build discrimination promises-0.3.

@reactormonk
Copy link
Author

Any way to make that work for script?

@snoyberg
Copy link
Contributor

See #3370.

@mgsloan
Copy link
Contributor

mgsloan commented Aug 28, 2017

I've fixed the "stack invariant violated" portion. The code for displaying the messages was not taking into consideration packages added due to being extra-deps. The output is now:

Error: While constructing the build plan, the following exceptions were encountered:
       
       In the dependencies for discrimination-0.2.1:
           promises must match >=0.2 && <0.4, but the stack configuration has no specified version
                    (latest applicable is 0.3)
       needed since discrimination-0.2.1 is a build target.
       
       Recommended action: try adding the following to your extra-deps in /home/mgsloan/fpco/stack/stack.yaml:
       - promises-0.3
       
       You may also want to try the 'stack solver' command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants