BinaryAnalysisPlatform / bap

Binary Analysis Platform
MIT License
2.05k stars 271 forks source link

loads packages before plugins to prevent failures in dune loader #1573

Closed ivg closed 1 year ago

ivg commented 1 year ago

If bundled plugins are loaded before dune packaged plugins, the latter will fail on modules that were linked by the former. The old bap plugin system has no way to notify the dune plugin system on what units are loaded (no worries the dynlink system used by both will prevent double-loading). Instead of catching the Unit_already_loaded exception from dune, we better first load all dune packages and only after that handle the old bundled plugins with our old loader, which is capable of handling correctly this exception.