Refactor clean and sdist to use NixStyleFlags
This PR is motivated by #7999. To make all commands respect config verbose settings, I want to preprocess the flags before they're passed to the commands, and it simplifies the code significantly if all commands use NixStyleFlags instead of their own flag type. The only two commands still on their own flag type are clean and sdist.
This PR also changes the clean and sdist option ordering to make them more consistent with other commands, and adds --ignore-project to clean.
Any chance to add a test about? i guess the unique observable change is make --ignore-project effective
i guess the unique observable change is make --ignore-project effective
well does it make clean and sdist accept all those (nix style) flags? even if most of them does not make sense for those commands?
I don't know the answer, but there is a difference between "doesn't make sense and so crash" and "whatever the flag is supposed to ensure, is already ensured by different means, but may not be ensured so in the future, so forward-compatible scripts need to use that flag anyway". There is also a lot of space between these extremes.
@jneira clean and sdist should accept the same flags as before.
It occurs to me that clean --ignore-project should clean the result of build --ignore-project and I'm not sure that is that case now. I have to think about it some more and do some testing.
@bacchanalia has the question you left with led you to a deadlock? Is it possible to make a progress here and perhaps get the PR ready still?
I got busy and stopped doing cabal work, but I'm hoping to get back to it and wrap up some loose ends of things I was working on at some point, hopefully not too far in the future, but not at least for a few more weeks.
Thanks for updating us on it, and good luck with your endeavors!
Marking this PR as draft :slightly_smiling_face: