Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,826
    • Issues 4,826
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 447
    • Merge requests 447
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #4454

Closed
Open
Created Oct 29, 2010 by Olathe@trac-Olathe

Misleading errors from Network.Socket

Problem

You must wrap sockets code with Network.Socket.withSocketsDo on Windows, or it will give misleading error messages :

Prelude Network.Socket> getAddrInfo Nothing (Just "google.com") Nothing
*** Exception: getAddrInfo: does not exist (error 10093)
Prelude Network.Socket> withSocketsDo $ getAddrInfo Nothing (Just "google.com") Nothing
[AddrInfo {addrFlags = [], addrFamily = AF_INET, addrSocketType = NoSocketType, ...

The error message led me on quite a wild goose chase trying cabal install Network and installing MinGW to let cabal work properly.

Proposed solution

It should give a clear error message whenever anything in Network.Socket is used without wrapping.

This should happen even outside of Windows as there are network libraries on Hackage developed on things other than Windows. Library authors are misled when they don't wrap their sockets code and everything tests perfectly on their non-Windows machine. When they learn about this issue, testing for it is an unnecessary hassle, since they then need to gain access to a Windows machine every time they want to be confident they've tested.

I encountered my own frustration with this when I installed http-enumerator and found a bug.

Trac metadata
Trac field Value
Version 6.12.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/base
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking