Стек установить библиотеку без двоичного - PullRequest
0 голосов
/ 20 апреля 2020

Оказывается, что stack не позволяет устанавливать библиотеки, такие как pretty-tree, которые поставляются без двоичных файлов:

username@username-laptop:~/Projects/MyProject$ stack install pretty-tree
Warning (added by new or init): Some packages were found to be incompatible with the resolver and have been left commented out in the packages section.
You can omit this message by removing it from stack.yaml

Stack has not been tested with GHC versions above 8.6, and using 8.8.3, this may fail
Stack has not been tested with Cabal versions above 2.4, but version 3.0.1.0 was found, this may fail
username@username-laptop:~/Projects/MyProject$ stack ghci
Warning (added by new or init): Some packages were found to be incompatible with the resolver and have been left commented out in the packages section.
You can omit this message by removing it from stack.yaml

Stack has not been tested with GHC versions above 8.6, and using 8.8.3, this may fail
Stack has not been tested with Cabal versions above 2.4, but version 3.0.1.0 was found, this may fail

Note: No local targets specified, so a plain ghci will be started with no package hiding or package options.

      You are using snapshot: lts-15.9

      If you want to use package hiding and options, then you can try one of the following:

      * If you want to start a different project configuration than /home/username/Projects/MyProject/stack.yaml, then you can use stack init to create a new stack.yaml for the packages in the
        current directory. 

      * If you want to use the project configuration at /home/username/Projects/MyProject/stack.yaml, then you can add to its 'packages' field.

Configuring GHCi with the following packages: 
GHCi, version 8.8.3: https://www.haskell.org/ghc/  :? for help
[ 1 of 17] Compiling Module1           ( Module1.hs, interpreted )
[ 2 of 17] Compiling Module2           ( Module2.hs, interpreted )
[ 3 of 17] Compiling Module3           ( Module3.hs, interpreted )
[ 4 of 17] Compiling Module4           ( Module4.hs, interpreted )
[ 5 of 17] Compiling Module5           ( Module5.hs, interpreted )
[ 6 of 17] Compiling Module6           ( Module6.hs, interpreted )
[ 7 of 17] Compiling Module7           ( Module7.hs, interpreted )

Module7.hs:22:1: error:
    Could not find module ‘Data.Tree.Pretty’
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
22 | import           Data.Tree.Pretty
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Failed, six modules loaded.
Loaded GHCi configuration from /home/username/Projects/MyProject/.ghci
Loaded GHCi configuration from /tmp/haskell-stack-ghci/2a3bbd58/ghci-script
*Module6> 

Как я могу преодолеть это и заставить stack собрать мою программу как это было возможно с cabal?

...