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

Feature request: granular v2-clean #7857

Closed
TeofilC opened this issue Dec 6, 2021 · 8 comments
Closed

Feature request: granular v2-clean #7857

TeofilC opened this issue Dec 6, 2021 · 8 comments

Comments

@TeofilC
Copy link
Collaborator

TeofilC commented Dec 6, 2021

Motivation
As far as I know cabal currently only supports wiping out all build artefacts.
Yet, I'm often in a situation where I only want to do this to a package or component.

This can be worked around by doing something like rm -r dist-newstyle/$PACKAGE, but it would be nice if cabal-install supported this directly.

Proposal
cabal clean when not given any further arguments stays as it is.

cabal clean [targets] wipes out only the build artefacts for targets.

If this sounds reasonable I'd be happy to give implementing it a go.

@gbaz
Copy link
Collaborator

gbaz commented Dec 6, 2021

Seems reasonable enough. My one question/concern would be the proper behavior if one is cleaning something lower in the build tree -- I'd think that "clean" would have to calculate that it needs to also clean the things dependent on it -- i.e. if one has a library, with a dependent executable, cleaning the lib would necessarily also mean cleaning the exe.

@jneira
Copy link
Member

jneira commented Dec 6, 2021

This could be aligned with some discussion around #7851 about implementing cabal clean script.sh

@bacchanalia
Copy link
Collaborator

This overlaps directly with the work I'm doing right now on scripts as is affects both how targets are calculated and the clean command.

@michaelpj
Copy link
Collaborator

Dupe? #7506

@TeofilC
Copy link
Collaborator Author

TeofilC commented Dec 8, 2021

What's the procedure for duplicate tickets? Should this be closed in favour of the pre-existing one?

@Mikolaj
Copy link
Member

Mikolaj commented Dec 8, 2021

Duplicate of #7506

@Mikolaj Mikolaj marked this as a duplicate of #7506 Dec 8, 2021
@Mikolaj
Copy link
Member

Mikolaj commented Dec 8, 2021

@TeofilC: if you are satisfied the other ticket covers your needs, please do close this one and keep the discussion/work alive on the other one. Thank you for your feedback!

@TeofilC
Copy link
Collaborator Author

TeofilC commented Dec 8, 2021

Sounds good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants