Assume I have an environment with packages X and Y, where X and Y both depend on a common package Z.
If I ] add X, I would get v0.2.0 of package Z.
If I ] add X, Y, Pkg resolves Y’s compat restrictions on Z, and I get v0.1.0 of package Z. Let’s call the environment that has both X and Y in it the “parent environment”.
Now, I want to ] add X while being wary of Y’s compat restriction without actually adding Y, i.e., when I do ] add X , I want Z to automatically resolve to v0.1.0 instead of v0.2.0 .
Is there any way I can do this?
I also have access to the parent environment (both, Project.toml and Manifest.toml are accessible), so is there some way I can inherit the transitive dependency resolution followed in the original environment in a new environment where I want to add only X and have Z set to v0.1.0 instead?
Can I use the Pkg.Types.EnvCache() (or something else from Pkg internals) of the parent environment in some way, to achieve this?