Suggestion to maintain project enviroment

Hi, I am looking forward some suggestions regarding how to maintain the project enviroment in julia. what I suffering is when I activate one of my project envrioment(it works smoothly before), it will raise error about precompling or world age.

an example is as below, I have a project env with package MutivariateStats, and I created and used it a few month ago. now I want to rerun the code for this project, however when I using the MutivariateStats, it starts prcompiling and raise an error. I have no idea why the env will “broken” if I donot modify the envrioment relate to it during the past few month.

# ... activate my project ...
using MultivariateStats
Precompiling MultivariateStats
  1 dependency successfully precompiled in 1 seconds. 50 already precompiled.
[ Info: Precompiling MultivariateStats [6f286f6a-111f-5878-ab1e-185364afe411]
Precompiling DistributionsTestExt
  2 dependencies successfully precompiled in 5 seconds. 46 already precompiled.
[ Info: Precompiling DistributionsTestExt [ffbe0ea5-a612-5ff7-aaf5-cac02eef3019]
┌ Warning: Module Distributions with build ID fafbfcfd-0936-31d1-0008-26b55485ce92 is missing from the cache.
│ This may mean Distributions [31c24e10-a181-5473-b8eb-7969acd0382f] does not support precompilation but is imported by a module that does.
â”” @ Base loading.jl:1948
[ Info: Skipping precompilation since __precompile__(false). Importing DistributionsTestExt [ffbe0ea5-a612-5ff7-aaf5-cac02eef3019].
┌ Error: Error during loading of extension DistributionsTestExt of Distributions, use `Base.retry_load_extensions()` to retry.
│   exception =
│    1-element ExceptionStack:
│    LoadError: MethodError: no method matching (::JuliaSyntax.var"#invoke_fixedworld#120"{JuliaSyntax.var"#invoke_fixedworld#117#121"{typeof(JuliaSyntax.core_parser_hook), UInt64}})(::String, ::String, ::Int64, ::Int64, ::Symbol)
│    The applicable method may be too new: running in world age 31454, while current world is 31544.
│
│    Closest candidates are:
│      (::JuliaSyntax.var"#invoke_fixedworld#120")(::Any...; kws...) (method too new to be called from this world context.)

sometime when I update the enviroment the issue will be solve and in more time it doesm’t work, thanks for any suggestions or tips.

This probably because the Julia version is different. To exactly reproduce the previous run it is better to use the same Julia version.

In parallel (after saving the Manisfest.toml file) you may try to up the environment packages with the current Julia version to get a working state.

Thank you. the Julia version is the same.

Intuitively, I think that if the packages in an environment haven’t been upgraded or downgraded, the packages in this env shouldn’t need to be precompiled.

I suspect it might stem from some shared dependencies modified in other envs? However, shouldn’t different environments be already isolated from each other?

I am supprise that it seems no one else has encountered a similar issue, it confused me in a long time.

It may be the update of some package that is loaded in your startup file, then. Do have anything there?

1 Like

Oh right, you reminded me that I did make quite a few useful configurations in the startup.jl. Great Thanks! @lmiq