well-typed / ghc-eventlog-socket

Pipe the GHC eventlog stream to a UNIX domain socket
BSD 3-Clause "New" or "Revised" License
15 stars 6 forks source link

Big rewrite #2

Closed phadej closed 2 years ago

phadej commented 3 years ago

I tried to comment code, I'll be happy to clarify.

mpickering commented 2 years ago

Can we review and merge this @bgamari ?

bgamari commented 2 years ago

I have gone ahead and merged this but it appears that there is something wrong here; a simple "hello world" testcase compiled with 8.10.7 (from #4) seems to result in an eventlog without a header.

@phadej, were you able to test this?

bgamari commented 2 years ago

I did a bit of digging here. The problem appears to be that the endEventLogging, which listen_iteration calls, pushes a block marker to the EventBuf. This then appears before the eventlog header (produced by startEventLogging) in the output stream. I fixed this in https://gitlab.haskell.org/ghc/ghc/-/commit/8188adf0f1a0482c269d1eb6350dd91dddc9ed29. Unfortunately, that commit is only in GHC 9.2 and later.

bgamari commented 2 years ago

Indeed I can confirm that things work as expected in GHC 9.2.

phadej commented 2 years ago

@bgamari I'm not working on this anymore. Please take over.

EDIT: IIRC I did very little testing on non-GHC-9.2 sources, if any.