Reputation: 8103
When attempting to install the network package (cabal install network) on Windows Server 2008 inside of a cabal sandbox (1.18.*) I get the following error:
C:\Users\user\Project>cabal install network --prefix=C:\Users\user\Project
Resolving dependencies...
Configuring network-2.4.2.2...
configure: error: invalid package name: 0
Failed to install network-2.4.2.2
cabal: Error: some packages failed to install:
network-2.4.2.2 failed during the configure step. The exception was:
ExitFailure 1
Important to note that network is installed globally via the haskell platform, but won't install in the sandbox for a strange reason. The exact error looks like configure: error: invalid package name: 0
What could be prompting the package name to be 0?
Upvotes: 2
Views: 2486
Reputation: 9250
Use MinGHC, which provides binary installers for Windows with enough utilities that a standard cabal install
can successfully install the network
package.
Upvotes: 1
Reputation: 9250
The problem is you are installing from the Windows command prompt, you should instead use a Mingw or Cygwin shell. I find it easiest to install using Cygwin, then running:
WHICHGHC=`which ghc` && PATH=`dirname $WHICHGHC`/../mingw/bin:$PATH && cabal install network --configure-option --host=i386-unknown-mingw32 --global --enable-library-profiling
The full instructions, including alternative forms and feedback, are available on this blog post.
Upvotes: 4