yi-editor / yi

The Haskell-Scriptable Editor
GNU General Public License v2.0
1.51k stars 201 forks source link

Failed to install from example-configs using nix-shell #1034

Open anpryl opened 7 years ago

anpryl commented 7 years ago

Failed to install from yi-vim-vty-static example config using nix-shell

git clone https://github.com/yi-editor/yi
cd yi
nix-shell
cd example-configs/yi-vim-vty-static
stack --nix install

Failed to compile 2 modules:

text-icu-0.7.0.1: configure
Progress: 2/10
--  While building package text-icu-0.7.0.1 using:
      /home/anpryl/.stack/setup-exe-cache/x86_64-linux-nix/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0 configure --with-ghc=/nix/store/fvf278s3lqsjv488ahhdi8jx6i0qzsr9-ghc-8.0.2/bin/ghc --with-ghc-pkg=/nix/store/fvf278s3lqsjv488ahhdi8jx6i0qzsr9-ghc-8.0.2/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/anpryl/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/pkgdb --libdir=/home/anpryl/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/lib --bindir=/home/anpryl/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/bin --datadir=/home/anpryl/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/share --libexecdir=/home/anpryl/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/libexec --sysconfdir=/home/anpryl/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/etc --docdir=/home/anpryl/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/doc/text-icu-0.7.0.1 --htmldir=/home/anpryl/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/doc/text-icu-0.7.0.1 --haddockdir=/home/anpryl/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/doc/text-icu-0.7.0.1 --dependency=base=base-4.9.1.0 --dependency=bytestring=bytestring-0.10.8.1 --dependency=deepseq=deepseq-1.4.2.0 --dependency=text=text-1.2.2.1-Ji7hMs2U4BkBwavd4taEVR --extra-include-dirs=/nix/store/fvf278s3lqsjv488ahhdi8jx6i0qzsr9-ghc-8.0.2/include --extra-lib-dirs=/nix/store/fvf278s3lqsjv488ahhdi8jx6i0qzsr9-ghc-8.0.2/lib
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/anpryl/.config/yi/yi/example-configs/yi-vim-vty-static/.stack-work/logs/text-icu-0.7.0.1.log

    Configuring text-icu-0.7.0.1...
    Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2: Missing dependencies on foreign
    libraries:
    * Missing C libraries: icuuc, icui18n, icudata
    This problem can usually be solved by installing the system packages that
    provide these libraries (you may need the "-dev" versions). If the libraries
    are already installed but in a non-standard location then you can use the
    flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.

and

terminfo-0.4.1.0: configure
--  While building package terminfo-0.4.1.0 using:
      /run/user/1000/stack13952/terminfo-0.4.1.0/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/setup/setup --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0 configure --with-ghc=/nix/store/fvf278s3lqsjv488ahhdi8jx6i0qzsr9-ghc-8.0.2/bin/ghc --with-ghc-pkg=/nix/store/fvf278s3lqsjv488ahhdi8jx6i0qzsr9-ghc-8.0.2/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/anpryl/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/pkgdb --libdir=/home/anpryl/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/lib --bindir=/home/anpryl/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/bin --datadir=/home/anpryl/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/share --libexecdir=/home/anpryl/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/libexec --sysconfdir=/home/anpryl/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/etc --docdir=/home/anpryl/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/doc/terminfo-0.4.1.0 --htmldir=/home/anpryl/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/doc/terminfo-0.4.1.0 --haddockdir=/home/anpryl/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/doc/terminfo-0.4.1.0 --dependency=base=base-4.9.1.0 --extra-include-dirs=/nix/store/fvf278s3lqsjv488ahhdi8jx6i0qzsr9-ghc-8.0.2/include --extra-lib-dirs=/nix/store/fvf278s3lqsjv488ahhdi8jx6i0qzsr9-ghc-8.0.2/lib
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/anpryl/.config/yi/yi/example-configs/yi-vim-vty-static/.stack-work/logs/terminfo-0.4.1.0.log

    [1 of 2] Compiling Main             ( /run/user/1000/stack13952/terminfo-0.4.1.0/Setup.lhs, /run/user/1000/stack13952/terminfo-0.4.1.0/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/setup/Main.o )
    [2 of 2] Compiling StackSetupShim   ( /home/anpryl/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /run/user/1000/stack13952/terminfo-0.4.1.0/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/setup/StackSetupShim.o )
    Linking /run/user/1000/stack13952/terminfo-0.4.1.0/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/setup/setup ...
    Configuring terminfo-0.4.1.0...
    configure: WARNING: unrecognized options: --with-compiler
    checking for gcc... /nix/store/2qxkalk0xasgxza03kpihs7pyd0bzd9c-gcc-wrapper-5.4.0/bin/cc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether /nix/store/2qxkalk0xasgxza03kpihs7pyd0bzd9c-gcc-wrapper-5.4.0/bin/cc accepts -g... yes
    checking for /nix/store/2qxkalk0xasgxza03kpihs7pyd0bzd9c-gcc-wrapper-5.4.0/bin/cc option to accept ISO C89... none needed
    checking for setupterm in -ltinfo... no
    checking for setupterm in -lncursesw... no
    checking for setupterm in -lncurses... no
    checking for setupterm in -lcurses... no
    configure: error: in `/run/user/1000/stack13952/terminfo-0.4.1.0':
    configure: error: curses library not found, so this package cannot be built
    See `config.log' for more details
