Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor clean and sdist to use NixStyleFlags #8017

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bacchanalia
Copy link
Collaborator

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.

- Consistently use `NixStyleFlags` for all v2- commands.
- This will simplify future changes such as haskell#7999.
- Mostly keep option parsers unchanged with the following exceptions:
  - Reorder options to by consistent with nixStyleOptions
    ConfigFlags > ProjectFlags > ExtraFlags
  - Add --ignore-project to clean, which currently does nothing,
    but will be useful for future clean improvements.
Copy link
Member

@Mikolaj Mikolaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jneira
Copy link
Member

jneira commented Feb 28, 2022

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

@jneira
Copy link
Member

jneira commented Feb 28, 2022

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?

@Mikolaj
Copy link
Member

Mikolaj commented Feb 28, 2022

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.

@bacchanalia
Copy link
Collaborator Author

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

@mergify mergify bot added the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label Sep 1, 2022
@ulysses4ever ulysses4ever removed the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label Sep 3, 2022
@ulysses4ever
Copy link
Collaborator

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

@bacchanalia
Copy link
Collaborator Author

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.

@ulysses4ever
Copy link
Collaborator

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

@Kleidukos
Copy link
Member

Marking this PR as draft 🙂

@Kleidukos Kleidukos marked this pull request as draft May 17, 2023 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants