Skip to content

Error building network package with cabal in windows 7 using n jobs

  • os: windows 7
  • console mingw64 installed with ghcup (but the same error is throwed using dos or powershell instead bash)
  • cabal, msys2, ghc installed with ghcup
  • motivation: build network to reproduce https://github.com/haskell/cabal/issues/7494
user@computer MINGW64 /d/ws/haskell/issues
# cabal get network

user@computer MINGW64 /d/ws/haskell/issues
# cd network-3.1.2.2/

user@computer MINGW64 /d/ws/haskell/issues/network-3.1.2.2
# cabal build -v
this build was affected by the following (project) config files:
Build profile: -w ghc-8.10.5 -O1
In order, the following will be built:
 - hsc2hs-0.68.7 (exe:hsc2hs) (requires build)
 - network-3.1.2.2 (lib:network) (first run)
creating D:\ws\haskell\issues\network-3.1.2.2\dist-newstyle\build
creating D:\ws\haskell\issues\network-3.1.2.2\dist-newstyle\tmp
Extracting
D:\cabal\packages\hackage.haskell.org\hsc2hs\0.68.7\hsc2hs-0.68.7.tar.gz to
D:\ws\haskell\issues\network-3.1.2.2\dist-newstyle\tmp\src-13172...
Updating hsc2hs.cabal with the latest revision from the index.
creating
D:\ws\haskell\issues\network-3.1.2.2\dist-newstyle\tmp\src-13172\hsc2hs-0.68.7\dist
Starting     hsc2hs-0.68.7 (exe:hsc2hs)
Using self-exec internal setup method with build-type Simple and args:
["act-as-setup","--build-type=Simple","--","configure","--verbose=2","--builddir=dist","--ghc","--prefix=D:\\csd\\ghc-8.10.5\\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761","--bindir=D:\\csd\\ghc-8.10.5\\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761\\bin","--libdir=D:\\csd\\ghc-8.10.5\\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761\\lib","--libsubdir=","--dynlibdir=D:\\csd\\ghc-8.10.5\\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761\\lib","--libexecdir=D:\\csd\\ghc-8.10.5\\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761\\libexec","--libexecsubdir=","--datadir=D:\\csd\\ghc-8.10.5\\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761\\share","--datasubdir=","--docdir=D:\\csd\\ghc-8.10.5\\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761\\share\\doc","--htmldir=D:\\csd\\ghc-8.10.5\\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761\\share\\doc\\html","--haddockdir=D:\\csd\\ghc-8.10.5\\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761\\share\\doc\\html","--sysconfdir=D:\\csd\\ghc-8.10.5\\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761\\etc","--enable-library-vanilla","--disable-library-profiling","--disable-shared","--disable-static","--disable-executable-dynamic","--disable-executable-static","--disable-profiling","--profiling-detail=default","--library-profiling-detail=default","--enable-optimization","--disable-debug-info","--disable-library-for-ghci","--disable-split-sections","--disable-split-objs","--disable-executable-stripping","--disable-library-stripping","--package-db=clear","--package-db=global","--package-db=D:\\csd\\ghc-8.10.5\\package.db","--flags=-in-ghc-tree","--extra-include-dirs=D:\\ghcup\\msys64\\mingw64\\include","--cid=hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761","--extra-lib-dirs=D:\\ghcup\\msys64\\mingw64\\lib","--extra-prog-path=D:\\ghcup\\bin","--extra-prog-path=D:\\ghcup\\msys64\\home\\user\\AppData\\Roaming\\cabal\\bin","--extra-prog-path=D:\\ghcup\\msys64\\usr\\bin","--extra-prog-path=D:\\ghcup\\msys64\\mingw64\\bin","--dependency=base=base-4.14.2.0","--dependency=containers=containers-0.6.4.1","--dependency=directory=directory-1.3.6.0","--dependency=filepath=filepath-1.4.2.1","--dependency=process=process-1.6.9.0","--disable-coverage","--exact-configuration","--with-ghc=D:\\ghcup\\bin\\ghc.exe","--with-ghc-pkg=D:\\ghcup\\bin\\ghc-pkg.exe","--ghc-option=-hide-all-packages","exe:hsc2hs"]
D:\ghcup\bin\cabal-3.4.0.0.exe act-as-setup --build-type=Simple -- configure
--verbose=2 --builddir=dist --ghc
--prefix=D:\csd\ghc-8.10.5\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761
--bindir=D:\csd\ghc-8.10.5\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761\bin
--libdir=D:\csd\ghc-8.10.5\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761\lib
--libsubdir=
--dynlibdir=D:\csd\ghc-8.10.5\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761\lib
--libexecdir=D:\csd\ghc-8.10.5\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761\libexec
--libexecsubdir=
--datadir=D:\csd\ghc-8.10.5\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761\share
--datasubdir=
--docdir=D:\csd\ghc-8.10.5\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761\share\doc
--htmldir=D:\csd\ghc-8.10.5\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761\share\doc\html
--haddockdir=D:\csd\ghc-8.10.5\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761\share\doc\html
--sysconfdir=D:\csd\ghc-8.10.5\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761\etc
--enable-library-vanilla --disable-library-profiling --disable-shared
--disable-static --disable-executable-dynamic --disable-executable-static
--disable-profiling --profiling-detail=default
--library-profiling-detail=default --enable-optimization --disable-debug-info
--disable-library-for-ghci --disable-split-sections --disable-split-objs
--disable-executable-stripping --disable-library-stripping --package-db=clear
--package-db=global --package-db=D:\csd\ghc-8.10.5\package.db
--flags=-in-ghc-tree --extra-include-dirs=D:\ghcup\msys64\mingw64\include
--cid=hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761
--extra-lib-dirs=D:\ghcup\msys64\mingw64\lib --extra-prog-path=D:\ghcup\bin
--extra-prog-path=D:\ghcup\msys64\home\user\AppData\Roaming\cabal\bin
--extra-prog-path=D:\ghcup\msys64\usr\bin
--extra-prog-path=D:\ghcup\msys64\mingw64\bin --dependency=base=base-4.14.2.0
--dependency=containers=containers-0.6.4.1
--dependency=directory=directory-1.3.6.0
--dependency=filepath=filepath-1.4.2.1 --dependency=process=process-1.6.9.0
--disable-coverage --exact-configuration --with-ghc=D:\ghcup\bin\ghc.exe
--with-ghc-pkg=D:\ghcup\bin\ghc-pkg.exe --ghc-option=-hide-all-packages
exe:hsc2hs
Redirecting build log to {handle:
D:\cabal\logs\ghc-8.10.5\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761.log}

# The build hangs at this point and you have to kill it with ctrl-c

user@computer MINGW64 /d/ws/haskell/issues/network-3.1.2.2
# cat "D:\cabal\logs\ghc-8.10.5\hsc2hs-0.68.7-0601b25968db3072cdb71fc19b4b150680177761.log"
Using Parsec parser
Configuring executable 'hsc2hs' for hsc2hs-0.68.7..
Warning: cannot determine version of D:\ghcup\bin\ghc.exe :
""
cabal-3.4.0.0.exe: The program 'ghc' version >=7.0.1 is required but the
version of D:\ghcup\bin\ghc.exe could not be determined.

user@computer MINGW64 /d/ws/haskell/issues/network-3.1.2.2
# "D:\ghcup\bin\ghc.exe" --numeric-version
8.10.5

It seems the shims exes still has some problem??

EDIT: cabal build -j1 works so some issue with concurrent access to shims is involved

Edited by Javier Neira
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information