mpwp commented 7 years ago

You need to install external dependencies with the standard package manager of your OS:

* Missing C libraries: icuuc, icui18n, icudata
This problem can usually be solved by installing the system packages that
provide these libraries (you may need the "-dev" versions). If the libraries
are already installed but in a non-standard location then you can use the
flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.

and

error: curses library not found, so this package cannot be built
anpryl commented 7 years ago

shell.nix contains

      icu.out
      ncurses.out
noughtmare commented 7 years ago

@anpryl You could try just stack install instead of stack --nix install as the last step, because the --nix flag would do nothing since the stack.yaml of the example configs doesn't contain any nix packages. It might even create another nix environment in which the packages are not available anymore (I don't know how nesting of nix environments works so don't take my word for it).

codygman commented 6 years ago

For anyone trying this or @anpryl, I just got this example to build as of 2fa57e30 (HEAD -> master, origin/master, origin/HEAD) Merge pull request #1066 from noughtmare/hideous-git-comment after this change:

modified   example-configs/yi-vim-vty-static/stack.yaml
@@ -9,4 +9,5 @@ packages:
     - 'yi-language'
     - 'yi-misc-modes'
     - 'yi-mode-haskell'
-extra-deps: []
\ No newline at end of file
+extra-deps: []
+allow-newer: true

EDIT: Oh wait, nope I've just reproduced your error:

--  While building custom Setup.hs for package text-icu-0.7.0.1 using:
      /home/cody/.stack/setup-exe-cache/x86_64-linux-nix/Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0 configure --with-ghc=/nix/store/27k61s37i4100x2148h6w4n8gbny8lx9-ghc-8.0.2/bin/ghc --with-ghc-pkg=/nix/store/27k61s
37i4100x2148h6w4n8gbny8lx9-ghc-8.0.2/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/cody/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/pkgdb --libdir=/home/cody/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/lib --bindir=/home/cody/.stack
/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/bin --datadir=/home/cody/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/share --libexecdir=/home/cody/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/libexec --sysconfdir=/home/cody/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.
0.2/etc --docdir=/home/cody/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/doc/text-icu-0.7.0.1 --htmldir=/home/cody/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/doc/text-icu-0.7.0.1 --haddockdir=/home/cody/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/doc/text-ic
u-0.7.0.1 --dependency=base=base-4.9.1.0 --dependency=bytestring=bytestring-0.10.8.1 --dependency=deepseq=deepseq-1.4.2.0 --dependency=text=text-1.2.2.1-6f2qEpRAAWiBgrajQZSQzB --extra-include-dirs=/nix/store/27k61s37i4100x2148h6w4n8gbny8lx9-ghc-8.0.2/include --extra-includ
e-dirs=/nix/store/5l6b97jscljkvsq9y9amg71v5jfzddm4-gcc-wrapper-6.4.0/include --extra-include-dirs=/nix/store/9bzdjxa0h1niiprs98jncxkddpmlz0gi-git-2.15.0/include --extra-lib-dirs=/nix/store/27k61s37i4100x2148h6w4n8gbny8lx9-ghc-8.0.2/lib --extra-lib-dirs=/nix/store/5l6b97jsc
ljkvsq9y9amg71v5jfzddm4-gcc-wrapper-6.4.0/lib --extra-lib-dirs=/nix/store/9bzdjxa0h1niiprs98jncxkddpmlz0gi-git-2.15.0/lib --exact-configuration                                                                                                                                 
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/cody/adhoc/Get-Yi-development-environment-working/yi/example-configs/yi-vim-vty-static/.stack-work/logs/text-icu-0.7.0.1.log

    Configuring text-icu-0.7.0.1...
    Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2: Missing dependencies on foreign
    libraries:
    * Missing C libraries: icuuc, icui18n, icudata
    This problem can usually be solved by installing the system packages that
    provide these libraries (you may need the "-dev" versions). If the libraries
    are already installed but in a non-standard location then you can use the
    flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.

