Instantiate vs Resolve: Which Approach Safely Recovers a Corrupted Julia Environment?
0 reputation · 22 Jul 2020, 13:33 UTC
Goal
After a failed Julia package upgrade, the user wants to restore a functional environment that previously compiled successfully.
Constraints
During the upgrade, the Manifest.toml was modified to include an impossible or incompatible version entry for a package, causing subsequent using statements to error. The user has a backup of the original Manifest but does not know whether the recorded versions are still available on the registry.
Recovery Options
Two documented Pkg commands can be used: Pkg.instantiate() reinstalls the exact versions listed in the Manifest, while Pkg.resolve() recomputes a compatible set of versions based on the Project.toml constraints, potentially selecting newer releases.
Questions
- Will
Pkg.instantiate()always restore the pre‑upgrade state, or can it propagate existing incompatibilities? - Does
Pkg.resolve()guarantee a working configuration, and how does it handle the impossible version entry? - Under what circumstances should one prefer instantiate over resolve, or vice versa, when recovering from a corrupted environment?