# How do you clear cache from a \_\_precompile\_\_()?

**URL:** <https://discourse.julialang.org/t/how-do-you-clear-cache-from-a-precompile/7821>\
**Category:** General Usage\
**Tags:** question\
**Created:** [December 17, 2017, 8:47pm UTC](https://discourse.julialang.org/t/how-do-you-clear-cache-from-a-precompile/7821 "2017-12-17T20:47:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![djsegal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/djsegal/32/13752_2.png) [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Post date:** [December 17, 2017, 8:47pm UTC](https://discourse.julialang.org/t/how-do-you-clear-cache-from-a-precompile/7821/1 "2017-12-17T20:47:39Z")

</div>

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:

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

```

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

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

---

<div class="post-metadata">

**Author:** ![vchuravy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vchuravy/32/8_2.png) [@vchuravy](https://discourse.julialang.org/u/vchuravy)\
**Post date:** [December 17, 2017, 8:53pm UTC](https://discourse.julialang.org/t/how-do-you-clear-cache-from-a-precompile/7821/2 "2017-12-17T20:53:47Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![djsegal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/djsegal/32/13752_2.png) [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Post date:** [December 20, 2017, 6:56am UTC](https://discourse.julialang.org/t/how-do-you-clear-cache-from-a-precompile/7821/3 "2017-12-20T06:56:27Z")

</div>

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

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

```