--  While building custom Setup.hs for package terminfo-0.4.1.0 using:
      /run/user/1000/stack22355/terminfo-0.4.1.0/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/setup/setup --builddir=.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0 configure --with-ghc=/nix/store/27k61s37i4100x2148h6w4n8gbny8lx9-ghc-8.0.2/bin/ghc --with-ghc-pkg=/nix/
store/27k61s37i4100x2148h6w4n8gbny8lx9-ghc-8.0.2/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/cody/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/pkgdb --libdir=/home/cody/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/lib --bindir=/home
/cody/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/bin --datadir=/home/cody/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/share --libexecdir=/home/cody/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/libexec --sysconfdir=/home/cody/.stack/snapshots/x86_64-linux-nix
/lts-8.18/8.0.2/etc --docdir=/home/cody/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/doc/terminfo-0.4.1.0 --htmldir=/home/cody/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2/doc/terminfo-0.4.1.0 --haddockdir=/home/cody/.stack/snapshots/x86_64-linux-nix/lts-8.18/8.0.2
/doc/terminfo-0.4.1.0 --dependency=base=base-4.9.1.0 --extra-include-dirs=/nix/store/27k61s37i4100x2148h6w4n8gbny8lx9-ghc-8.0.2/include --extra-include-dirs=/nix/store/5l6b97jscljkvsq9y9amg71v5jfzddm4-gcc-wrapper-6.4.0/include --extra-include-dirs=/nix/store/9bzdjxa0h1niip
rs98jncxkddpmlz0gi-git-2.15.0/include --extra-lib-dirs=/nix/store/27k61s37i4100x2148h6w4n8gbny8lx9-ghc-8.0.2/lib --extra-lib-dirs=/nix/store/5l6b97jscljkvsq9y9amg71v5jfzddm4-gcc-wrapper-6.4.0/lib --extra-lib-dirs=/nix/store/9bzdjxa0h1niiprs98jncxkddpmlz0gi-git-2.15.0/lib -
-exact-configuration                                                                                                                                                                                                                                                            
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/cody/adhoc/Get-Yi-development-environment-working/yi/example-configs/yi-vim-vty-static/.stack-work/logs/terminfo-0.4.1.0.log

    [1 of 2] Compiling Main             ( /run/user/1000/stack22355/terminfo-0.4.1.0/Setup.lhs, /run/user/1000/stack22355/terminfo-0.4.1.0/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/setup/Main.o )
    [2 of 2] Compiling StackSetupShim   ( /home/cody/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /run/user/1000/stack22355/terminfo-0.4.1.0/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/setup/StackSetupShim.o )
    Linking /run/user/1000/stack22355/terminfo-0.4.1.0/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0/setup/setup ...
    Configuring terminfo-0.4.1.0...
    configure: WARNING: unrecognized options: --with-compiler
    checking for gcc... /nix/store/5l6b97jscljkvsq9y9amg71v5jfzddm4-gcc-wrapper-6.4.0/bin/cc
    checking whether the C compiler works... yes
    checking for C compiler default output file name... a.out
    checking for suffix of executables... 
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether /nix/store/5l6b97jscljkvsq9y9amg71v5jfzddm4-gcc-wrapper-6.4.0/bin/cc accepts -g... yes
    checking for /nix/store/5l6b97jscljkvsq9y9amg71v5jfzddm4-gcc-wrapper-6.4.0/bin/cc option to accept ISO C89... none needed
    checking for setupterm in -ltinfo... no
    checking for setupterm in -lncursesw... no
    checking for setupterm in -lncurses... no
    checking for setupterm in -lcurses... no
    configure: error: in `/run/user/1000/stack22355/terminfo-0.4.1.0':
    configure: error: curses library not found, so this package cannot be built
    See `config.log' for more details

Will look at fixing it again in a bit.

codygman commented 6 years ago

Okay, got it to build with:

modified   example-configs/yi-vim-vty-static/stack.yaml
@@ -9,4 +9,11 @@ packages:
     - 'yi-language'
     - 'yi-misc-modes'
     - 'yi-mode-haskell'
-extra-deps: []
\ No newline at end of file
+extra-deps:
+  - yi-rope-0.10
+nix:
+  packages:
+  - icu
+  - ncurses
+  - zlib
+  enable: true