Preserve per-component build info until pretty-printing #709
Open
alexfmpe wants to merge 2 commits intoNixOS:masterfrom
Open
Preserve per-component build info until pretty-printing #709alexfmpe wants to merge 2 commits intoNixOS:masterfrom
alexfmpe wants to merge 2 commits intoNixOS:masterfrom
Conversation
alexfmpe
commented
Mar 19, 2026
| , "tasty-discover" | ||
| , "hsx2hs" | ||
| , "markdown-unlit" | ||
| ] |
Member
Author
There was a problem hiding this comment.
I mostly rewrote this because I was having trouble getting the lenses to play nice with the subsequent change
alexfmpe
commented
Mar 19, 2026
| | otherwise = True | ||
|
|
||
| convertBuildInfo :: Cabal.BuildInfo -> Nix.BuildInfo | ||
| convertBuildInfo Cabal.BuildInfo {..} | not buildable = mempty |
Member
Author
There was a problem hiding this comment.
Surprisingly this line seems to have no effect, because finalizePD silently drops buildable: false components
alexfmpe
commented
Mar 19, 2026
| ] | ||
| where | ||
| pPrintBuildInfo' :: String -> [(BuildInfo, Bool)] -> Doc | ||
| pPrintBuildInfo' name = pPrintBuildInfo name . foldMap fst . filter snd |
Member
Author
There was a problem hiding this comment.
The filter snd coincidentally doesn't seem to have effect due to the way finalizePD works (see below comment), but I think it'd be very confusing not having it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Standalone mergeable step from my work on preserving cabal conditionals into nix.
Since that means that whether a component is
buildablemight only be determinable at eval time, we can't blindly fold them.The first commit mostly cleans up stuff so the commit with the actual change can be simpler.