Skip to content

Preserve conditionals until pretty-printing #712

Open
alexfmpe wants to merge 6 commits intoNixOS:masterfrom
alexfmpe:tree-finalized
Open

Preserve conditionals until pretty-printing #712
alexfmpe wants to merge 6 commits intoNixOS:masterfrom
alexfmpe:tree-finalized

Conversation

@alexfmpe
Copy link
Copy Markdown
Member

On top of #709

@alexfmpe
Copy link
Copy Markdown
Member Author

Hmm CI is failing for old GHC because simplifyWithSysParams is only exported starting with Cabal 3.8 and is missing for 3.6 and below.

We can inline it or gracefully degrade, but do we really want to bend over backwards for ghc 9.2 and below ?
Nixpkgs doesn't even ship it anymore

@alexfmpe
Copy link
Copy Markdown
Member Author

alexfmpe commented Mar 24, 2026

Actually I wonder if we'll even want to keep simplifyWithSysParams.

My plan was to first retain all needed conditional/component structure in Derivation without introducing observable changes in behavior, get that merged, and then gradually start transferring the conditionals to pretty-printed nix, with small changes to hackage-packages.nix on every step.

However, it ocurred to me that maybe both behaviors are actually useful - callCabal2nix could keep using the finalized version, while hackage-packages.nix wants the conditionals. In the limit we could allow fine-grained control over which ConfVar are specialized/finalized, in which case simplifyWithSysParams isn't really useful. This flexibility seems desireable if we want the option to target other distros.

So we could keep CI green and unchanged by only merging here up to Preserve finalization arguments until pretty-printing and then do a PR which in one go preserves conditionals and pretty-prints them, avoiding ever going through simplifyWithSysParams.

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