Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to suppress Julia re-precompiling a package under development #738

Open
staticfloat opened this issue Mar 18, 2023 · 9 comments
Open
Labels
wishlist Feature requests

Comments

@staticfloat
Copy link

When working on packages that involve compiler internals, it's often useful to have Revise open and running for ease of experimentation, but also need to constantly kill the Julia session due to caching effects within the compiler. When the new Julia session attempts to load BigCompilerPackage, it will see that there have been changes made to the source code and then embark upon a massive precompilation undertaking, but I already have Revise loaded, so I'd much rather load the old precompile cache, and then have Revise monkey-patch in the changed definitions.

Would it be possible to have a mode where Revise can suppress the traditional Julia precompilation check, and manually update the loaded module according to the modified source on-disk? Perhaps by comparing timestamps of the files on-disk against the precompilation cache file timestamp?

@timholy timholy added the wishlist Feature requests label Mar 18, 2023
@timholy
Copy link
Owner

timholy commented Mar 18, 2023

That's a pretty interesting idea. It's a keeper.

@aviatesk
Copy link
Collaborator

So the idea is to accomplish something similar to what we can do with LocalPreferences.toml and the skip_precompile setting, but automatically? Or is something more advanced wanted here?

@staticfloat
Copy link
Author

No, this is separate. The idea is to avoid Julia’s builtin compilation trigger when loading a module.

@timholy
Copy link
Owner

timholy commented Mar 20, 2023

Assuming I understand it correctly, it's to by-pass the "is the cachefile stale?" logic for certain specified packages: load the cachefile despite its being stale, and then bring the code up-to-date with Revise. In other words, it mimicks what happens during the running session but still allows you to reset the other aspects of your system by restarting Julia.

@KristofferC
Copy link
Collaborator

But you will have a lot of stale cachefiles for the same package so you have to pick one of them. Probably the one most recently modified?

@tecosaur
Copy link

Perhaps the new version could also be quietly precompiled in the background? To make sure that you don't just get a growing pile of changes from an increasingly-old checkpoint.

@johnomotani
Copy link

Perhaps the new version could also be quietly precompiled in the background? To make sure that you don't just get a growing pile of changes from an increasingly-old checkpoint.

Even better would be to actually update the cache file in the same way the compiled code would be updated during a running session!

@timholy
Copy link
Owner

timholy commented Jul 31, 2023

Even better would be to actually update the cache file in the same way the compiled code would be updated during a running session!

That's really really hard to the point of near-impossibility. We write a "packed" (in memory) pkgimage and doing surgery on it is difficult. I suppose we could "nuke" the old implementation and append new stuff, but there are also pointer cross-references and all those would have to be updated. For 2023 this does not seem worth the amount of effort it would require.

@timholy
Copy link
Owner

timholy commented Jun 8, 2024

There's a slightly different proposal that would put such a mechanism into Julia itself here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wishlist Feature requests
Projects
None yet
Development

No branches or pull requests

6 participants