cabal icon indicating copy to clipboard operation
cabal copied to clipboard

Refactor clean and sdist to use NixStyleFlags

Open bacchanalia opened this issue 3 years ago • 7 comments

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.

bacchanalia avatar Feb 26 '22 04:02 bacchanalia

Any chance to add a test about? i guess the unique observable change is make --ignore-project effective

jneira avatar Feb 28 '22 07:02 jneira

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?

jneira avatar Feb 28 '22 09:02 jneira

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.

Mikolaj avatar Feb 28 '22 10:02 Mikolaj

@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 avatar Feb 28 '22 16:02 bacchanalia

@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?

ulysses4ever avatar Sep 29 '22 00:09 ulysses4ever

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.

bacchanalia avatar Sep 29 '22 00:09 bacchanalia

Thanks for updating us on it, and good luck with your endeavors!

ulysses4ever avatar Sep 29 '22 01:09 ulysses4ever

Marking this PR as draft :slightly_smiling_face:

Kleidukos avatar May 17 '23 06:05 Kleidukos