# Forced recompilation

**URL:** <https://discourse.julialang.org/t/forced-recompilation/27367>\
**Category:** General Usage\
**Created:** [August 9, 2019, 11:12pm UTC](https://discourse.julialang.org/t/forced-recompilation/27367 "2019-08-09T23:12:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Post date:** [August 9, 2019, 11:12pm UTC](https://discourse.julialang.org/t/forced-recompilation/27367/1 "2019-08-09T23:12:23Z")

</div>

Is it possible to force Julia to recompile cached code?

Background: I need to upload packages with unregistered dependencies to a remote machine.  
If I `develop` these packages locally, `Manifest.toml` points to a directory that does not exist on the remote machine.  
If I `add` these packages locally, Julia may or may not recognize that something has changed and recompile. I would like to force a recompile.

Thank you.

---

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [August 9, 2019, 11:50pm UTC](https://discourse.julialang.org/t/forced-recompilation/27367/2 "2019-08-09T23:50:24Z")

</div>

Relevant (also to your previous post): [Experimenting and developing unregistered packages](https://discourse.julialang.org/t/experimenting-and-developing-unregistered-packages/16563/1).

Why not `dev` a relative path?

---

<div class="post-metadata">

**Author:** ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Post date:** [August 10, 2019, 12:53am UTC](https://discourse.julialang.org/t/forced-recompilation/27367/3 "2019-08-10T00:53:16Z")

</div>

I have to look at the link you provided in more detail tomorrow.

Regarding developing relative paths: I tried this and ended up with an error from `Pkg` from which I concluded that relative paths were not allowed in Manifests. Is that not true?

---

<div class="post-metadata">

**Author:** ![tkf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkf/32/17635_2.png) [@tkf](https://discourse.julialang.org/u/tkf)\
**Post date:** [August 10, 2019, 5:42am UTC](https://discourse.julialang.org/t/forced-recompilation/27367/4 "2019-08-10T05:42:21Z")

</div>

I use relative path in `Manifest.toml` all the time. It’s quite handy to use `path = ".."` in `test/Manifest.toml`, `docs/Manifest.toml`, etc. See:

[https://github.com/tkf/Transducers.jl/blob/9b4b33f3321cbab85dddf0ab84441cea87099c77/test/Manifest.toml#L270](https://github.com/tkf/Transducers.jl/blob/9b4b33f3321cbab85dddf0ab84441cea87099c77/test/Manifest.toml#L270)

---

<div class="post-metadata">

**Author:** ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Post date:** [August 10, 2019, 11:35am UTC](https://discourse.julialang.org/t/forced-recompilation/27367/5 "2019-08-10T11:35:33Z")

</div>

My solution so far has been similar to the [post](https://discourse.julialang.org/t/experimenting-and-developing-unregistered-packages/16563/2) suggested by @tkoolen, but more automatic (and complicated).  
I upload code with `rsync` to the remote and run `Pkg.develop(PackageSpec(D))` on all dependencies `D` each time the code is run. Not elegant, of course.

On the relative paths: what I tried was paths of the form “~/abc”; those did not work. I will try @tkf’s suggestion as well.

Thanks.

---

<div class="post-metadata">

**Author:** ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Post date:** [August 13, 2019, 5:25pm UTC](https://discourse.julialang.org/t/forced-recompilation/27367/6 "2019-08-13T17:25:58Z")

</div>

Coming back to my original question:

Can I force a recompile of an unregistered package?

I still have issues with code on the remote machine sometimes not loading because old versions of dependencies seems to be used when resolving dependencies. I don’t know why or when this happens.

One option may be: simply delete all subdirectories of `~/.julia/compiled/MyPackage`.

Should I be worried about any terrible side-effects when I do this?

---

<div class="post-metadata">

**Author:** ![dehann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dehann/32/2003_2.png) [@dehann](https://discourse.julialang.org/u/dehann)\
**Post date:** [November 19, 2020, 12:14am UTC](https://discourse.julialang.org/t/forced-recompilation/27367/7 "2020-11-19T00:14:29Z")

</div>

Much later reply to previous post, but I think it should be fine to delete the `~/.julia/compiled/vZ.Y/MyPackage/*.ji` binaries and then just reload the package:

```julia
$ julia -O3
julia> using MyPackage

```

---

<div class="post-metadata">

**Author:** ![hendri54](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hendri54/32/9621_2.png) [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Post date:** [November 19, 2020, 5:07pm UTC](https://discourse.julialang.org/t/forced-recompilation/27367/8 "2020-11-19T17:07:18Z")

</div>

Thank you.

I have meanwhile switched to a completely different approach where I register all packages in a private registry. This works very well for me.
