haskell-ide-engine icon indicating copy to clipboard operation
haskell-ide-engine copied to clipboard

Unable to build hie-865 on Ubuntu 18.04 LTS running in WSL2 container on Windows 10 (due to network package dep)

Open maxild opened this issue 4 years ago • 8 comments

OS

Windows 10 Build 19041.113

Using WSL 2 distro (Ubuntu 19.04 LTS)

Using Stack

I get the same error using Stack

Using Cabal

This is on a brand new WSL 2 distro. Steps to reproduce:

sudo apt update
sudo apt-get update
sudo apt upgrade

sudo add-apt-repository -y ppa:hvr/ghc
sudo apt-get update
sudo apt-get install -y ghc-8.6.5
sudo apt-get install -y cabal-install-2.4

sudo apt install libicu-dev libtinfo-dev libgmp-dev
cabal new-update

git clone https://github.com/haskell/haskell-ide-engine --recurse-submodules
cd haskell-ide-engine
cabal v2-run ./install.hs --project-file install/shake.project hie-8.6.5

This is the error written to stdout/stderr:

Installing   monad-memo-0.5.1 (lib)
Completed    monad-memo-0.5.1 (lib)
Warning: Some package(s) failed to build. Try rerunning with -j1 if you can't
see the error.
cabal: Failed to build network-3.1.1.1 (which is required by
lib:hie-test-utils from haskell-ide-engine-1.2, exe:hie-wrapper from
haskell-ide-engine-1.2 and others). The failure occurred during the configure
step. The build process terminated with exit code 77

Error when running Shake build system:
  at want, called at src/Development/Shake/Internal/Args.hs:83:69 in shake-0.18.5-dc580ce29df301712a8d38de66b6ee44db398183c2702d21cb38b9b522a2fe92:Development.Shake.Internal.Args
* Depends on: hie-8.6.5
  at command, called at src/Cabal.hs:28:13 in hie-install-0.8.1.0-inplace:Cabal
* Raised the exception:
Development.Shake.command, system command failed
Command line: cabal v2-install -w /opt/ghc/bin/ghc-8.6.5 --write-ghc-environment-files=never --symlink-bindir /home/maxfire/.cabal/bin --max-backjumps=5000 exe:hie exe:hie-wrapper --overwrite-policy=always --project-file=cabal.project -v1Exit code: 1
Stderr:
Warning: Some package(s) failed to build. Try rerunning with -j1 if you can't
see the error.
cabal: Failed to build network-3.1.1.1 (which is required by
lib:hie-test-utils from haskell-ide-engine-1.2, exe:hie-wrapper from
haskell-ide-engine-1.2 and others). The failure occurred during the configure
step. The build process terminated with exit code 77

maxild avatar Mar 10 '20 12:03 maxild

Mmm i am afraid that it might be a network-3.1.1.1 specific issue. If you do a cabal v2-install network-3.1.1.1 --lib, does it succesful? Anyway i think the best option could be open an issue in the package issue tracker: https://github.com/haskell/network/issues

A possible workaround could be try to use another network version that works in your environment. For do that you could add to hie cabal.project:

constraints:
        network == 3.1.0.1
        -- to avoid temporary a breaking change: https://github.com/haskell/haskell-ide-engine/issues/1680
        unliftio-core < 0.2.0.0,
        haskell-ide-engine +pedantic,
        hie-plugin-api     +pedantic

and try to install again, trying other versions than 3.1.0.1 if it does not work neither

jneira avatar Mar 10 '20 12:03 jneira

Yes it appears I cannot build network 3.1.1.1, and the same goes for network 3.1.0.1.

I have opened new issue here

maxild avatar Mar 11 '20 15:03 maxild

@maxild and with a version prior to 3.1? cabal build --constraint="network < 3.1" finds a build plan (i.e. starts the build) using network-3.0.1.1 (using ghc-8.6.5 and ghc-8.8.3)

jneira avatar Mar 12 '20 08:03 jneira

I have managed to built hie-8.6.5 using ghcup set 8.6.5 and cabal 3.0.0.0 on mac os x

On Ubuntu 18.04 LTS on WSL2 (windows 10, see above) using stack I ran into lots of problems. I have no time to pursue these problems.

How well is haskell suported on (native) windows considering these are the tools are need up and running on GHC 8.6.5

  • ghcid
  • hoogle
  • hlint
  • brittany
  • ghcide
  • haskell-ide-engine

I am under the impression that haskell is *nix land, like many languages outside .NET. Is this correct?

maxild avatar Mar 12 '20 15:03 maxild

Just for your information WSL2 is preview at the moment, and I have no access to native Ubuntu image (need disk space :grimacing:)

maxild avatar Mar 12 '20 15:03 maxild

@maxild Native windows experience is quite pleasant, if you use https://hub.zhox.com/posts/introducing-haskell-dev/. My expierence with cabal and ghc was nice, so far. Just gotta be careful to have a clean environment upon installation, e.g. no previous attempts of using cabal and msys2 on your system. Note, that until we support ghc 8.8.3, you ought to use ghc 8.6.5 or lower on windows. IIRC, you can install it via choco install ghc --version 8.6.5

fendor avatar Mar 12 '20 16:03 fendor

windows is my unique dev environment (for haskell too) and it is totally usable, although there are some (minor) problems. I have stack, cabal (lately it is my main build tool) and a bunch of ghc installations and i have been able to install all tools you mentioned. That said, the fact is most haskell devs and open source contributors use linux as their main environment and inevitably it make windows versions have more bugs and the fixes comes later. One rule of gold: keep all directories as short as you can, for ghc and other tools installations, stack and cabal cache dirs and projects. It is a problem that is being solved bit by bit but it still can bite you.

jneira avatar Mar 12 '20 20:03 jneira

Node.js used to be like that before node_modules was flattened using normalization. Back then npm didn't work on windows for a while, and there are a lot of npm users in the world!!! I guess most haskellers are using linux. Therefore I am curious why Ubuntu, didn't work as smooth as my macbook with xcode commandline tools. I like to try it on a distro not running on WSL2 some day.

I am a newbie in Haskell, but on *nix I found ghcup to be the best experience. Nice installer, with great help on the way.

Thanks for your help. I leave it up to you to close the issue. Maybe I hijacked it with the more general questions.

maxild avatar Mar 12 '20 20:03 maxild