Skip to content

Feature request: granular v2-clean  #7857

Closed

Description

@TeofilC

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.

Activity

  1. gbaz commented on Dec 6, 2021

    @gbaz
    Collaborator

    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.

  2. jneira commented on Dec 6, 2021

    @jneira
    Member

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

  3. bacchanalia commented on Dec 6, 2021

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

  4. michaelpj commented on Dec 8, 2021

    @michaelpj
    Collaborator

    Dupe? #7506

  5. TeofilC commented on Dec 8, 2021

    @TeofilC
    MemberAuthor

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

  6. Mikolaj commented on Dec 8, 2021

    @Mikolaj
    Member

    Duplicate of #7506

  7. Mikolaj commented on Dec 8, 2021

    @Mikolaj
    Member

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

  8. TeofilC commented on Dec 8, 2021

    @TeofilC
    MemberAuthor

    Sounds good to me!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions