[GHC] #9543: Testsuite driver: replace "extra_clean" by "git clean -X"

GHC ghc-devs at haskell.org
Wed Sep 3 09:11:37 UTC 2014


#9543: Testsuite driver: replace "extra_clean" by "git clean -X"
-------------------------------------+-------------------------------------
       Reporter:  thomie             |                   Owner:  thomie
           Type:  task               |                  Status:  new
       Priority:  normal             |               Milestone:
      Component:  Test Suite         |                 Version:
       Keywords:                     |        Operating System:
   Architecture:  Unknown/Multiple   |  Unknown/Multiple
     Difficulty:  Unknown            |         Type of failure:
     Blocked By:                     |  None/Unknown
Related Tickets:                     |               Test Case:
                                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 When adding a new test that creates extra files, one also has to do some
 bookkeeping:
 1. Supply an `extra_clean` argument to the test function in `all.T`.
 2. Add an entry in `testsuite/.gitignore`

 Step number 1 is often forgotten. Currently there are over 200 uncleaned
 files and directories left behind in the `testsuite`, after running
 `validate` and then `make clean` (checked with `git clean -X -d -n | wc
 -l`).

 I propose to replace the functionality that `extra_clean` provides, namely
 to remove these extra files when one calls `make clean`, by  doing the
 equivalent of `git clean -X -d`:
 {{{
     -X
         Remove only files ignored by Git.

     -d
         Remove untracked directories in addition to untracked files. ...
 }}}

 That is: use the information from the `.ignore` files to figure out which
 files to delete on `make clean`.

 The advantages of making this change are:
 1. Less manual bookkeeping, less work, less code
 2. A more thorough `make clean`

 Implementation detail: we can not just call `git clean` directly, since
 this should also work when we are not in a git directory (for example a
 build directory created with [wiki:Building/Using lndir]).

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9543>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list