You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
install --lib can create inconsistent environments when dependencies are involved #9582
install --lib can create inconsistent environments when packages are installed one by one (ie. when an environment is modified). This was fixed for the case of explicitly installed packages, but not for dependencies.
To Reproduce
Steps to reproduce the behavior:
foo depends on bar. Constraints simulate the evolution of the index.
$ cabal install --lib foo --constraint=bar==1
Now suppose a function f from foo returns/takes a type from bar. I install bar so I can interact with f:
$ cabal install --lib bar --constraint=bar==2
Poof, inconsistent environment. The two instances of bar don't match.
The second command succeeds because bar is not explicitly in the environment.
Could you explain what is wrong with the resulting environment, explicitly? It’s not clear to me. There are two problems. First, we don’t have a formal definition of an inconsistent environment, and it’s good to explain what exactly is meant here. Second, you don’t explain how the running example is “inconsistent” given the definition that you will have when address the first point.
Could you explain what is wrong with the resulting environment, explicitly?
Suppose I install foo depending on one version of containers and foo has a function that outputs a Set. But I can't work with that set because containers isn't yet installed itself (as an entry in the env file). Ok, so I install containers but now the solver gives me a different version. Now, the installed containers can't work with the result of that function in foo.
I noticed this problem here btw and suggested one approach: #8607 (comment)
But I'm wondering now if recording the hashes of all the transitive deps in the env file might be the more appropriate thing to do?
Activity
ulysses4ever commentedon Jan 2, 2024
Could you explain what is wrong with the resulting environment, explicitly? It’s not clear to me. There are two problems. First, we don’t have a formal definition of an inconsistent environment, and it’s good to explain what exactly is meant here. Second, you don’t explain how the running example is “inconsistent” given the definition that you will have when address the first point.
gbaz commentedon Jan 2, 2024
Suppose I install
foodepending on one version ofcontainersandfoohas a function that outputs a Set. But I can't work with thatsetbecausecontainersisn't yet installed itself (as an entry in the env file). Ok, so I installcontainersbut now the solver gives me a different version. Now, the installedcontainerscan't work with the result of that function infoo.I noticed this problem here btw and suggested one approach: #8607 (comment)
But I'm wondering now if recording the hashes of all the transitive deps in the env file might be the more appropriate thing to do?