Forced recompilation

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.

Relevant (also to your previous post): Experimenting and developing unregistered packages.

Why not dev a relative path?

1 Like

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?

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:

My solution so far has been similar to the post 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.


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?

1 Like

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 -O3
julia> using MyPackage

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.