Skip to content

Draft: hadrian: introduce --no-capture

Alp Mestanogullari requested to merge alp/ghc:alp/hadrian-outerr-capture into master

When passed, this flag prevents Shake from capturing stdout and stderr in anticipation of a builder failure. Shake's cmd family of functions usually do this for stdout by default, but since c62271a2 Hadrian started doing this for stderr too. Both can be a problem when we enable options for a builder that cause very large amounts of output to be printed, all of which gets captured by Shake so that it can report it if a builder fails, consuming correspondingly large amounts of memory along the way.

Passing --no-capture causes Shake to not capture anything and Hadrian would in the worst case echo the output of a builder to stdout directly if explicitly required when calling cmd', but never retaining any of it for error reporting purposes.

This was requested by @bgamari, I haven't verified that it does what it says on the tin, but one of Ben or myself will surely get around to checking that by the time this is reviewed.

PS: it's unfortunate to be introducing another .hs-boot file here, but the Builder -> CommandLine -> Flavour -> Expression -> Builder cycle just seemed too annoying to be dealt with in any other way.

Edited by Andreas Klebinger

Merge request reports