Skip to content

stack script needs network to work normally? #5103

@diqye

Description

@diqye

The following file:

#!/usr/bin/env stack
{- stack --resolver global runghc
 --package process
 -}
{-# LANGUAGE OverloadedStrings #-}

main = do
  putStrLn "hello"

run command : stack xx.hs

Error reported in case of without network

HttpExceptionRequest Request {
  host                 = "mirrors.tuna.tsinghua.edu.cn"
  port                 = 80
  secure               = False
  requestHeaders       = [("Accept","application/json"),("User-Agent","The Haskell Stack")]
  path                 = "/stackage/snapshots.json"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 (ConnectionFailure Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [AI_ADDRCONFIG], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0, addrAddress = <assumed to be undefined>, addrCanonName = <assumed to be undefined>}, host name: Just "mirrors.tuna.tsinghua.edu.cn", service name: Just "80"): does not exist (nodename nor servname provided, or not known))

expect: to work without network connection

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions