I try to install network with stack-2.1.3 and lts-14.1, but the installation always fails. The final message of the error tells " terminateProcess: permission denied (Permission denied)". The full error is as follows:
network > configure
network > [1 of 2] Compiling Main ( C:\Users\chenyulue\App Data\Local\Temp\stack8408\network-2.8.0.1\Setup.hs, C:\Users\chenyulue\AppData\ Local\Temp\stack8408\network-2.8.0.1.stack-work\dist\e626a42b\setup\Main.o )
network > [2 of 2] Compiling StackSetupShim ( C:\sr\setup-exe-src\setup-shim-Z6RU0evB.hs, C:\Users\chenyulue\AppData\Local\Temp\stack8408\network-2 .8.0.1.stack-work\dist\e626a42b\setup\StackSetupShim.o )
network > Linking C:\Users\chenyulue\AppData\Local\Temp\stack8408 \network-2.8.0.1\.stack-work\dist\e626a42b\setup\setup.exe ...
network > Configuring network-2.8.0.1...
network > configure: WARNING: unrecognized options: --with-compiler
network > configure: loading site script /usr/local/etc/config.site
network > checking build system type... x86_64-w64-mingw32
network > checking host system type... x86_64-w64-mingw32
network > checking for gcc... C:\Users\CHENYU1\AppData\Local\Programs\ stack\X86_641\GHC-861.5\lib../mingw/bin\gcc.exe
network > checking whether the C compiler works... yes
network > checking for C compiler default output file name... a.exe
network > checking for suffix of executables... .exe
network > checking whether we are cross compiling... no
network > checking for suffix of object files... o
network > checking whether we are using the GNU C compiler... yes
network > checking whether C:\Users\CHENYU1\AppData\Local\Programs\sta ck\X86_641\GHC-861.5\lib../mingw/bin\gcc.exe accepts -g... yes
network > checking for C:\Users\CHENYU1\AppData\Local\Programs\stack\X 86_641\GHC-861.5\lib../mingw/bin\gcc.exe option to accept ISO C89... none needed
network > checking for an ANSI C-conforming const... yes
network > checking how to run the C preprocessor... C:\Users\CHENYU1\A ppData\Local\Programs\stack\X86_641\GHC-861.5\lib../mingw/bin\gcc.exe -E
network > checking for grep that handles long lines and -e... /usr/bin/grep
network > checking for egrep... /usr/bin/grep -E
network > checking for ANSI C header files... yes
network > checking for sys/types.h... yes
network > checking for sys/stat.h... yes
network > checking for stdlib.h... yes
network > checking for string.h... yes
network > checking for memory.h... yes
network > checking for strings.h... yes
network > checking for inttypes.h... yes
network > checking for stdint.h... yes
network > checking for unistd.h... yes
network > checking fcntl.h usability... yes
network > checking fcntl.h presence... yes
network > checking for fcntl.h... yes
network > checking limits.h usability... yes
network > checking limits.h presence... yes
network > checking for limits.h... yes
network > checking for stdlib.h... (cached) yes
network > checking for sys/types.h... (cached) yes
network > checking for unistd.h... (cached) yes
network > checking winsock2.h usability... yes
network > checking winsock2.h presence... yes
network > checking for winsock2.h... yes
network > checking ws2tcpip.h usability... yes
network > checking ws2tcpip.h presence... yes
network > checking for ws2tcpip.h... yes
network > checking arpa/inet.h usability... no
network > checking arpa/inet.h presence... no
network > checking for arpa/inet.h... no
network > checking netdb.h usability... no
network > checking netdb.h presence... no
network > checking for netdb.h... no
network > checking netinet/in.h usability... no
network > checking netinet/in.h presence... no
network > checking for netinet/in.h... no
network > checking netinet/tcp.h usability... no
network > checking netinet/tcp.h presence... no
network > checking for netinet/tcp.h... no
network > checking sys/socket.h usability... no
network > checking sys/socket.h presence... no
network > checking for sys/socket.h... no
network > checking sys/uio.h usability... no
network > checking sys/uio.h presence... no
network > checking for sys/uio.h... no
network > checking sys/un.h usability... no
network > checking sys/un.h presence... no
network > checking for sys/un.h... no
network > checking linux/can.h usability... no
network > checking linux/can.h presence... no
network > checking for linux/can.h... no
network > checking linux/tcp.h usability... no
network > checking linux/tcp.h presence... no
network > checking for linux/tcp.h... no
network > checking net/if.h usability... no
network > checking net/if.h presence... no
network > checking for net/if.h... no
network > checking for readlink... no
network > checking for symlink... no
network > checking for if_nametoindex... no
network > checking for struct msghdr.msg_control... no
network > checking for struct msghdr.msg_accrights... no
network > checking for struct sockaddr.sa_len... no
network > checking for in_addr_t in netinet/in.h... no
network > checking for SO_PEERCRED and struct ucred in sys/socket.h... no
network > checking for getpeereid in unistd.h... checking for getpeereid... no
network > checking for _head_libws2_32_a in -lws2_32... no
network > checking for getaddrinfo... yes
network > checking for gai_strerror... no
network > checking whether AI_ADDRCONFIG is declared... no
network > checking whether AI_ALL is declared... no
network > checking whether AI_NUMERICSERV is declared... no
network > checking whether AI_V4MAPPED is declared... no
network > checking whether IPV6_V6ONLY is declared... yes
network > checking whether IPPROTO_IP is declared... yes
network > checking whether IPPROTO_TCP is declared... yes
network > checking whether IPPROTO_IPV6 is declared... yes
network > checking for sendfile in sys/sendfile.h... no
network > checking for sendfile in sys/socket.h... no
network > checking for gethostent... no
network > checking for accept4... no
network > configure: creating ./config.status
network > config.status: creating network.buildinfo
network > config.status: creating include/HsNetworkConfig.h
network > configure: WARNING: unrecognized options: --with-compiler
network > build
network > Preprocessing library for network-2.8.0.1..
network > Building library for network-2.8.0.1..
network > [1 of 9] Compiling Network.Socket.Types
network > [2 of 9] Compiling Network.Socket.Internal
network > [3 of 9] Compiling Network.Socket.ByteString.Internal
network > [4 of 9] Compiling Network.Socket
network > terminateProcess: permission denied (Permission denied)
Progress 1/14
I don't know whether it is related to the fact that the configuration has many Noes.
Thanks for any help!
I have tried stack 2.1.1, 2.1.0.3 and 2.1.0.1锛宎nd all can't install network. Only stack 1.9.3 works.
Hi @chenyulue
What's the precise command you're running?
There have been issues with network on windows in the past (e.g. #3944). Would you try network 3.0?
@dbaynard I just typied stack install network, and the network version is 2.8.0.1 in lts-14.1.
As you suggests, I try to build network-3.1.0.1 with stack-2.1.3:
stack unpack network
stack --resolver=lts-14.1 init
stack build
And it builds successfully.
@dbaynard maybe we could reopen this one? Sometimes upgrade network it is very difficult or impossible at all (see https://github.com/haskell/haskell-ide-engine/issues/1393#issuecomment-535420496)
It is strange but the installation doesn't fail in all win 10 environments (and it success with an older stack version or cabal in the same machine) :thinking:
%STACK_ROOT% folder the command stack unpack network-2.8.0.1 && cd network-2.8.0.1 && stack init --resolver=lts-13.30 && stack build works in my windows 7 and stack-2.1.3cabal build in a msys2 console inside network-2.8.0.1 with cabal-3.0.0.0 works too after deleting the v2-build store folder.stack install network-2.8.0.1 inside haskell-ide-engine also worksWindows_Stack stack-8.6.5 using network-2.8.0.1 also worked (with windows 10)So i am afraid i cant reproduce the error...
I have the same issue.
This may be related to https://github.com/haskell/process/issues/110,
and be affected by https://github.com/commercialhaskell/stack/commit/ed5c0a92799e592f3fd477125f4c44cff084a33e#diff-b11bbd924ba04568db154d7ee0f2c333R21
Mmm, interesting, so the process version used by stack-2.1.3 is 1.6.3.0 (in fact master uses it too) and it has not the fix for windows (it is in process-1.6.5.0).
But i still don't understand why works in some windows systems and with stack-1.9.3...
To confirm that process could be the origin of the error, i've cut an executable compiling stack from source using process-1.6.5.0. Let me know if any of you can test if it is able to compile network-2.8.0.1
Good news, @yutasth has tried to build network with the above executable and the real error was revealed: it is related with the character encoding so setting utf-8 in the console (with chcp 65001 in cmd) makes buildable network-2.8.0.1 with stack > 1.9.3
@jneira So precisely how did you fix it, and is it something that stack can do?
@dbaynard I fixed it by just running chcp 65001 before running stack. The error is raised only when the charset used in console is not UTF-8.
It would be nice if the stack dependency on process-1.6.3.0 is updated to > 1.6.5.0. stack-2.1.3 raises permission denied (Permission denied) instead of invalid argument (invalid character) due to a bug in process-1.6.3.0. The latter error is commonplace and you can easily find the workaround but former is not. See https://github.com/haskell/process/pull/111
I fixed it by just running
chcp 65001before running stack. The error is raised only when the charset used in console is not UTF-8.
I had the same problem, then this solution solved it. Thanks!
@dbaynard I fixed it by just running
chcp 65001before running stack. The error is raised only when the charset used in console is not UTF-8.
It would be nice if the stack dependency onprocess-1.6.3.0is updated to> 1.6.5.0.stack-2.1.3raisespermission denied (Permission denied)instead ofinvalid argument (invalid character)due to a bug inprocess-1.6.3.0. The latter error is commonplace and you can easily find the workaround but former is not. See haskell/process#111
This should be highlighted! Thanks!
@yutasth Thanks a lot for solving my problem!
Most helpful comment
@dbaynard I fixed it by just running
chcp 65001before running stack. The error is raised only when the charset used in console is not UTF-8.It would be nice if the stack dependency on
process-1.6.3.0is updated to> 1.6.5.0.stack-2.1.3raisespermission denied (Permission denied)instead ofinvalid argument (invalid character)due to a bug inprocess-1.6.3.0. The latter error is commonplace and you can easily find the workaround but former is not. See https://github.com/haskell/process/pull/111