commercialhaskell / stack

The Haskell Tool Stack
http://haskellstack.org
BSD 3-Clause "New" or "Revised" License
4k stars 844 forks source link

Have "stack --version" 's list of dependency versions include transitive deps #2450

Closed mgsloan closed 8 years ago

mgsloan commented 8 years ago

The implementation in https://github.com/commercialhaskell/stack/pull/2223 only lists direct deps. While not super likely, variations in the indirect deps chosen by cabal-install could also cause unexpected and unpredictable issues for users when it's used to build stack.

It would also be really nice to go back to a simple build type.

Blaisorblade commented 8 years ago

I think I managed to avoid transitive dependencies! As an example, look for zlib-bindings. The code is even less hacky than I feared, but given the process I used, I won't remotely suggest the code is robust. I'll take a look at using Template Haskell next.

$ stack exec -- stack --version
Version 1.1.3, Git revision 241df53b5c6ff9cc1d283710e69e740085d90482 (dirty) (3918 commits) x86_64
Compiled with:
- Cabal-1.22.8.0
- Glob-0.7.5
- HUnit-1.3.1.1
- MonadRandom-0.4.2.3
- QuickCheck-2.8.2
- SHA-1.6.4.2
- StateVar-1.1.0.4
- adjunctions-4.3
- aeson-0.11.2.0
- aeson-compat-0.3.3.0
- annotated-wl-pprint-0.7.0
- ansi-terminal-0.6.2.3
- ansi-wl-pprint-0.6.7.3
- array-0.5.1.0
- asn1-encoding-0.9.3
- asn1-parse-0.9.4
- asn1-types-0.3.2
- async-2.1.0
- attoparsec-0.13.0.2
- auto-update-0.1.4
- base-4.8.2.0
- base-compat-0.9.1
- base-orphans-0.5.4
- base16-bytestring-0.1.1.6
- base64-bytestring-1.0.0.1
- bifunctors-5.2
- binary-0.7.5.0
- binary-tagged-0.1.4.0
- blaze-builder-0.4.0.2
- blaze-html-0.8.1.1
- blaze-markup-0.7.0.3
- byteable-0.1.1
- bytestring-0.10.6.0
- bytestring-builder-0.10.6.0.0
- case-insensitive-1.2.0.6
- cereal-0.5.1.0
- clock-0.7.2
- comonad-4.2.7.2
- conduit-1.2.6.6
- conduit-extra-1.1.13.1
- connection-0.2.5
- constraints-0.8
- containers-0.5.6.2
- contravariant-1.4
- cookie-0.4.2
- cryptohash-0.11.9
- cryptohash-conduit-0.1.1
- cryptonite-0.15
- data-default-class-0.0.1
- deepseq-1.4.1.1
- digest-0.0.1.2
- directory-1.2.2.0
- distributive-0.5.0.2
- dlist-0.7.1.2
- dlist-instances-0.1
- easy-file-0.2.1
- edit-distance-0.2.2.1
- either-4.4.1.1
- enclosed-exceptions-1.0.1.1
- errors-2.1.2
- exceptions-0.8.2.1
- extra-1.4.7
- fail-4.9.0.0
- fast-logger-2.4.6
- filelock-0.1.0.1
- filepath-1.4.0.0
- free-4.12.4
- fsnotify-0.2.1
- generic-deriving-1.10.4.1
- generics-sop-0.2.1.0
- ghc-prim-0.4.0.0
- gitrev-1.2.0
- hashable-1.2.4.0
- hastache-0.6.1
- hfsevents-0.1.6
- hit-0.6.3
- hourglass-0.2.10
- hpack-0.14.0
- hpc-0.6.0.2
- hspec-2.2.3
- hspec-core-2.2.3
- hspec-discover-2.2.3
- hspec-expectations-0.7.2
- hspec-smallcheck-0.4.1
- http-api-data-0.2.2
- http-client-0.5.0
- http-client-tls-0.3.0
- http-conduit-2.2.0
- http-types-0.9
- ieee754-0.7.8
- integer-gmp-1.0.0.0
- kan-extensions-4.2.3
- keys-3.11
- lifted-async-0.9.0
- lifted-base-0.2.3.6
- logict-0.6.0.2
- memory-0.13
- microlens-0.4.4.0
- mime-types-0.1.0.7
- mmorph-1.0.6
- monad-control-1.0.1.0
- monad-logger-0.3.18
- monad-loops-0.4.3
- monad-unlift-0.2.0
- mono-traversable-0.10.2
- mtl-2.2.1
- nats-1.1
- network-2.6.2.1
- 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.12.1.0
- optparse-simple-0.0.3
- parsec-3.1.11
- path-0.5.8
- path-io-1.1.0
- path-pieces-0.2.1
- patience-0.1.1
- pem-0.2.2
- persistent-2.2.4.1
- persistent-sqlite-2.2.1
- persistent-template-2.1.8.1
- pointed-4.2.0.2
- prelude-extras-0.4.0.3
- pretty-1.1.2.0
- primitive-0.6.1.0
- process-1.2.3.0
- profunctors-5.2
- project-template-0.2.0
- quickcheck-io-0.1.2
- random-1.1
- regex-applicative-0.3.3
- regex-applicative-text-0.1.0.1
- resource-pool-0.2.3.2
- resourcet-1.1.7.4
- retry-0.7.2
- rts-1.0
- safe-0.3.9
- scientific-0.3.4.6
- semigroupoids-5.0.1
- semigroups-0.18.1
- setenv-0.1.1.3
- silently-1.2.5
- smallcheck-1.1.1
- socks-0.5.5
- split-0.2.3.1
- stm-2.4.4.1
- stm-chans-3.0.0.4
- store-0.2.1.0
- store-core-0.2.0.0
- streaming-commons-0.1.15.5
- syb-0.6
- system-fileio-0.3.16.3
- system-filepath-0.4.13.4
- tagged-0.8.4
- tar-0.5.0.3
- template-haskell-2.10.0.0
- temporary-1.2.0.4
- text-1.2.2.1
- text-binary-0.2.1
- tf-random-0.5
- th-expand-syns-0.4.0.0
- th-lift-0.7.6
- th-lift-instances-0.1.7
- th-orphans-0.13.1
- th-reify-many-0.1.6
- th-utilities-0.2.0.1
- time-1.5.0.1
- time-locale-compat-0.1.1.1
- tls-1.3.8
- transformers-0.4.2.0
- transformers-base-0.4.4
- transformers-compat-0.4.0.4
- unexceptionalio-0.3.0
- unicode-transforms-0.1.0.1
- unix-2.7.1.0
- unix-compat-0.4.1.4
- unix-time-0.3.6
- unordered-containers-0.2.7.0
- utf8-string-1.0.1.1
- vector-0.11.0.0
- vector-algorithms-0.7.0.1
- vector-binary-instances-0.2.3.2
- vector-instances-3.3.1
- void-0.7.1
- x509-1.6.3
- x509-store-1.6.1
- x509-system-1.6.3
- x509-validation-1.6.3
- yaml-0.8.17.1
- zip-archive-0.2.3.7
- zlib-0.6.1.1
- zlib-bindings-0.1.1.5
Blaisorblade commented 8 years ago

