Remove DT_Failed mode
At the moment if -dynamic-too fails then we rerun the whole pipeline as if we were just in -dynamic mode. I argue this is
a misfeature and we should remove the so-called DT_Failed mode.
In what situations do we fall back to DT_Failed?
- If the
dyn_hifile corresponding to ahifile is missing completely. - If the interface hash of
dyn_hidoesn't match the interface hash ofhi.
What happens in DT_Failed mode?
- The whole compiler pipeline is rerun as if the user had just passed
-dynamic. - Therefore
dyn_hi/dyn_ofiles are used which don't agree with thehi/ofiles. (As evidenced bydynamicToo001test). - This is very confusing as now a single compiler invocation has produced further
hi/dyn_hifiles which are different to each other.
Why should we remove it?
- In
--makemode, which is predominately usedDT_Faileddoes not work (#19782 (closed)), there can't be users relying on this functionality. - In
-cmode, the recovery doesn't fix the root issue, which is thedyn_hiandhifiles are mismatched. We should instead produce an error and pass responsibility to the build system using-cto ensure that the prerequisites for-dynamic-too(dyn_hi/hi) files are there before we start compiling. - It is a misfeature to support use cases like
dynamicToo001which allow you to mix different versions of dynamic/non-dynamic interface files. It's more likely to lead to subtle bugs in your resulting programs where out-dated build products are used rather than a deliberate choice. - In practice, people are usually compiling with
-dynamic-toorather than separately with-dynamicand-static, so the build products always match andDT_Failedis only entered due to compiler bugs (see !6583 (closed))
What should we do instead?
- In
--makemode, for home packages check during recompilation checking thatdyn_hiandhiare both present and agree, recompile the modules if they do not. - For package modules, when loading the interface check that
dyn_hiandhiare there and that they agree but fail with an error message if they are not. - In
--oneshotmode, fail with an error message if the right files aren't already there.