Skip to content

Clean but avoiding cloning the source repository packages again? #8832

Open

Description

@philderbeast

Is there a way to cabal clean without the next cabal build having to clone the source repository packages again? Can these clones be preserved?

$ cabal clean
$ cabal build
...
Cloning into '/.../dist-newstyle/src/amazonka...'
remote: Enumerating objects: 941841, done.
remote: Counting objects: 100% (171/171), done.
remote: Compressing objects: 100% (101/101), done.
remote: Total 941841 (delta 66), reused 151 (delta 59), pack-reused 941670
Receiving objects: 100% (941841/941841), 1.22 GiB | 28.97 MiB/s, done.
Resolving deltas: 100% (785798/785798), done.

I checked the help:

$ cabal clean --help
Clean the package store and remove temporary files.

Usage: cabal new-clean [FLAGS]

Removes all temporary files created during the building process (.hi, .o,
preprocessed sources, etc.) and also empties out the local caches (by
default).


Flags for clean:
 -h, --help                     Show this help text
 -v, --verbose[=n]              Control verbosity (n is 0--3, default
                                verbosity level is 1)
 --builddir=DIR                 The directory where Cabal puts generated build
                                files (default dist)
 --project-file=FILE            Set the name of the cabal.project file to
                                search for in parent directories
 -s, --save-config              Save configuration, only remove build
                                artifacts

Shouldn't this help now say (default dist-newstyle) now that the v2 commands are the default?

I tried --save-config but this didn't help.

Activity

  1. ulysses4ever commented on Mar 6, 2023

    @ulysses4ever
    Collaborator

    Shouldn't this help now say (default dist-newstyle) now that the v2 commands are the default?

    Absolutely. A PR would be welcome.

  2. michaelpj commented on Mar 7, 2023

    @michaelpj
    Collaborator

    Perhaps related: #7506

    (So you can avoid doing a full cabal clean in more circumstances)

  3. fgaz commented on Oct 5, 2026

    @fgaz
    Member

    Related: #9314

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