Repository navigation
Conversation
andreasabel
left a comment
There was a problem hiding this comment.
This PR likely makes installation via stack fail on windows.
| , "-v0" | ||
| ]) | ||
| { std_in = CreatePipe | ||
| , std_out = CreatePipe |
There was a problem hiding this comment.
Is this correct? Considering that under Windows, Setup freezes now, and the easiest explanation would be a blocked pipe, maybe you fell into a similar trap as I did, see
There was a problem hiding this comment.
When I put here std_out = UseHandle stdout, then Setup runs correctly!
But then, Agda prints annoying emacs commands. So, the correct fix is probably to redirect the stdout but then swallow it in case Agda finished successfully.
| ExitSuccess -> return () | ||
| ExitFailure _ -> | ||
| die "Error: Failed to typecheck a builtin module!") | ||
| (\(Just wr, Just _, Nothing, p) -> do |
There was a problem hiding this comment.
You never consume the output generated by Agda, since you even throw away the output handle created by CreatePipe. This means that the pipe will block once it is full, and the buffer size is OS-specific. As a consequence Setup might freeze, such as we experience under Windows.
There was a problem hiding this comment.
I read that you have access to a Windows machine with a suitable build environment. Can you fix this?
There was a problem hiding this comment.
The following code seems to work under Linux:
import Control.Concurrent (forkIO) (\(Just wr, Just rd, Nothing, p) -> do
mapM_ (flip hSetEncoding utf8) [wr, rd]
hSetBuffering wr LineBuffering
-- TODO: Document why the following line is here.
_ <- forkIO (hGetContents rd >> return ())
mapM_ (hPutStrLn wr) loadBuiltinCmds)Regression introduced by #6110. The output of the created Agda process was never read, resulting in a blocked pipe when the buffer was full. Using the simpler `readCreateProcess` takes care of the correct pipe handling for us.
Regression introduced by #6110. The output of the created Agda process was never read, resulting in a blocked pipe when the buffer was full. Using the simpler `readCreateProcess` takes care of the correct pipe handling for us.
Regression introduced by #6110. The output of the created Agda process was never read, resulting in a blocked pipe when the buffer was full. Using the simpler `readCreateProcess` takes care of the correct pipe handling for us.
Regression introduced by #6110. The output of the created Agda process was never read, resulting in a blocked pipe when the buffer was full. Using the simpler `readCreateProcess` takes care of the correct pipe handling for us.
Regression introduced by #6110. The output of the created Agda process was never read, resulting in a blocked pipe when the buffer was full. Using the simpler `readCreateProcess` takes care of the correct pipe handling for us.
(Andreas: Goal of this PR: speed up generation of
<builtin>.agdaifiles during setup.)