Regarding Template Haskell, I've rediscovered https://github.com/commercialhaskell/stack/pull/2223#issuecomment-223731428.

It would also be really nice to go back to a simple build type.

To be sure: why?

An alternative approach might be to use TH, and parse the versions out of $DIST_DIR/package.conf.inplace.

That code seems fragile, newer Cabal uses a different convention:

git/agda/.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/package.conf.inplace:
Agda-2.5.2-Jrqz2xmTIYf4tZGj1dCChP.conf  package.cache

Using the Cabal API cleanly would require loading setup-config into a LocalBuildInfo, parsing the Cabal file into a GenericPackageDescription, configuring it with the flags from setup-config and getting a PackageDescription, and then calling the current code.

Blaisorblade commented 8 years ago

Meanwhile, I wondered why hspec shows up above. I thought it was a bug, but examining stack dot --external blames clearly store, in particular fpco/store#59.

mgsloan commented 8 years ago

Seems like a good change, good stuff! To resolve the Build_stack-test.hs thing, just have it list dependencies for exeName exe == "stack", and skip tests.

To be sure: why?

Because Setup.hs files are generally gnarly for a variety of reasons - https://github.com/haskell/cabal/issues/3065

Blaisorblade commented 8 years ago

Untagging myself for the Template Haskell part.

Blaisorblade commented 8 years ago

Actually, I split that out to a separate issue.