Skip to content

Conversation

alexfmpe
Copy link

@alexfmpe alexfmpe commented Oct 5, 2025

Not sure why this wasn't a problem before.
Maybe because haskell.nix does per-component builds so building the host side for windows basically never happened?

Fixes

Building executable 'iserv-proxy' for iserv-proxy-9.3...
[1 of 1] Compiling Main             ( Main.hs, dist/build/iserv-proxy/iserv-proxy-tmp/Main.o )
Main.hs:94:24: error: [GHC-39999]
    • No instance for ‘Read
                         (ghc-internal-9.1202.0:GHC.Internal.Ptr.Ptr ())’
        arising from a use of ‘read’
    • In the expression: read arg0
      In an equation for ‘wfd1’: wfd1 = read arg0
      In a stmt of a 'do' block:
        let wfd1 = read arg0
            rfd2 = read arg1
            ip = arg2
            port = read arg3
   |
94 |             let wfd1 = read arg0
   |                        ^^^^

Main.hs:109:8: error: [GHC-39999]
    • No instance for ‘Integral
                         (ghc-internal-9.1202.0:GHC.Internal.Ptr.Ptr ())’
        arising from a use of ‘fromIntegral’
    • In the second argument of ‘printf’, namely
        ‘(fromIntegral rfd2 :: Int)’
      In the second argument of ‘($)’, namely
        ‘printf
           "GHC iserv starting (in: %d; out: %d)\n" (fromIntegral rfd2 :: Int)
           (fromIntegral wfd1 :: Int)’
      In a stmt of a 'do' block:
        when verbose
          $ printf
              "GHC iserv starting (in: %d; out: %d)\n" (fromIntegral rfd2 :: Int)
              (fromIntegral wfd1 :: Int)
    |
109 |       (fromIntegral rfd2 :: Int) (fromIntegral wfd1 :: Int)

when verbose $
printf "GHC iserv starting (in: %d; out: %d)\n"
(fromIntegral rfd2 :: Int) (fromIntegral wfd1 :: Int)
inh <- getGhcHandle rfd2
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getGhcHandle on windows is HANDLE -> IO Handle where HANDLE = Ptr () rather than CInt -> IO Handle on unix

readGhcHandle handles both cases

dieWithUsage

when verbose $
printf "GHC iserv starting (in: %d; out: %d)\n"
Copy link
Author

@alexfmpe alexfmpe Oct 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old: GHC iserv starting (in: 79; out: 78)
New: GHC iserv starting (in: {handle: <file descriptor: 79>}; out: {handle: <file descriptor: 78>})

Is preserving the old behavior on unix worth CPP?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant