# How do you clear cache from a __precompile__()?

#1

Sometimes it’s difficult to debug a package that’s precompiled.

What’s the most succinct way to clear its cache w/o just removing the package and reinstalling it?

i.e. the following code doesn’t seem to clear everything:

``````Pkg.build("Foo")
``````

Is manually changing a file somewhere in the package the best option?

(and does it clear all the cache it needs to?)

How to delete precompile cache?
#2

Take a look at `base/loading.jl`, there is a handy function that searches for cachefiles: `Base.find_all_in_cache_path`.

``````map(rm, Base.find_all_in_cache_path(:BenchmarkTools))
``````

#3

Just thought I’d put the nuclear option here too:

``````map(x->map(rm, Base.find_all_in_cache_path(Symbol(x))), keys(Pkg.installed()))
``````

Ok to nuke the Pkg .cache directory?