Combination of -short-paths and -no-alias-deps can create inconsistent assumptions #6812
Original bug ID: 6812
When using -no-alias-deps in combination with a build setup where we have one module in a library that both aliases all the other modules and is used by all modules (see attached script), on type errors and with -short-paths, the compiler may start forcing the environment and load cmis for modules that aren't compiled yet (which is just a warning) or are compiled by not up to date (because they depend on the module being currently compiled for instance) which causes inconsistent assumptions.
I am not sure what the compiler should do. Obviously, not forcing aliases would the problem, but I don't know what the impact is on short-paths.
Also, in case we can kill two birds with one stone, I'll mention that the compiler prefers Lib__A.t in type errors over Lib.A.t which I suppose is expected but still a bit sad.
Steps to reproduce
I attached the script inconsistent_assumptions:
Stack trace of the compiler if it helps (that's the trace for my initial problem, not the small reproduction in the script but it should be the same):
Breakpoint 1, 0x00000000005028d0 in camlEnv__check_consistency_1494 ()
Comment author: @garrigue
Fixed in 4.02 and trunk at revisions 15916 and 15917.
The test case didn't repeat on the 4.02 branch, as we have switched to incremental computation of the environment. I have add a new test case, which forces the evaluation.