Stream: helpdesk (published)

Topic: Cleaning up Julia version environment


view this post on Zulip Júlio Hoffimann (May 15 2023 at 21:30):

Suppose I updated from Julia v1.8 to Julia v1.9. How to delete all the cache from v1.8? Can I just delete .julia/environments/v1.8? Is this the recommended method?

view this post on Zulip Mosè Giordano (May 15 2023 at 21:47):

That directory doesn't exist. The only version-specific directory is depot/compiled/vX.Y, it's unclear whether you meant that or something else

view this post on Zulip Júlio Hoffimann (May 15 2023 at 22:35):

I fixed the typo, I meant .julia/environments/v1.8

view this post on Zulip Júlio Hoffimann (May 15 2023 at 22:36):

Is it enough to clean these environment directories? Is there a Pkg command to cleanup anything related to a version x.y?

view this post on Zulip Jakob Nybo Nissen (May 16 2023 at 04:35):

Juliaup has a command to uninstall a version, but I don't know if it actually deletes all the files

view this post on Zulip Mason Protter (May 16 2023 at 05:03):

You can always just copy the project / manifest files and your config folder and then nuke everything else and re-instantiate

view this post on Zulip Nils (May 16 2023 at 07:56):

Given your question was "delete all the cache" you might have been after ~/.julia/compiled/v1.8 rather than the environment? ~/.julia/environments/v1.8 should just be a Project and Manifest file, so even with a big environment that's going to be <100kB, not worth worrying about?

view this post on Zulip Leandro Martínez (May 16 2023 at 14:15):

What about the artifacts? Is there a way to selectively delete them for the packages that are no longer needed?

view this post on Zulip Júlio Hoffimann (May 16 2023 at 14:44):

Nils said:

Given your question was "delete all the cache" you might have been after ~/.julia/compiled/v1.8 rather than the environment? ~/.julia/environments/v1.8 should just be a Project and Manifest file, so even with a big environment that's going to be <100kB, not worth worrying about?

Thanks for clarifying it @Nils , you are probably right. I am just wondering if there is a general established mechanism to clean up anything related to a global environment.

view this post on Zulip Sundar R (May 16 2023 at 14:53):

Leandro Martínez said:

What about the artifacts? Is there a way to selectively delete them for the packages that are no longer needed?

Pkg.gc is automatically run periodically, which should take care of those artifacts. You can also manually run ]gc --all to do it right away.

view this post on Zulip Nils (May 16 2023 at 15:32):

Júlio Hoffimann said:

Thanks for clarifying it Nils , you are probably right. I am just wondering if there is a general established mechanism to clean up anything related to a global environment.

I don't think there is. Also note that my suggestion about compiled is not specific to the global environment, but will delete all compiled code from any environment you had in 1.8, i.e. if you re-run some code in 1.8 you will have to precompile again (probably not an issue, but just wanted to clarify).


Last updated: Nov 22 2024 at 04:41 UTC