Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix new dynlink's initialisation checks #2176
#1063 rewrote the various checks when loading shared libraries with dynlink in order to make them sound. However, the checks to ensure that a module is not used before it has been initialised were far too restrictive. For example, a module in a shared library could not refer to another library within the same shared library. This PR fixes that by updating the list of initialised units earlier. This PR also relaxes the "allowed units" check so that it only applies to implementation dependencies not interface dependencies -- which matches the previous behaviour and is necessary to deal with mli-only modules.
I also added a bunch of tests that exercise the various cases.
This PR should hopefully fix MPR#7876 -- although I haven't actually tried it.